Rosetta  2016.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
protocols::jd3::JobQueen Class Referenceabstract

The JobQueen class (think of a queen bee) has quite a few responsibilities: More...

#include <JobQueen.hh>

Inheritance diagram for protocols::jd3::JobQueen:
Inheritance graph
[legend]

Public Member Functions

 JobQueen ()
 
virtual ~JobQueen ()
 
virtual JobOP mature_larval_job (LarvalJobCOP job)=0
 Mature the input larval job into a full fledged job that will be run within this process (i.e. on this CPU), and so can hold pointers to data that may persist inside the ResourceManager or may even be used by another process running in this thread. To pull that off, the Job object must share no non-bitwise-const data with any other Job object. That means if the Job were to contain a Pose and a Mover (as the StandardJob does), then so each Mover should be freshly constructed, and if the Pose had been copied from an existing Pose, must use the Pose's "deep_copy" method (since Pose's sometimes share non-constant data between them, e.g. the AtomTree observer system, and the sigh constraints ). More...
 
virtual bool has_job_completed (LarvalJobCOP job)=0
 
virtual void mark_job_as_having_begun (LarvalJobCOP job)=0
 Some (but not all) JobDistributors mark which jobs are in the process of being run by asking the JobQueen to create a temporary file marking that fact on the file system. More...
 
virtual void note_job_completed (LarvalJobCOP job, JobStatus status)=0
 The JobDistributor will call this function to inform the JobQueen that a job has "completed" – in the sense that it will not be run in the future. It does not guarantee that the job was run on this CPU or that it successfully completed anywhere. The JobStatus indicates whether the job completed or whether it failed. More...
 
virtual void completed_job_result (LarvalJobCOP job, JobResultOP result)=0
 The JobDistributor guarnatees that exactly one JobQueen will see every JobResult generated within a Job batch. This guarantee allows the JobQueen to aggregate data across all of the Jobs so that Rosetta is able to compute data from structures instead of forcing that computation into accessory scripts. More...
 
virtual LarvalJobs determine_job_list ()=0
 This function determines what jobs exist. This function neither knows nor cares what jobs are already complete on disk/memory - it just figures out what ones should exist given the input. More...
 
virtual bool more_jobs_remain ()=0
 The JobQueen may indicate to the JobDistributor that multiple rounds of structure generation are desired by returning "true" to this function call (this function can constitutively return "false" and the first round will still always be executed). After returning "true", the JobDistributor will ask the JobQueen for another list of jobs through its determine_job_list method. After the first round, only the JobQueens which were given the JobResult data (one JobQueen per Job batch) will be asked for a second job list. More...
 
virtual std::string job_definition_xsd () const =0
 All JobQueens should, for the sake of documentation, describe their job input XML format in the form of an XSD (XML Schema Definition). If the JobDistributor is awakened with the flag "jd3::output_xsd <output file>" on the command line, then if this function returns a non-empty string, the JobDistributor will write out the XSD to the command line. More...
 

Detailed Description

The JobQueen class (think of a queen bee) has quite a few responsibilities:

The JobQueen is responsible for creating all of the LarvalJobs, grouped into "batches" which are dispatched by the JobDistributor; the queen then matures the larval jobs into the mature form (a Job, e.g. a Mover/Pose pair) and gives them up to the JobDistributor to actually execute the work. The JobDistributor then actually calls the Job's "run" method, which produces a JobResult. It then hands this JobResult (e.g. a Pose or several Poses) back to the JobQueen for output. In fact, in MPI contexts, the JobDistributor guarantees that it will hand all of the completed JobResults for a single batch to a single JobQueen, so that she can compute aggregate statistics (e.g. averaging energies) or can look at the results from that round of jobs and decide which to carry forward into the next round of execution.

Constructor & Destructor Documentation

protocols::jd3::JobQueen::JobQueen ( )
protocols::jd3::JobQueen::~JobQueen ( )
virtual

Member Function Documentation

virtual void protocols::jd3::JobQueen::completed_job_result ( LarvalJobCOP  job,
JobResultOP  result 
)
pure virtual

The JobDistributor guarnatees that exactly one JobQueen will see every JobResult generated within a Job batch. This guarantee allows the JobQueen to aggregate data across all of the Jobs so that Rosetta is able to compute data from structures instead of forcing that computation into accessory scripts.

virtual LarvalJobs protocols::jd3::JobQueen::determine_job_list ( )
pure virtual

This function determines what jobs exist. This function neither knows nor cares what jobs are already complete on disk/memory - it just figures out what ones should exist given the input.

virtual bool protocols::jd3::JobQueen::has_job_completed ( LarvalJobCOP  job)
pure virtual

The JobQueen must be able to determine if a particular job has already completed (or alternatively, has already been started by another process), and if so, the JobDistributor will not re-run the job. The JobQueen returns "true" if the job has completed (or started elsewhere), and "false" otherwise.

virtual std::string protocols::jd3::JobQueen::job_definition_xsd ( ) const
pure virtual

All JobQueens should, for the sake of documentation, describe their job input XML format in the form of an XSD (XML Schema Definition). If the JobDistributor is awakened with the flag "jd3::output_xsd <output file>" on the command line, then if this function returns a non-empty string, the JobDistributor will write out the XSD to the command line.

Implemented in protocols::jd3::StandardJobQueen.

virtual void protocols::jd3::JobQueen::mark_job_as_having_begun ( LarvalJobCOP  job)
pure virtual

Some (but not all) JobDistributors mark which jobs are in the process of being run by asking the JobQueen to create a temporary file marking that fact on the file system.

virtual JobOP protocols::jd3::JobQueen::mature_larval_job ( LarvalJobCOP  job)
pure virtual

Mature the input larval job into a full fledged job that will be run within this process (i.e. on this CPU), and so can hold pointers to data that may persist inside the ResourceManager or may even be used by another process running in this thread. To pull that off, the Job object must share no non-bitwise-const data with any other Job object. That means if the Job were to contain a Pose and a Mover (as the StandardJob does), then so each Mover should be freshly constructed, and if the Pose had been copied from an existing Pose, must use the Pose's "deep_copy" method (since Pose's sometimes share non-constant data between them, e.g. the AtomTree observer system, and the sigh constraints ).

virtual bool protocols::jd3::JobQueen::more_jobs_remain ( )
pure virtual

The JobQueen may indicate to the JobDistributor that multiple rounds of structure generation are desired by returning "true" to this function call (this function can constitutively return "false" and the first round will still always be executed). After returning "true", the JobDistributor will ask the JobQueen for another list of jobs through its determine_job_list method. After the first round, only the JobQueens which were given the JobResult data (one JobQueen per Job batch) will be asked for a second job list.

virtual void protocols::jd3::JobQueen::note_job_completed ( LarvalJobCOP  job,
JobStatus  status 
)
pure virtual

The JobDistributor will call this function to inform the JobQueen that a job has "completed" – in the sense that it will not be run in the future. It does not guarantee that the job was run on this CPU or that it successfully completed anywhere. The JobStatus indicates whether the job completed or whether it failed.


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