Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
protocols::jd3::dag_node_managers::NodeManager Class Reference

#include <NodeManager.hh>

Inheritance diagram for protocols::jd3::dag_node_managers::NodeManager:
Inheritance graph
[legend]

Public Member Functions

 NodeManager (core::Size job_offset, core::Size num_jobs_total, core::Size num_partitions, utility::vector1< core::Size > num_results_to_keep_for_part, utility::vector1< core::Size > result_threshold_per_part=utility::vector1< core::Size >(0), bool return_results_depth_first=false)
 
 ~NodeManager () override
 
void clear ()
 
void note_job_completed (GlobalJobID global_job_id, core::Size nresults)
 please call this from your job queen's note_job_completed() function More...
 
virtual void register_result (GlobalJobID global_job_id, core::Size result_id, core::Real score, core::Size partition=1, uint64_t token=0)
 insert this result into the sorted container. Please specify which partition you want to put it in if you are not using the SimpleNodeManager More...
 
core::Size get_next_local_jobid ()
 This class can be used to determine which job should be submitted next. A value of 0 means that we are done submitting for this dag node. More...
 
void append_job_results_that_should_be_discarded (std::list< jd3::JobResultID > &list)
 This does not erase the list! We just add job result ids that have been eliminated from the results to keep. More...
 
jd3::JobResultID get_nth_job_result_id (core::Size n)
 this has better future-proofing over results_to_keep()[ int ]. Returns {0,0} if no result More...
 
bool done_submitting () const
 
bool jobs_are_still_running ()
 
bool all_results_are_in () const
 
bool all_waste_is_discarded () const
 
utility::vector1< ResultElementsresults_to_keep ()
 old way to access the results. get_nth_job_result_id() is prefered. More...
 
core::Size num_jobs () const
 
void set_num_jobs (core::Size new_num_jobs)
 
core::Size num_jobs_submitted () const
 
core::Size num_jobs_completed () const
 
core::Size num_results_to_keep () const
 
core::Size job_offset () const
 
core::Size num_results_total () const
 
void stop_early ()
 
bool stopped_early () const
 
void set_max_num_results_with_same_token_per_partition (core::Size setting)
 Perhaps you have a diversity requirement and do not want too many results with the same token (token can represent anything you want - as long as it can be stored as a core::Size), this setting is for you. More...
 
void set_return_results_depth_first (bool setting)
 please refer to protocols/jd3/dag_node_managers/NodeManagerStorageMatrix.hh for more details about this option More...
 

Protected Member Functions

core::Size num_results_received ()
 
bool ready_to_finish_early () const
 

Private Attributes

core::Size job_offset_
 
core::Size num_jobs_total_
 
core::Size num_results_to_keep_
 
utility::vector1< core::Sizenum_results_to_keep_for_part_
 
core::Size num_results_total_
 
core::Size num_results_received_
 
utility::vector1< core::Sizenum_results_received_for_part_
 
bool result_threshold_
 
utility::vector1< core::Sizeresult_threshold_per_part_
 
bool stopped_early_
 
core::Size num_jobs_submitted_
 
core::Size num_jobs_completed_
 
core::Size num_partitions_
 
NodeManagerStorageMatrix results_to_keep_
 
core::Size max_num_results_with_same_token_per_partition_
 
std::list< jd3::JobResultIDjob_results_that_should_be_discarded_
 

Constructor & Destructor Documentation

protocols::jd3::dag_node_managers::NodeManager::NodeManager ( core::Size  job_offset,
core::Size  num_jobs_total,
core::Size  num_partitions,
utility::vector1< core::Size num_results_to_keep_for_part,
utility::vector1< core::Size result_threshold_per_part = utility::vector1< core::Size > ( 0 ),
bool  return_results_depth_first = false 
)
Parameters
job_offsetThe node manager can only represent nodes where the jobids form a continuous range. That range should start at job_offset+1.
num_jobs_totalThe range mentioned previous should end with job_offset+num_jobs_total (inclusive)
num_partitionsThe total number of partitions you want
num_results_to_keep_for_partmaximum number of results you want to keep per partition. num_results_to_keep_for_part.size() should equal num_partitions
result_threshold_per_partIf you want to have a result threshold, define here the threshold for each partition. result_threshold_per_part.size() should equal num_partitions
return_results_depth_firstplease refer to protocols/jd3/dag_node_managers/NodeManagerStorageMatrix.hh for more details about this option

References num_results_to_keep_, num_results_to_keep_for_part_, and protocols::jd3::TR().

protocols::jd3::dag_node_managers::NodeManager::~NodeManager ( )
override

Member Function Documentation

bool protocols::jd3::dag_node_managers::NodeManager::all_results_are_in ( ) const
inline
bool protocols::jd3::dag_node_managers::NodeManager::all_waste_is_discarded ( ) const
inline
void protocols::jd3::dag_node_managers::NodeManager::append_job_results_that_should_be_discarded ( std::list< jd3::JobResultID > &  list)
inline

This does not erase the list! We just add job result ids that have been eliminated from the results to keep.

References job_results_that_should_be_discarded_.

void protocols::jd3::dag_node_managers::NodeManager::clear ( )
bool protocols::jd3::dag_node_managers::NodeManager::done_submitting ( ) const
inline
core::Size protocols::jd3::dag_node_managers::NodeManager::get_next_local_jobid ( )
inline

This class can be used to determine which job should be submitted next. A value of 0 means that we are done submitting for this dag node.

References done_submitting(), and num_jobs_submitted_.

jd3::JobResultID protocols::jd3::dag_node_managers::NodeManager::get_nth_job_result_id ( core::Size  n)
inline
core::Size protocols::jd3::dag_node_managers::NodeManager::job_offset ( ) const
inline

References job_offset_.

bool protocols::jd3::dag_node_managers::NodeManager::jobs_are_still_running ( )
inline
void protocols::jd3::dag_node_managers::NodeManager::note_job_completed ( GlobalJobID  global_job_id,
core::Size  nresults 
)
inline

please call this from your job queen's note_job_completed() function

References num_jobs_completed_, and num_results_total_.

core::Size protocols::jd3::dag_node_managers::NodeManager::num_jobs ( ) const
inline

References num_jobs_total_.

core::Size protocols::jd3::dag_node_managers::NodeManager::num_jobs_completed ( ) const
inline

References num_jobs_completed_.

core::Size protocols::jd3::dag_node_managers::NodeManager::num_jobs_submitted ( ) const
inline

References num_jobs_submitted_.

core::Size protocols::jd3::dag_node_managers::NodeManager::num_results_received ( )
inlineprotected

References num_results_received_.

core::Size protocols::jd3::dag_node_managers::NodeManager::num_results_to_keep ( ) const
inline

References num_results_to_keep_.

core::Size protocols::jd3::dag_node_managers::NodeManager::num_results_total ( ) const
inline

References num_results_total_.

bool protocols::jd3::dag_node_managers::NodeManager::ready_to_finish_early ( ) const
inlineprotected
void protocols::jd3::dag_node_managers::NodeManager::register_result ( GlobalJobID  global_job_id,
core::Size  result_id,
core::Real  score,
core::Size  partition = 1,
uint64_t  token = 0 
)
virtual
utility::vector1< ResultElements > protocols::jd3::dag_node_managers::NodeManager::results_to_keep ( )
inline
void protocols::jd3::dag_node_managers::NodeManager::set_max_num_results_with_same_token_per_partition ( core::Size  setting)
inline

Perhaps you have a diversity requirement and do not want too many results with the same token (token can represent anything you want - as long as it can be stored as a core::Size), this setting is for you.

References max_num_results_with_same_token_per_partition_, results_to_keep_, and protocols::jd3::dag_node_managers::NodeManagerStorageMatrix::set_max_num_results_with_same_token_per_partition().

void protocols::jd3::dag_node_managers::NodeManager::set_num_jobs ( core::Size  new_num_jobs)
inline

References num_jobs_total_.

void protocols::jd3::dag_node_managers::NodeManager::set_return_results_depth_first ( bool  setting)
inline
void protocols::jd3::dag_node_managers::NodeManager::stop_early ( )
inline

References stopped_early_.

bool protocols::jd3::dag_node_managers::NodeManager::stopped_early ( ) const
inline

References stopped_early_.

Member Data Documentation

core::Size protocols::jd3::dag_node_managers::NodeManager::job_offset_
private

Referenced by job_offset().

std::list< jd3::JobResultID > protocols::jd3::dag_node_managers::NodeManager::job_results_that_should_be_discarded_
private
core::Size protocols::jd3::dag_node_managers::NodeManager::max_num_results_with_same_token_per_partition_
private
core::Size protocols::jd3::dag_node_managers::NodeManager::num_jobs_completed_
private
core::Size protocols::jd3::dag_node_managers::NodeManager::num_jobs_submitted_
private
core::Size protocols::jd3::dag_node_managers::NodeManager::num_jobs_total_
private
core::Size protocols::jd3::dag_node_managers::NodeManager::num_partitions_
private

Referenced by ready_to_finish_early().

core::Size protocols::jd3::dag_node_managers::NodeManager::num_results_received_
private
utility::vector1< core::Size > protocols::jd3::dag_node_managers::NodeManager::num_results_received_for_part_
private
core::Size protocols::jd3::dag_node_managers::NodeManager::num_results_to_keep_
private

Referenced by NodeManager(), and num_results_to_keep().

utility::vector1< core::Size > protocols::jd3::dag_node_managers::NodeManager::num_results_to_keep_for_part_
private

Referenced by NodeManager().

core::Size protocols::jd3::dag_node_managers::NodeManager::num_results_total_
private
bool protocols::jd3::dag_node_managers::NodeManager::result_threshold_
private

Referenced by register_result().

utility::vector1< core::Size > protocols::jd3::dag_node_managers::NodeManager::result_threshold_per_part_
private

Referenced by ready_to_finish_early().

NodeManagerStorageMatrix protocols::jd3::dag_node_managers::NodeManager::results_to_keep_
private
bool protocols::jd3::dag_node_managers::NodeManager::stopped_early_
private

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