Rosetta 3.4
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
protocols::jobdist::BaseJobDistributor Class Reference

Coordinates processing of jobs across multiple Rosetta processes. More...

#include <JobDistributors.hh>

Inheritance diagram for protocols::jobdist::BaseJobDistributor:
Inheritance graph
[legend]
Collaboration diagram for protocols::jobdist::BaseJobDistributor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BaseJobDistributor (JobVector jobs)
 BaseJobDistributor (BaseJobDistributor const &)
virtual ~BaseJobDistributor ()
bool next_job (BasicJobOP &job, int &struct_n)
 If true, sets the next Job and nstruct number to be processed. Deliberately not virtual: should not be overriden. Uses the "find_available_job" method, which is common to both MPI and standard protocols, but used in slightly different manners.
virtual void startup ()
 Must be called by client before first call to next_job(). If overriden by a subclass, it MUST call the superclass implementation.
virtual void shutdown ()
 Must be called by client after last call to next_job(). If overriden by a subclass, it MUST call the superclass implementation.
virtual void begin_critical_section ()
 Signal that if at all possible, we would like to not be killed while in the critical section. If overriden by a subclass, it MUST call the superclass implementation.
virtual void end_critical_section ()
 Signal that if at all possible, we would like to not be killed while in the critical section. If overriden by a subclass, it MUST call the superclass implementation.
virtual void dump_pose_and_map (std::string const &, core::pose::Pose &)
 Virtual function for dump_pose that is needed for main_plain_mover.
virtual void temp_file (std::string const &)
 Virtual function for temp_file main_plain_mover.
virtual void score_map (std::map< std::string, core::Real > &)
 Virtual function for score_map that is needed for main_plain_mover sets the score_map.
void disable_ignorefinished ()
void enable_ignorefinished ()
void disable_output ()
void enable_output ()
void disable_inprogress ()
void enable_inprogress ()
bool ignorefinished () const
bool nooutput () const
bool inprogress () const
void set_proc_id (core::Size proc_id, core::Size nproc)
virtual std::string get_current_output_tag ()
 get output_tag for current job's current nstruct
virtual std::string get_output_filename ()

Protected Types

typedef utility::vector1
< BasicJobOP
JobVector

Protected Member Functions

virtual bool is_finished (BasicJobOP const &job, int struct_n)=0
 Is the given nstruct number of the given input job already finished by the local process? To be implemented by subclasses.
virtual void checkpoint_read ()
 Restore state from checkpoint file, if it exists.
virtual void checkpoint_write ()
 Save state to checkpoint file, overwriting previous.
virtual void checkpoint_clear ()
 Remove checkpoint file (at end of batch)
int current_nstruct ()
 accessor for current_nstruct_
BasicJobOP current_job ()
 accessor for current_job owning pointer
int get_next_random_range (int low, int high)

Protected Attributes

bool ignorefinished_
 ignore already done jobs - redo everything !
bool nooutput_
 do not write files - useful such things as statistics or rescoring !
bool inprogress_
 write .in_progress files for multiple processor runs
int start_time_
 starttime
int random_counter_
 RandomStore - needed for.
utility::vector1< double > random_store_

Detailed Description

Coordinates processing of jobs across multiple Rosetta processes.

Job distributors need to be customized in three different ways:

Cluster architecture is a GLOBAL COMPILE-TIME decision: it's handled by scons, it's the same for all executables built at that time, and it should be implemented using ifdef's in this base class, by modifying the next_job() method directly.

Test for job completion is a PER-EXECUTABLE decision: it's handled by subclassing BaseJobDistributor and implementing the is_finished() method. BaseJobDistributor will consult is_finished() in whatever way is appropriate for the current cluster architecture to ensure that jobs are not repeated.

Type of input is handled by templating the job distributor on a Job object. BasicJob has been provided already, but you can subclass it if you need to carry around additional information about the inputs.


Member Typedef Documentation


Constructor & Destructor Documentation

protocols::jobdist::BaseJobDistributor::BaseJobDistributor ( JobVector  jobs)

References start_time_.

protocols::jobdist::BaseJobDistributor::BaseJobDistributor ( BaseJobDistributor const &  src)
protocols::jobdist::BaseJobDistributor::~BaseJobDistributor ( ) [virtual]

Member Function Documentation

void protocols::jobdist::BaseJobDistributor::begin_critical_section ( ) [virtual]

Signal that if at all possible, we would like to not be killed while in the critical section. If overriden by a subclass, it MUST call the superclass implementation.

If overriden by a subclass, it MUST call the superclass implementation.

Referenced by protocols::jobdist::PlainSilentFileJobDistributor::dump_pose(), protocols::jobdist::AtomTreeDiffJobDistributor::dump_pose(), protocols::jobdist::PlainRawJobDistributor::dump_pose_and_map(), protocols::jobdist::PlainPdbJobDistributor::dump_pose_and_map(), and protocols::jobdist::PlainSilentFileJobDistributor::dump_silent().

void protocols::jobdist::BaseJobDistributor::checkpoint_clear ( ) [protected, virtual]

Remove checkpoint file (at end of batch)

References protocols::swa::rna::file_exists().

void protocols::jobdist::BaseJobDistributor::checkpoint_read ( ) [protected, virtual]

Restore state from checkpoint file, if it exists.

References protocols::swa::rna::file_exists().

void protocols::jobdist::BaseJobDistributor::checkpoint_write ( ) [protected, virtual]

Save state to checkpoint file, overwriting previous.

Calls to this function are only a suggestion. If checkpointing is expensive, this function must track time between calls to avoid excessive disk activity, etc.

References protocols::checkpoint::Timer::reset().

Referenced by next_job().

BasicJobOP protocols::jobdist::BaseJobDistributor::current_job ( ) [protected]

accessor for current_job owning pointer

Referenced by protocols::jobdist::PlainSilentFileJobDistributor::get_current_output_tag().

int protocols::jobdist::BaseJobDistributor::current_nstruct ( ) [inline, protected]
void protocols::jobdist::BaseJobDistributor::disable_ignorefinished ( ) [inline]

References ignorefinished_.

void protocols::jobdist::BaseJobDistributor::disable_inprogress ( ) [inline]

References inprogress_.

void protocols::jobdist::BaseJobDistributor::disable_output ( ) [inline]

References nooutput_.

void protocols::jobdist::BaseJobDistributor::dump_pose_and_map ( std::string const &  ,
core::pose::Pose  
) [virtual]

Virtual function for dump_pose that is needed for main_plain_mover.

Needed if a score_map is to be output by the derived class

Reimplemented in protocols::jobdist::PlainPdbJobDistributor, and protocols::jobdist::PlainRawJobDistributor.

void protocols::jobdist::BaseJobDistributor::enable_ignorefinished ( ) [inline]

References ignorefinished_.

void protocols::jobdist::BaseJobDistributor::enable_inprogress ( ) [inline]
void protocols::jobdist::BaseJobDistributor::enable_output ( ) [inline]

References nooutput_.

void protocols::jobdist::BaseJobDistributor::end_critical_section ( ) [virtual]

Signal that if at all possible, we would like to not be killed while in the critical section. If overriden by a subclass, it MUST call the superclass implementation.

If overriden by a subclass, it MUST call the superclass implementation.

Referenced by protocols::jobdist::PlainSilentFileJobDistributor::dump_pose(), protocols::jobdist::AtomTreeDiffJobDistributor::dump_pose(), protocols::jobdist::PlainRawJobDistributor::dump_pose_and_map(), protocols::jobdist::PlainPdbJobDistributor::dump_pose_and_map(), and protocols::jobdist::PlainSilentFileJobDistributor::dump_silent().

std::string protocols::jobdist::BaseJobDistributor::get_current_output_tag ( ) [virtual]

get output_tag for current job's current nstruct

by default return current_job's current_nstruct' output_tag. Overridden in derived PlainSilentFileJobDistributor to return names with "S_" at the beginning

Reimplemented in protocols::jobdist::PlainSilentFileJobDistributor.

References protocols::nonlocal::current_job().

int protocols::jobdist::BaseJobDistributor::get_next_random_range ( int  low,
int  high 
) [protected]
std::string protocols::jobdist::BaseJobDistributor::get_output_filename ( ) [virtual]
bool protocols::jobdist::BaseJobDistributor::ignorefinished ( ) const [inline]
bool protocols::jobdist::BaseJobDistributor::inprogress ( ) const [inline]

References inprogress_.

virtual bool protocols::jobdist::BaseJobDistributor::is_finished ( BasicJobOP const &  job,
int  struct_n 
) [protected, pure virtual]

Is the given nstruct number of the given input job already finished by the local process? To be implemented by subclasses.

Implemented in protocols::jobdist::AtomTreeDiffJobDistributor, protocols::jobdist::PlainPdbJobDistributor, protocols::jobdist::PlainRawJobDistributor, and protocols::jobdist::PlainSilentFileJobDistributor.

bool protocols::jobdist::BaseJobDistributor::next_job ( BasicJobOP job,
int struct_n 
)

If true, sets the next Job and nstruct number to be processed. Deliberately not virtual: should not be overriden. Uses the "find_available_job" method, which is common to both MPI and standard protocols, but used in slightly different manners.

Deliberately not virtual: should not be overriden. This is where to insert ifdefs and code for different cluster architectures!

References checkpoint_write(), get_output_filename(), protocols::wum::mpi_rank(), and start_time_.

Referenced by protocols::jobdist::main_atom_tree_diff_mover().

bool protocols::jobdist::BaseJobDistributor::nooutput ( ) const [inline]
void protocols::jobdist::BaseJobDistributor::score_map ( std::map< std::string, core::Real > &  ) [virtual]

Virtual function for score_map that is needed for main_plain_mover sets the score_map.

Needed if a score_map is to be output by the derived class

Reimplemented in protocols::jobdist::PlainPdbJobDistributor, and protocols::jobdist::PlainRawJobDistributor.

void protocols::jobdist::BaseJobDistributor::set_proc_id ( core::Size  proc_id,
core::Size  nproc 
) [inline]
void protocols::jobdist::BaseJobDistributor::shutdown ( ) [virtual]

Must be called by client after last call to next_job(). If overriden by a subclass, it MUST call the superclass implementation.

If overriden by a subclass, it MUST call the superclass implementation.

Reimplemented in protocols::jobdist::AtomTreeDiffJobDistributor, and protocols::jobdist::PlainSilentFileJobDistributor.

References protocols::boinc::Boinc::worker_finish_summary(), and protocols::boinc::Boinc::worker_shutdown().

void protocols::jobdist::BaseJobDistributor::startup ( ) [virtual]

Must be called by client before first call to next_job(). If overriden by a subclass, it MUST call the superclass implementation.

If overriden by a subclass, it MUST call the superclass implementation.

Reimplemented in protocols::jobdist::PlainPdbJobDistributor, and protocols::jobdist::PlainSilentFileJobDistributor.

References protocols::boinc::Boinc::worker_startup().

Referenced by protocols::jobdist::main_atom_tree_diff_mover().

void protocols::jobdist::BaseJobDistributor::temp_file ( std::string const &  ) [virtual]

Virtual function for temp_file main_plain_mover.

Needed to output .in_progress files for multiple processor jobs

Reimplemented in protocols::jobdist::PlainPdbJobDistributor.


Member Data Documentation

ignore already done jobs - redo everything !

Referenced by disable_ignorefinished(), enable_ignorefinished(), and ignorefinished().

write .in_progress files for multiple processor runs

Referenced by disable_inprogress(), enable_inprogress(), and inprogress().

do not write files - useful such things as statistics or rescoring !

Referenced by disable_output(), enable_output(), and nooutput().

RandomStore - needed for.

starttime

Referenced by BaseJobDistributor(), and next_job().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines