Rosetta Protocols  2014.35
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
protocols::jd2::JobDistributor Class Referenceabstract

#include <JobDistributor.hh>

Public Member Functions

virtual ~JobDistributor ()
 
virtual void go (protocols::moves::MoverOP mover)
 This may be overridden by derived classes. Default implementation invokes go_main. More...
 
void go (protocols::moves::MoverOP mover, JobOutputterOP jo)
 invokes go, after setting JobOutputter More...
 
JobOP current_job () const
 Movers may ask their controlling job distributor for information about the current job. They may also load information into this job for later output. More...
 
std::string current_output_name () const
 Movers may ask their controlling job distributor for the output name as defined by the Job and JobOutputter. More...
 
JobOutputterOP job_outputter () const
 Movers (or derived classes) may ask for the JobOutputter. More...
 
void set_job_outputter (const JobOutputterOP &new_job_outputter)
 Movers (or derived classes) may ask for the JobOutputter. More...
 
JobInputterOP job_inputter () const
 JobInputter access. More...
 
virtual void mpi_finalize (bool finalize)
 should the go() function call MPI_finalize()? It probably should, this is true by default. More...
 
JobInputterInputSource::Enum job_inputter_input_source () const
 The input source for the current JobInputter. More...
 
virtual void restart ()
 
core::Size total_nr_jobs () const
 
core::Size current_job_id () const
 integer access - which job are we on? More...
 
std::string get_current_batch () const
 what is the current batch ? — name refers to the flag-file used for this batch More...
 
virtual void add_batch (std::string const &, core::Size id=0)
 add a new batch ( name will be interpreted as flag_file ) More...
 
core::Size current_batch_id () const
 what is the current batch number ? — refers to position in batches_ More...
 

Static Public Member Functions

static JobDistributorget_instance ()
 static function to get the instance of ( pointer to) this singleton class More...
 

Protected Member Functions

 JobDistributor ()
 Singleton instantiation pattern; Derived classes will call default ctor, but their ctors, too must be protected (and the JDFactory must be their friend.) More...
 
 JobDistributor (bool empty)
 MPIArchiveJobDistributor starts with an empty job-list... More...
 
void go_main (protocols::moves::MoverOP mover)
 Non-virtual get-job, run it, & output loop. This function is pretty generic and your subclass may be able to use it. It is NOT virtual - this implementation can be shared by (at least) the simple FileSystemJobDistributor, the MPIWorkPoolJobDistributor, and the MPIWorkPartitionJobDistributor. Do not feel that you need to use it as-is in your class - but DO plan on implementing all its functionality! More...
 
Jobs const & get_jobs () const
 Read access to private data for derived classes. More...
 
void mark_job_as_completed (core::Size job_id, core::Real run_time)
 Jobs is the container of Job objects need non-const to mark Jobs as completed on Master in MPI-JobDistributor. More...
 
void mark_job_as_bad (core::Size job_id)
 
ParserOP parser () const
 Parser access. More...
 
void begin_critical_section ()
 
void end_critical_section ()
 
bool obtain_new_job (bool re_consider_current_job=false)
 this function updates the current_job_id_ and current_job_ fields. The boolean return states whether or not a new job was obtained (if false, quit distributing!) More...
 
virtual core::Size get_new_job_id ()=0
 Return 0 to signal that no available jobs remain. Otherwise return an index into the Jobs object. More...
 
virtual void job_succeeded (core::pose::Pose &pose, core::Real run_time, std::string const &tag)
 This function is called upon a successful job completion; it has been virtualized so BOINC and MPI can delay/protect output base implementation is just a call to the job outputter. More...
 
virtual void job_succeeded_additional_output (core::pose::Pose &pose, std::string const &tag)
 This function is called upon a successful job completion if there are additional poses generated by the mover base implementation is just a call to the job outputter. More...
 
virtual void job_failed (core::pose::Pose &, bool)
 This function is called when we give up on the job; it has been virtualized so BOINC and MPI can delay/protect output base implementation is just a call to the job outputter. More...
 
virtual void mark_current_job_id_for_repetition ()=0
 this function is called whenever a job "soft-fails" and needs to be retried. Generally it should ensure that the subsequent call to obtain_new_job returns this job over again. More...
 
virtual void remove_bad_inputs_from_job_list ()
 this function is called inside go_main if a mover returns FAIL_BAD_INPUT. Its purpose is to remove other jobs with the same input (which will still be bad) from the available list of jobs. The default implementation is a no-op and not all distributors are expected/able to implement this functionality, only those that can guaruntee no other jobs of that input are currently running. More...
 
virtual void current_job_finished ()
 Derived classes are allowed to clean up any temporary files or data relating to the current job after the current job has completed. Called inside go_main loop. Default implementation is a no-op. More...
 
virtual void note_all_jobs_finished ()
 Derived classes are allowed to perform some kind of action when the job distributor runs out of jobs to execute. Called inside go_main. Default implementation is a no-op. More...
 
void clear_current_job_output ()
 
virtual void handle_interrupt ()=0
 This function got called when job is not yet finished and got termitated abnormaly (ctrl-c, kill etc). when implimenting it in subclasses make sure to delete all in-progress-data that your job spawn. More...
 
void set_batch_id (core::Size setting)
 set current_batch_id — eg for slave nodes in MPI framework More...
 
virtual bool next_batch ()
 switch current_batch_id_ to next batch More...
 
virtual void batch_underflow ()
 if end of batches_ reached via next_batch or set_batch_id ... More...
 
virtual void load_new_batch ()
 called by next_batch() or set_batch_id() to switch-over and restart JobDistributor on new batch More...
 
core::Size nr_batches () const
 how many batches are in our list ... this can change dynamically More...
 
std::string const & batch (core::Size batch_id)
 give name of batch with given id More...
 

Static Protected Member Functions

static void setup_system_signal_handler (void(*prev_fn)(int)=jd2_signal_handler)
 Setting up callback function that will be call when our process is about to terminate. More...
 
static void remove_system_signal_handler ()
 Set signal handler back to default state. More...
 
static void jd2_signal_handler (int Signal)
 Default callback function for signal handling. More...
 

Private Member Functions

void init_jd ()
 
void populate_batch_list_from_cmd ()
 read -run:batches More...
 

Static Private Member Functions

static JobDistributorcreate_singleton_instance ()
 private singleton creation function to be used with utility::thread::threadsafe_singleton More...
 

Private Attributes

JobInputterOP job_inputter_
 
JobOutputterOP job_outputter_
 
ParserOP parser_
 
Jobs jobs_
 
JobOP current_job_
 pointer to current job. Information is somewhat duplicated with current_job_id_. More...
 
core::Size current_job_id_
 access into jobs_ vector indicating current job. Contains more information than current_job_ in that it can be incremented... More...
 
core::Size last_completed_job_
 access into jobs_ bector indicating the previous job. Used with the -jd2:delete_old_poses option for deleting unnecessary poses More...
 
core::Size current_batch_id_
 current_batch or 0 More...
 
utility::vector1< std::stringbatches_
 all batches if present More...
 

Static Private Attributes

static JobDistributorinstance_ = 0
 

Friends

class JobDistributorFactory
 

Detailed Description

Enforced JobDistributor destruction turned out to cause problems - calls to Tracers and/or the Options system during destruction caused crashes if those systems had been destructed first. So this is deprecated.

Constructor & Destructor Documentation

protocols::jd2::JobDistributor::JobDistributor ( )
protected

Singleton instantiation pattern; Derived classes will call default ctor, but their ctors, too must be protected (and the JDFactory must be their friend.)

References init_jd().

protocols::jd2::JobDistributor::JobDistributor ( bool  empty)
protected

MPIArchiveJobDistributor starts with an empty job-list...

References protocols::jd2::JobDistributorFactory::create_parser(), init_jd(), job_inputter_, job_outputter_, and parser_.

protocols::jd2::JobDistributor::~JobDistributor ( )
virtual

WARNING WARNING! SINGLETONS' DESTRUCTORS ARE NEVER CALLED IN MINI! DO NOT TRY TO PUT THINGS IN THIS FUNCTION! here's a nice link explaining why: http://www.research.ibm.com/designpatterns/pubs/ph-jun96.txt

Member Function Documentation

void protocols::jd2::JobDistributor::add_batch ( std::string const &  batch,
core::Size  id = 0 
)
virtual

add a new batch ( name will be interpreted as flag_file )

add new batch to end of batch list... this might be called asynchronous... ie. while we are still in the middle of a current batch, or while we are in non-batch mode

References batch(), batches_, and protocols::jd2::BatchJobInputter::BOGUS_BATCH_ID.

Referenced by protocols::jd2::archive::ArchiveManager::cancel_batch(), protocols::jd2::archive::ArchiveManager::queue_batch(), and protocols::jd2::archive::MPIArchiveJobDistributor::receive_batch().

std::string const& protocols::jd2::JobDistributor::batch ( core::Size  batch_id)
inlineprotected

give name of batch with given id

References batches_.

Referenced by add_batch(), and protocols::jd2::archive::MPIArchiveJobDistributor::sync_batches().

virtual void protocols::jd2::JobDistributor::batch_underflow ( )
inlineprotectedvirtual

if end of batches_ reached via next_batch or set_batch_id ...

Reimplemented in protocols::jd2::archive::MPIArchiveJobDistributor.

Referenced by next_batch(), and set_batch_id().

void protocols::jd2::JobDistributor::begin_critical_section ( )
protected

Referenced by go_main().

void protocols::jd2::JobDistributor::clear_current_job_output ( )
protected
JobDistributor * protocols::jd2::JobDistributor::create_singleton_instance ( )
staticprivate

private singleton creation function to be used with utility::thread::threadsafe_singleton

References protocols::jd2::JobDistributorFactory::create_job_distributor().

Referenced by get_instance().

core::Size protocols::jd2::JobDistributor::current_batch_id ( ) const
inline
JobOP protocols::jd2::JobDistributor::current_job ( ) const

Movers may ask their controlling job distributor for information about the current job. They may also load information into this job for later output.

References current_job_.

Referenced by protocols::loop_build::LoopBuildMover::apply(), protocols::simple_moves::AddJobPairData::apply(), protocols::ligand_docking::WriteLigandMolFile::apply(), protocols::protein_interface_design::movers::InterfaceRecapitulationMover::apply(), protocols::anchored_design::AnchoredDesignMover::apply(), protocols::protein_interface_design::movers::DockWithHotspotMover::apply(), protocols::analysis::LoopAnalyzerMover::apply(), protocols::ligand_docking::StartFrom::apply(), protocols::hotspot_hashing::movers::PlaceProbeMover::apply(), protocols::surface_docking::SurfaceDockingProtocol::apply(), protocols::canonical_sampling::CanonicalSamplingMover::apply(), protocols::ligand_docking::Transform::apply(), protocols::anchored_design::AnchoredDesignMover::calculate_rmsd(), protocols::jd2::current_output_filename(), protocols::jd2::current_output_name(), current_output_name(), protocols::features::ReportToDB::ensure_structure_tags_are_ready(), protocols::hotspot_hashing::movers::PlaceProbeMover::execute_one_search(), protocols::jd2::get_current_job(), protocols::jd2::get_current_jobs_starting_pose(), protocols::features::ScreeningFeatures::get_desriptor_data(), protocols::jd2::JD2ResourceManager::get_resource(), protocols::jd2::jd2_used(), protocols::jd2::BOINCJobDistributor::job_failed(), protocols::canonical_sampling::mc_convergence_checks::Pool_ConvergenceCheck::operator()(), OPT_1GRP_KEY(), protocols::jd2::output_intermediate_pose(), protocols::surface_docking::FullatomRelaxMover::output_solution_state(), protocols::jd2::MPIFileBufJobDistributor::process_message(), protocols::jd2::MPIWorkPartitionJobDistributor::remove_bad_inputs_from_job_list(), protocols::simple_filters::ReportFilter::report(), protocols::rotamer_recovery::RRReporterSQLite::report_rotamer_recovery_full(), protocols::docking::DockingPrepackProtocol::score_and_output(), protocols::jd2::MPIFileBufJobDistributor::slave_job_succeeded(), and protocols::jd2::MPIWorkPoolJobDistributor::slave_job_succeeded().

void protocols::jd2::JobDistributor::current_job_finished ( )
protectedvirtual

Derived classes are allowed to clean up any temporary files or data relating to the current job after the current job has completed. Called inside go_main loop. Default implementation is a no-op.

Reimplemented in protocols::jd2::FileSystemJobDistributor.

Referenced by go_main().

core::Size protocols::jd2::JobDistributor::current_job_id ( ) const
std::string protocols::jd2::JobDistributor::current_output_name ( ) const
void protocols::jd2::JobDistributor::end_critical_section ( )
protected

Referenced by go_main().

std::string protocols::jd2::JobDistributor::get_current_batch ( ) const

what is the current batch ? — name refers to the flag-file used for this batch

BATCH interface:

the BATCH interface of the JobDistributor is used to allow consecutive execution of a set of jobs with different flags different batches behave like completely independent rosetta runs — but of course a number of processes can already work on a new batch, while others are still finishing the last jobs of the previous batch. run from command-line with -run:batches flag1 flag2 flag3 the flag1 flag2... point to files that are added to all other flags ( and removed at end of batch ) you can have all output in same output file or ( by redefining e.g. -out:file:silent in each batch-flag file ) in different output files

References batches_, protocols::jd2::BatchJobInputter::BOGUS_BATCH_ID, and current_batch_id_.

Referenced by protocols::jd2::BatchJobInputter::check_batch(), protocols::jd2::current_batch(), next_batch(), obtain_new_job(), protocols::jd2::archive::MPIArchiveJobDistributor::process_message(), and protocols::jd2::MPIFileBufJobDistributor::slave_get_new_job_id().

JobDistributor * protocols::jd2::JobDistributor::get_instance ( )
static

static function to get the instance of ( pointer to) this singleton class

References create_singleton_instance(), instance_, and utility::thread::safely_create_singleton().

Referenced by protocols::jd2::JobOutputter::affixed_numbered_name(), protocols::loop_build::LoopBuildMover::apply(), protocols::simple_moves::AddJobPairData::apply(), protocols::qsar::qsarMover::apply(), protocols::RotamerDump::RotamerDumpMover::apply(), protocols::ligand_docking::WriteLigandMolFile::apply(), protocols::frag_picker::nonlocal::NonlocalFrags::apply(), protocols::protein_interface_design::movers::InterfaceRecapitulationMover::apply(), protocols::ligand_docking::ComputeLigandRDF::apply(), protocols::make_rot_lib::MakeRotLibMover::apply(), protocols::protein_interface_design::filters::FilterScanFilter::apply(), protocols::matdes::ExtractSubposeMover::apply(), protocols::simple_moves::ddG::apply(), protocols::anchored_design::AnchoredDesignMover::apply(), protocols::protein_interface_design::movers::DockWithHotspotMover::apply(), protocols::analysis::LoopAnalyzerMover::apply(), protocols::antibody::AntibodyModelerProtocol::apply(), protocols::antibody::GraftCDRLoopsProtocol::apply(), protocols::toolbox::task_operations::ReadResfileFromDB::apply(), protocols::ligand_docking::StartFrom::apply(), protocols::contact_map::ContactMap::apply(), protocols::hotspot_hashing::movers::PlaceProbeMover::apply(), protocols::ligand_docking::InterfaceScoreCalculator::apply(), protocols::rosetta_scripts::ParsedProtocol::apply(), protocols::simple_moves::ReportEffectivePKA::apply(), protocols::protein_interface_design::movers::PlaceStubMover::apply(), protocols::ncbb::NcbbDockDesignProtocol::apply(), protocols::ncbb::oop::OopDockDesignProtocol::apply(), protocols::surface_docking::SurfaceDockingProtocol::apply(), protocols::canonical_sampling::CanonicalSamplingMover::apply(), protocols::ligand_docking::LigandDockMain::apply(), protocols::ligand_docking::Transform::apply(), protocols::symmetric_docking::SymDockProtocol::apply(), protocols::cryst::TagPoseWithRefinementStatsMover::apply(), protocols::docking::DockingProtocol::apply(), protocols::features::ReportToDB::apply(), protocols::rosetta_scripts::ParsedProtocol::apply_filter(), protocols::abinitio::Broker_main(), protocols::anchored_design::AnchoredDesignMover::calculate_rmsd(), protocols::jd2::archive::ArchiveManager::cancel_batch(), protocols::canonical_sampling::canonical_sampling_main(), protocols::hotspot_hashing::movers::PlaceProbeMover::check_and_initialize(), protocols::jd2::BatchJobInputter::check_batch(), protocols::comparative_modeling::cm_main(), protocols::matdes::SymUnsatHbondFilter::compute(), protocols::matdes::ClashCheckFilter::compute(), protocols::matdes::GetRBDOFValues::compute(), protocols::jd2::current_batch(), protocols::jd2::current_output_filename(), protocols::jd2::current_output_name(), protocols::jd2::current_replica(), protocols::features::ReportToDB::ensure_structure_tags_are_ready(), protocols::hotspot_hashing::movers::PlaceProbeMover::execute_one_search(), protocols::features::FeaturesReporter::find_tag(), protocols::rosetta_scripts::ParsedProtocol::finish_protocol(), protocols::jd2::get_current_job(), protocols::jd2::get_current_jobs_starting_pose(), protocols::features::ScreeningFeatures::get_desriptor_data(), protocols::mpi::ArchiveMasterBase::get_new_decoys(), protocols::jd2::JD2ResourceManager::get_option(), protocols::jd2::Job::get_pose(), protocols::jd2::JD2ResourceManager::get_resource(), protocols::features::get_write_delete_pair(), protocols::jd2::JD2ResourceManager::has_option(), protocols::jd2::JD2ResourceManager::has_resource_with_description(), protocols::canonical_sampling::BiasEnergy::initialize_simulation(), jd2_signal_handler(), protocols::jd2::jd2_used(), protocols::canonical_sampling::jobname_dirhash(), ligand_dock_main(), protocols::features::JobDataFeatures::load_string_data(), protocols::features::JobDataFeatures::load_string_real_data(), protocols::features::JobDataFeatures::load_string_string_data(), protocols::loop_build::LoopBuild_main(), protocols::loophash::loophash_main(), protocols::features::TopCountOfEachInput::operator()(), protocols::canonical_sampling::mc_convergence_checks::Pool_ConvergenceCheck::operator()(), OPT_1GRP_KEY(), protocols::antibody::design::AntibodyDesignMover::output_ensemble(), protocols::jd2::output_intermediate_pose(), protocols::surface_docking::FullatomRelaxMover::output_solution_state(), protocols::simple_moves::SequenceProfileMover::parse_my_tag(), protocols::protein_interface_design::movers::SubroutineMover::parse_my_tag(), protocols::canonical_sampling::SilentTrajectoryRecorder::parse_my_tag(), protocols::canonical_sampling::MetropolisHastingsMover::prepare_simulation(), protocols::analysis::InterfaceAnalyzerMover::print_pymol_selection_of_hbond_unsat(), protocols::analysis::InterfaceAnalyzerMover::print_pymol_selection_of_interface_residues(), protocols::jd2::archive::ArchiveManager::queue_batch(), protocols::RBSegmentRelax_main(), protocols::relax::Relax_main(), protocols::simple_filters::ReportFilter::report(), protocols::analysis::InterfaceAnalyzerMover::report_data(), protocols::features::ScreeningFeatures::report_features(), protocols::features::JobDataFeatures::report_features(), protocols::rosetta_scripts::ParsedProtocol::report_filters_to_job(), protocols::rotamer_recovery::RRReporterSQLite::report_predicted_features(), protocols::rotamer_recovery::RRReporterSQLite::report_rotamer_recovery_full(), protocols::simple_filters::Operator::report_sm(), protocols::simple_filters::ShapeComplementarityFilter::report_sm(), protocols::docking::DockingPrepackProtocol::score_and_output(), protocols::analysis::InterfaceAnalyzerMover::set_pose_info(), protocols::canonical_sampling::mc_convergence_checks::setup_convergence_checks_from_cmdline(), protocols::matdes::SymDofMoverSampler::step(), protocols::symmetric_docking::SymDock_main(), protocols::features::TopPercentOfAllInputs::TopPercentOfAllInputs(), protocols::canonical_sampling::MetricRecorder::update_after_boltzmann(), protocols::features::ProteinSilentReport::write_full_report(), protocols::matdes::SymUnsatHbondFilter::write_pymol_string_to_pdb(), protocols::matdes::ClashCheckFilter::write_pymol_string_to_pdb(), protocols::simple_filters::SaveResfileToDiskFilter::write_resfile(), protocols::jd2::write_score_tracer(), protocols::simple_filters::MutationsFilter::write_to_pdb(), protocols::protein_interface_design::filters::SequenceRecoveryFilter::write_to_pdb(), protocols::simple_filters::TaskAwareScoreTypeFilter::write_to_pdb(), protocols::simple_filters::RotamerBoltzmannWeight::write_to_pdb(), protocols::simple_filters::TaskAwareAlaScan::write_to_pdb(), protocols::matdes::SymUnsatHbondFilter::write_to_pdb(), protocols::matdes::ClashCheckFilter::write_to_pdb(), protocols::matdes::OligomericAverageDegreeFilter::write_to_pdb(), and protocols::canonical_sampling::BiasEnergy::~BiasEnergy().

Jobs const & protocols::jd2::JobDistributor::get_jobs ( ) const
protected
virtual core::Size protocols::jd2::JobDistributor::get_new_job_id ( )
protectedpure virtual
void protocols::jd2::JobDistributor::go ( protocols::moves::MoverOP  mover)
virtual
void protocols::jd2::JobDistributor::go ( protocols::moves::MoverOP  mover,
JobOutputterOP  jo 
)

invokes go, after setting JobOutputter

References go(), and job_outputter_.

void protocols::jd2::JobDistributor::go_main ( protocols::moves::MoverOP  mover)
protected

Non-virtual get-job, run it, & output loop. This function is pretty generic and your subclass may be able to use it. It is NOT virtual - this implementation can be shared by (at least) the simple FileSystemJobDistributor, the MPIWorkPoolJobDistributor, and the MPIWorkPartitionJobDistributor. Do not feel that you need to use it as-is in your class - but DO plan on implementing all its functionality!

References protocols::viewer::add_conformation_viewer(), protocols::jd2::Job::add_strings(), protocols::moves::AddPyMolObserver(), protocols::moves::AddPyMolObserver_to_conformation(), protocols::moves::AddPyMolObserver_to_energies(), protocols::moves::Mover::apply(), batches_, begin_critical_section(), basic::datacache::BasicDataCache::clear(), protocols::moves::Mover::clear_info(), core::pose::Pose::conformation(), current_batch_id(), current_job_, current_job_finished(), current_job_id_, core::pose::Pose::data(), end_critical_section(), basic::Error(), protocols::moves::FAIL_BAD_INPUT, protocols::moves::FAIL_DO_NOT_RETRY, protocols::moves::FAIL_RETRY, protocols::moves::Mover::fresh_instance(), protocols::moves::Mover::get_additional_output(), protocols::moves::Mover::get_last_move_status(), protocols::moves::Mover::info(), protocols::jd2::Job::input_tag(), basic::JD2, basic::JD2_INIT_MOVER, basic::JD2_OUTPUT, job_failed(), job_inputter_, job_outputter_, job_succeeded(), job_succeeded_additional_output(), jobs_, last_completed_job_, mark_current_job_id_for_repetition(), protocols::moves::MS_SUCCESS, note_all_jobs_finished(), ntrials, obtain_new_job(), basic::options::option, option, parser_, basic::prof_show(), PROF_START, PROF_STOP, protocols::moves::Mover::reinitialize_for_each_job(), protocols::moves::Mover::reinitialize_for_new_input(), remove_bad_inputs_from_job_list(), protocols::moves::Mover::reset_status(), s, protocols::moves::Mover::set_current_tag(), utility::options::OptionCollection::show_unused_options(), basic::options::OptionKeys::out::std_IO_exit_error_code, tag, protocols::jd2::tr, and user.

Referenced by protocols::unfolded_state_energy_calculator::UnfoldedStateEnergyCalculatorJobDistributor::go(), protocols::jd2::MPIFileBufJobDistributor::go(), protocols::jd2::MPIWorkPartitionJobDistributor::go(), go(), protocols::jd2::archive::MPIArchiveJobDistributor::go(), and protocols::jd2::MPIWorkPoolJobDistributor::slave_go().

virtual void protocols::jd2::JobDistributor::handle_interrupt ( )
protectedpure virtual

This function got called when job is not yet finished and got termitated abnormaly (ctrl-c, kill etc). when implimenting it in subclasses make sure to delete all in-progress-data that your job spawn.

Implemented in protocols::jd2::archive::MPIArchiveJobDistributor, protocols::jd2::MPIWorkPoolJobDistributor, protocols::jd2::FileSystemJobDistributor, protocols::jd2::MPIWorkPartitionJobDistributor, protocols::jd2::MPIFileBufJobDistributor, protocols::jd2::MPIMultiCommJobDistributor, and protocols::jd2::ShuffleFileSystemJobDistributor.

Referenced by jd2_signal_handler().

void protocols::jd2::JobDistributor::init_jd ( )
private
void protocols::jd2::JobDistributor::jd2_signal_handler ( int  signal_)
staticprotected

Default callback function for signal handling.

Default callback function for signal handling

References get_instance(), handle_interrupt(), and job_outputter_.

void protocols::jd2::JobDistributor::job_failed ( core::pose::Pose ,
bool   
)
protectedvirtual

This function is called when we give up on the job; it has been virtualized so BOINC and MPI can delay/protect output base implementation is just a call to the job outputter.

no-op implementation in the base class

Reimplemented in protocols::jd2::MPIFileBufJobDistributor, protocols::jd2::FileSystemJobDistributor, protocols::jd2::MPIMultiCommJobDistributor, and protocols::jd2::BOINCJobDistributor.

Referenced by go_main(), and protocols::jd2::FileSystemJobDistributor::job_failed().

JobInputterOP protocols::jd2::JobDistributor::job_inputter ( ) const
JobInputterInputSource::Enum protocols::jd2::JobDistributor::job_inputter_input_source ( ) const

The input source for the current JobInputter.

References job_inputter_.

JobOutputterOP protocols::jd2::JobDistributor::job_outputter ( ) const

Movers (or derived classes) may ask for the JobOutputter.

References job_outputter_.

Referenced by protocols::surface_docking::SurfaceDockingProtocol::apply(), protocols::canonical_sampling::CanonicalSamplingMover::apply(), protocols::jd2::current_output_filename(), protocols::jd2::current_output_name(), current_output_name(), protocols::jd2::get_current_jobs_starting_pose(), protocols::mpi::ArchiveMasterBase::get_new_decoys(), protocols::jd2::ShuffleFileSystemJobDistributor::get_new_job_id(), protocols::jd2::MPIWorkPartitionJobDistributor::get_new_job_id(), protocols::jd2::BOINCJobDistributor::go(), protocols::jd2::jd2_used(), protocols::jd2::MPIFileBufJobDistributor::master_get_new_job_id(), protocols::jd2::MPIWorkPoolJobDistributor::master_get_new_job_id(), protocols::jd2::MPIFileBufJobDistributor::master_remove_bad_inputs_from_job_list(), protocols::jd2::MPIWorkPoolJobDistributor::master_remove_bad_inputs_from_job_list(), OPT_1GRP_KEY(), protocols::antibody::design::AntibodyDesignMover::output_ensemble(), protocols::jd2::output_intermediate_pose(), protocols::surface_docking::FullatomRelaxMover::output_solution_state(), protocols::canonical_sampling::SilentTrajectoryRecorder::parse_my_tag(), protocols::jd2::MPIWorkPartitionJobDistributor::remove_bad_inputs_from_job_list(), protocols::analysis::InterfaceAnalyzerMover::set_pose_info(), protocols::canonical_sampling::mc_convergence_checks::setup_convergence_checks_from_cmdline(), protocols::jd2::MPIFileBufJobDistributor::slave_job_succeeded(), protocols::jd2::MPIWorkPoolJobDistributor::slave_job_succeeded(), and protocols::jd2::write_score_tracer().

void protocols::jd2::JobDistributor::job_succeeded ( core::pose::Pose pose,
core::Real  run_time,
std::string const &  tag 
)
protectedvirtual

This function is called upon a successful job completion; it has been virtualized so BOINC and MPI can delay/protect output base implementation is just a call to the job outputter.

Reimplemented in protocols::jd2::MPIWorkPoolJobDistributor, protocols::jd2::MPIFileBufJobDistributor, protocols::jd2::FileSystemJobDistributor, protocols::jd2::MPIMultiCommJobDistributor, and protocols::jd2::BOINCJobDistributor.

References current_job_, current_job_id_, job_outputter_, and mark_job_as_completed().

Referenced by go_main(), and protocols::jd2::FileSystemJobDistributor::job_succeeded().

void protocols::jd2::JobDistributor::job_succeeded_additional_output ( core::pose::Pose pose,
std::string const &  tag 
)
protectedvirtual

This function is called upon a successful job completion if there are additional poses generated by the mover base implementation is just a call to the job outputter.

References current_job_, and job_outputter_.

Referenced by go_main().

void protocols::jd2::JobDistributor::load_new_batch ( )
protectedvirtual
virtual void protocols::jd2::JobDistributor::mark_current_job_id_for_repetition ( )
protectedpure virtual

this function is called whenever a job "soft-fails" and needs to be retried. Generally it should ensure that the subsequent call to obtain_new_job returns this job over again.

Implemented in protocols::jd2::MPIWorkPoolJobDistributor, protocols::jd2::MPIFileBufJobDistributor, protocols::jd2::MPIWorkPartitionJobDistributor, protocols::jd2::FileSystemJobDistributor, protocols::jd2::ShuffleFileSystemJobDistributor, and protocols::jd2::BOINCJobDistributor.

Referenced by go_main().

void protocols::jd2::JobDistributor::mark_job_as_bad ( core::Size  job_id)
protected
void protocols::jd2::JobDistributor::mark_job_as_completed ( core::Size  job_id,
core::Real  run_time 
)
protected

Jobs is the container of Job objects need non-const to mark Jobs as completed on Master in MPI-JobDistributor.

References job_outputter_, jobs_, and protocols::jd2::tr.

Referenced by job_succeeded(), and protocols::jd2::MPIFileBufJobDistributor::mark_job_as_completed().

void protocols::jd2::JobDistributor::mpi_finalize ( bool  finalize)
virtual

should the go() function call MPI_finalize()? It probably should, this is true by default.

Reimplemented in protocols::jd2::MPIWorkPoolJobDistributor.

bool protocols::jd2::JobDistributor::next_batch ( )
protectedvirtual
void protocols::jd2::JobDistributor::note_all_jobs_finished ( )
protectedvirtual

Derived classes are allowed to perform some kind of action when the job distributor runs out of jobs to execute. Called inside go_main. Default implementation is a no-op.

Referenced by go_main().

core::Size protocols::jd2::JobDistributor::nr_batches ( ) const
inlineprotected

how many batches are in our list ... this can change dynamically

References batches_.

Referenced by protocols::jd2::archive::MPIArchiveJobDistributor::notify_archive(), and protocols::jd2::archive::MPIArchiveJobDistributor::sync_batches().

bool protocols::jd2::JobDistributor::obtain_new_job ( bool  re_consider_current_job = false)
protected
ParserOP protocols::jd2::JobDistributor::parser ( ) const
protected

Parser access.

References parser_.

void protocols::jd2::JobDistributor::populate_batch_list_from_cmd ( )
private

read -run:batches

read -run:batches and put it into batches_ vector.

References basic::options::OptionKeys::run::batches, batches_, basic::options::option, and user.

Referenced by init_jd().

void protocols::jd2::JobDistributor::remove_bad_inputs_from_job_list ( )
protectedvirtual

this function is called inside go_main if a mover returns FAIL_BAD_INPUT. Its purpose is to remove other jobs with the same input (which will still be bad) from the available list of jobs. The default implementation is a no-op and not all distributors are expected/able to implement this functionality, only those that can guaruntee no other jobs of that input are currently running.

Reimplemented in protocols::jd2::MPIWorkPoolJobDistributor, protocols::jd2::MPIFileBufJobDistributor, protocols::jd2::MPIWorkPartitionJobDistributor, and protocols::jd2::FileSystemJobDistributor.

Referenced by go_main().

void protocols::jd2::JobDistributor::remove_system_signal_handler ( )
staticprotected

Set signal handler back to default state.

Set signal handler back to default state.

void protocols::jd2::JobDistributor::restart ( )
virtual

restart job-distribution from beginning – useful if you need a second pass over decoys...

Reimplemented in protocols::jd2::FileSystemJobDistributor.

References current_batch_id_, current_job_, current_job_id_, init_jd(), protocols::jd2::JD2_BOGUS_JOB, jobs_, and last_completed_job_.

Referenced by protocols::jd2::FileSystemJobDistributor::restart().

void protocols::jd2::JobDistributor::set_batch_id ( core::Size  setting)
protected
void protocols::jd2::JobDistributor::set_job_outputter ( const JobOutputterOP new_job_outputter)

Movers (or derived classes) may ask for the JobOutputter.

References job_outputter_.

void protocols::jd2::JobDistributor::setup_system_signal_handler ( void(*)(int signal_fn = jd2_signal_handler)
staticprotected

Setting up callback function that will be call when our process is about to terminate.

This will allow us to exit propely (clean up in_progress_files/tmp files if any).

Setting up callback function that will be call when our process is about to terminate.

core::Size protocols::jd2::JobDistributor::total_nr_jobs ( ) const
inline

Friends And Related Function Documentation

friend class JobDistributorFactory
friend

Member Data Documentation

utility::vector1< std::string > protocols::jd2::JobDistributor::batches_
private
core::Size protocols::jd2::JobDistributor::current_batch_id_
private
JobOP protocols::jd2::JobDistributor::current_job_
private

pointer to current job. Information is somewhat duplicated with current_job_id_.

Referenced by clear_current_job_output(), current_job(), go_main(), job_succeeded(), job_succeeded_additional_output(), load_new_batch(), obtain_new_job(), and restart().

core::Size protocols::jd2::JobDistributor::current_job_id_
private

access into jobs_ vector indicating current job. Contains more information than current_job_ in that it can be incremented...

Referenced by clear_current_job_output(), current_job_id(), go_main(), job_succeeded(), load_new_batch(), obtain_new_job(), and restart().

JobDistributor * protocols::jd2::JobDistributor::instance_ = 0
staticprivate

Referenced by get_instance(), and init_jd().

JobInputterOP protocols::jd2::JobDistributor::job_inputter_
private
JobOutputterOP protocols::jd2::JobDistributor::job_outputter_
private
Jobs protocols::jd2::JobDistributor::jobs_
private
core::Size protocols::jd2::JobDistributor::last_completed_job_
private

access into jobs_ bector indicating the previous job. Used with the -jd2:delete_old_poses option for deleting unnecessary poses

Referenced by go_main(), and restart().

ParserOP protocols::jd2::JobDistributor::parser_
private

The documentation for this class was generated from the following files: