![]() |
Rosetta
2021.16
|
#include <JobsContainer.hh>

Public Member Functions | |
| JobsContainer () | |
| JobsContainer constructor. More... | |
| ~JobsContainer () override | |
| JobsContainer destructor. More... | |
| JobsContainerCOP | get_self_ptr () const |
| Default (shallow copy) copy constructor/assignment operator is the desired behavior. More... | |
| JobsContainerOP | get_self_ptr () |
| Get self owning pointers. More... | |
| JobOP | operator[] (core::Size const index) |
| Get a specific job, by number. More... | |
| JobCOP | operator[] (core::Size const index) const |
| Get a specific job, by number (const-access). More... | |
| core::Size | size () const |
| Get the total number of jobs. More... | |
| void | push_back (JobOP new_job) |
| Add a job to the list of jobs. More... | |
| void | set_total_jobs (core::Size const total_jobs) |
| Set the total number of jobs. More... | |
| void | clear () |
| Clear the jobs list. More... | |
| JobOP | back () |
| Access the last element. More... | |
| void | shuffle () |
| Randomize the order of elements (the map keys) More... | |
| void | erase (core::Size const index) |
| Erase an element in the jobs list. More... | |
| bool | has_job (core::Size const index) const |
| Does the job with the given index exist in the currently-loaded list of jobs? More... | |
| bool | can_be_deleted (core::Size const index) const |
| Can the job with the given index be deleted? More... | |
| core::Size | highest_job_index () const |
| Return the index of the highest job currently loaded in memory. More... | |
| void | set_job_inputter (JobInputterOP jobinputter) |
| Set the job inputter. More... | |
| void | get_loaded_job_indices (utility::vector1< core::Size > &output) const |
| Get a list of job indices currently in memory. More... | |
| void | set_all_current_jobs_as_deletable () |
| Mark all jobs currently in memory as deletable. More... | |
| void | set_force_job_purging (bool const val=true) |
| Set whether or not this JobsContainer forces job purging when higher-numbered jobs are requested. More... | |
| bool | force_job_purging () const |
| Get whether or not this JobsContainer forces job purging when higher-numbered jobs are requested. More... | |
Private Attributes | |
| std::map< core::Size, JobOP > | joblist_ |
| The list of owning pointers to jobs, with the job number as the key. More... | |
| core::Size | highest_job_index_ |
| The highest-index job in the joblist_ map. More... | |
| core::Size | total_jobs_ |
| The total number of jobs. More... | |
| bool | total_jobs_set_ |
| Has the total number of jobs been overridden? More... | |
| JobInputterOP | job_inputter_ |
| The JobInputter that populated this object (or which is otherwise associated with it). More... | |
| bool | force_job_purging_ |
| If true, and if a job inputter is used that limits the number of jobs in memory at any given time, then when a higher job index is requested than exists in memory, the JobsContainer will force job purging until that job exists in memory. If false (the default), then only deletable jobs will be purged, and the job inputter can attempt to add jobs up to the requested job (which might fail, if the requested job's number is too high). More... | |
The JobsContainer class contains a list of JobsOPs. It permits the list to be versatile – for example, if one wishes to load only a subset of jobs into memory at any given time.
| protocols::jd2::JobsContainer::JobsContainer | ( | ) |
JobsContainer constructor.
|
overridedefault |
JobsContainer destructor.
| JobOP protocols::jd2::JobsContainer::back | ( | ) |
Access the last element.
References highest_job_index_, and joblist_.
Referenced by protocols::comparative_modeling::ThreadingJobInputter::fill_jobs().
| bool protocols::jd2::JobsContainer::can_be_deleted | ( | core::Size const | index | ) | const |
Can the job with the given index be deleted?
References joblist_.
| void protocols::jd2::JobsContainer::clear | ( | ) |
Clear the jobs list.
References highest_job_index_, joblist_, total_jobs_, and total_jobs_set_.
Referenced by protocols::jd2::PoseInputStreamJobInputter::fill_jobs(), protocols::jd2::SerializedPoseJobInputter::fill_jobs(), protocols::jd2::PDBJobInputter::fill_jobs(), protocols::comparative_modeling::GenericJobInputter::fill_jobs(), protocols::jd2::EmptyPoseJobInputter::fill_jobs(), protocols::make_rot_lib::MakeRotLibJobInputter::fill_jobs(), protocols::jd2::LargeNstructJobInputter::fill_jobs(), protocols::jd2::AtomTreeDiffJobInputter::fill_jobs(), protocols::comparative_modeling::ThreadingJobInputter::fill_jobs(), protocols::jd2::SilentFileJobInputter::fill_jobs(), protocols::jd2::EnsembleJobInputter::fill_jobs(), and protocols::features::DatabaseJobInputter::fill_jobs().
| void protocols::jd2::JobsContainer::erase | ( | core::Size const | index | ) |
Erase an element in the jobs list.
References joblist_.
|
inline |
Get whether or not this JobsContainer forces job purging when higher-numbered jobs are requested.
If true, and if a job inputter is used that limits the number of jobs in memory at any given time, then when a higher job index is requested than exists in memory, the JobsContainer will force job purging until that job exists in memory. If false (the default), then only deletable jobs will be purged, and the job inputter can attempt to add jobs up to the requested job (which might fail, if the requested job's number is too high).
References force_job_purging_.
Referenced by operator[]().
| void protocols::jd2::JobsContainer::get_loaded_job_indices | ( | utility::vector1< core::Size > & | output | ) | const |
Get a list of job indices currently in memory.
The output vector is cleared and populated with the current job indices in memory.
References joblist_.
|
inline |
Default (shallow copy) copy constructor/assignment operator is the desired behavior.
Get self const owning pointers.
Referenced by operator[]().
|
inline |
Get self owning pointers.
| bool protocols::jd2::JobsContainer::has_job | ( | core::Size const | index | ) | const |
Does the job with the given index exist in the currently-loaded list of jobs?
References joblist_.
Referenced by operator[](), and protocols::jd2::MPIWorkPoolJobDistributor::slave_get_new_job_id().
|
inline |
Return the index of the highest job currently loaded in memory.
References highest_job_index_.
Referenced by operator[](), and protocols::jd2::MPIWorkPoolJobDistributor::slave_get_new_job_id().
| JobOP protocols::jd2::JobsContainer::operator[] | ( | core::Size const | index | ) |
Get a specific job, by number.
Should work even if jobs have been deleted, since this uses a map instead of an array.
References force_job_purging(), get_self_ptr(), has_job(), highest_job_index(), job_inputter_, joblist_, size(), total_jobs_, and protocols::jd2::TR().
| JobCOP protocols::jd2::JobsContainer::operator[] | ( | core::Size const | index | ) | const |
Get a specific job, by number (const-access).
Should work even if jobs have been deleted, since this uses a map instead of an array.
References highest_job_index(), joblist_, and total_jobs_.
| void protocols::jd2::JobsContainer::push_back | ( | JobOP | new_job | ) |
Add a job to the list of jobs.
References highest_job_index_, joblist_, total_jobs_, and total_jobs_set_.
Referenced by protocols::jd2::LazySilentFileJobInputter::fill_jobs(), protocols::jd2::ScreeningJobInputter::fill_jobs(), protocols::jd2::PoseInputStreamJobInputter::fill_jobs(), protocols::jd2::SerializedPoseJobInputter::fill_jobs(), protocols::jd2::PDBJobInputter::fill_jobs(), protocols::comparative_modeling::GenericJobInputter::fill_jobs(), protocols::jd2::EmptyPoseJobInputter::fill_jobs(), protocols::make_rot_lib::MakeRotLibJobInputter::fill_jobs(), protocols::jd2::AtomTreeDiffJobInputter::fill_jobs(), protocols::comparative_modeling::ThreadingJobInputter::fill_jobs(), protocols::jd2::SilentFileJobInputter::fill_jobs(), protocols::jd2::EnsembleJobInputter::fill_jobs(), protocols::features::DatabaseJobInputter::fill_jobs(), and protocols::jd2::LargeNstructJobInputter::populate_next_n_jobs().
| void protocols::jd2::JobsContainer::set_all_current_jobs_as_deletable | ( | ) |
Mark all jobs currently in memory as deletable.
This will result in all jobs being purged the next time a higher-index job is requeted.
|
inline |
Set whether or not this JobsContainer forces job purging when higher-numbered jobs are requested.
If true, and if a job inputter is used that limits the number of jobs in memory at any given time, then when a higher job index is requested than exists in memory, the JobsContainer will force job purging until that job exists in memory. If false (the default), then only deletable jobs will be purged, and the job inputter can attempt to add jobs up to the requested job (which might fail, if the requested job's number is too high).
References force_job_purging_, and protocols::hybridization::val.
Referenced by protocols::jd2::MPIWorkPoolJobDistributor::MPIWorkPoolJobDistributor().
|
inline |
Set the job inputter.
Needed if the job list is to be updated by the job inputter.
References job_inputter_.
Referenced by protocols::jd2::LargeNstructJobInputter::fill_jobs().
| void protocols::jd2::JobsContainer::set_total_jobs | ( | core::Size const | total_jobs | ) |
Set the total number of jobs.
This overrides whatever the length of the joblist_ is.
References highest_job_index_, total_jobs_, and total_jobs_set_.
Referenced by protocols::jd2::LargeNstructJobInputter::fill_jobs().
| void protocols::jd2::JobsContainer::shuffle | ( | ) |
Randomize the order of elements (the map keys)
References joblist_, and core::scoring::rg.
Referenced by protocols::jd2::ScreeningJobInputter::fill_jobs().
|
inline |
Get the total number of jobs.
Might not be the number in the joblist_ map, if we're only holding a subset in memory at any given time.
References total_jobs_.
Referenced by protocols::jd2::ShuffleFileSystemJobDistributor::get_new_job_id(), protocols::jd2::FileSystemJobDistributor::get_new_job_id(), protocols::jd2::MPIWorkPartitionJobDistributor::get_new_job_id(), protocols::jd2::get_spanning_jobs(), protocols::jd2::BOINCJobDistributor::go(), protocols::jd2::VectorPoseJobDistributor::go_mpi(), protocols::jd2::VectorPoseJobDistributor::go_serial(), protocols::jd2::MPIFileBufJobDistributor::master_get_new_job_id(), protocols::jd2::MPIWorkPoolJobDistributor::master_get_new_job_id(), protocols::jd2::MPIWorkPoolJobDistributor::master_remove_bad_inputs_from_job_list(), protocols::jd2::MPIWorkPartitionJobDistributor::MPIWorkPartitionJobDistributor(), protocols::jd2::archive::MPIArchiveJobDistributor::notify_archive(), operator[](), and protocols::jd2::MPIWorkPartitionJobDistributor::remove_bad_inputs_from_job_list().
|
private |
If true, and if a job inputter is used that limits the number of jobs in memory at any given time, then when a higher job index is requested than exists in memory, the JobsContainer will force job purging until that job exists in memory. If false (the default), then only deletable jobs will be purged, and the job inputter can attempt to add jobs up to the requested job (which might fail, if the requested job's number is too high).
Referenced by force_job_purging(), and set_force_job_purging().
|
private |
The highest-index job in the joblist_ map.
Starts at 0 and counts up as elements are added.
Referenced by back(), clear(), highest_job_index(), push_back(), and set_total_jobs().
|
private |
The JobInputter that populated this object (or which is otherwise associated with it).
Referenced by operator[](), and set_job_inputter().
|
private |
The list of owning pointers to jobs, with the job number as the key.
Referenced by back(), can_be_deleted(), clear(), erase(), get_loaded_job_indices(), has_job(), operator[](), push_back(), and shuffle().
|
private |
The total number of jobs.
By default, this will be the size of the joblist_, unless overridden.
Referenced by clear(), operator[](), push_back(), set_total_jobs(), and size().
|
private |
Has the total number of jobs been overridden?
Default false.
Referenced by clear(), push_back(), and set_total_jobs().
1.8.7