Rosetta 3.4
|
#include <MPI_WorkUnitManager.hh>
Public Member Functions | |
MPI_WorkUnitManager (char machine_letter) | |
virtual | ~MPI_WorkUnitManager () |
virtual void | go ()=0 |
Protected Types | |
enum | MPI_TIMING { TIMING_WAIT = 0, TIMING_TRANSFER_SEND, TIMING_TRANSFER_RECV, TIMING_CPU, TIMING_IO_WRITE, TIMING_IO_READ, TIMING_IDLE, TIMING_end } |
Protected Member Functions | |
virtual void | init ()=0 |
virtual void | process_inbound_wus ()=0 |
virtual void | process_outbound_wus ()=0 |
virtual void | print_stats () |
Print a line with general run statistics, now. | |
virtual void | print_stats_auto () |
Print a line with general run statistics, only if enough time has pased since the last statistics printout. | |
void | reset_timing_stats () |
Reset all the stats counters. | |
void | process_incoming_msgs (bool wait_until_message=false) |
MPI Communication function. | |
void | send_MPI_workunit (const WorkUnitBaseOP &wu, int dest_rank) const |
Send a workunit to an arbitrary recipient. | |
void | receive_MPI_workunit (core::Size node_rank=MPI_ANY_SOURCE) |
Receive a workunit and add it to the inbound queue. By default accept any workunit or accept a specific source rank. Note that this function is *blocking* and will onyl return once a workunit has been received. | |
void | send_next_WU_on_request () |
char | get_machine_letter () |
How many masters are there in total ? | |
core::Real | start_timer (MPI_TIMING timing_mode) const |
This initiates a new timer block. Note that there is no end_timer() function - you just keep calling start_timer, which automatically ends the previous block (and records times etc) | |
void | print_timing_stats () |
Display the timing statistics. | |
long | wall_time () const |
Return the total life time of this class in seconds. |
enum protocols::wum::MPI_WorkUnitManager::MPI_TIMING [protected] |
protocols::wum::MPI_WorkUnitManager::MPI_WorkUnitManager | ( | char | machine_letter | ) |
virtual protocols::wum::MPI_WorkUnitManager::~MPI_WorkUnitManager | ( | ) | [inline, virtual] |
char protocols::wum::MPI_WorkUnitManager::get_machine_letter | ( | ) | [protected] |
How many masters are there in total ?
This is for masters only - returns a serial master number, i.e. 0 is the first master, N-1 is the last master. Returns the running serial number (0 based) of a master. Returns 0 if emperor The first master returns 0, the second returns 1, etc..
Referenced by print_stats().
virtual void protocols::wum::MPI_WorkUnitManager::go | ( | ) | [pure virtual] |
virtual void protocols::wum::MPI_WorkUnitManager::init | ( | ) | [protected, pure virtual] |
void protocols::wum::MPI_WorkUnitManager::print_stats | ( | ) | [protected, virtual] |
Print a line with general run statistics, now.
Reimplemented in protocols::loophash::MPI_LoopHashRefine.
References make_table_of_pilot_apps::f, get_machine_letter(), protocols::wum::WorkUnitManager::inbound(), protocols::wum::WorkUnitQueue::mem_foot_print(), protocols::wum::WorkUnitQueue::mem_stats(), protocols::wum::WorkUnitManager::outbound(), reset_timing_stats(), protocols::wum::WorkUnitQueue::size(), TIMING_CPU, TIMING_IDLE, TIMING_IO_READ, TIMING_IO_WRITE, TIMING_TRANSFER_RECV, TIMING_TRANSFER_SEND, TIMING_WAIT, and wall_time().
Referenced by protocols::wum::MPI_WorkUnitManager_Slave::go(), and print_stats_auto().
void protocols::wum::MPI_WorkUnitManager::print_stats_auto | ( | ) | [protected, virtual] |
Print a line with general run statistics, only if enough time has pased since the last statistics printout.
References print_stats().
Referenced by protocols::wum::MPI_WorkUnitManager_Slave::go(), and process_incoming_msgs().
void protocols::wum::MPI_WorkUnitManager::print_timing_stats | ( | ) | [protected] |
Display the timing statistics.
virtual void protocols::wum::MPI_WorkUnitManager::process_inbound_wus | ( | ) | [protected, pure virtual] |
void protocols::wum::MPI_WorkUnitManager::process_incoming_msgs | ( | bool | wait_until_message = false | ) | [protected] |
MPI Communication function.
Check for messages and process them accordingly
References MPI_ANY_SOURCE, protocols::wum::WorkUnitManager::outbound(), print_stats_auto(), receive_MPI_workunit(), send_next_WU_on_request(), protocols::wum::WorkUnitQueue::size(), start_timer(), TIMING_CPU, TIMING_IDLE, protocols::wum::WUM_MPI_REQUEST_WU, and protocols::wum::WUM_MPI_SEND_WU.
Referenced by protocols::wum::MPI_WorkUnitManager_Slave::go().
virtual void protocols::wum::MPI_WorkUnitManager::process_outbound_wus | ( | ) | [protected, pure virtual] |
void protocols::wum::MPI_WorkUnitManager::receive_MPI_workunit | ( | core::Size | node_rank = MPI_ANY_SOURCE | ) | [protected] |
Receive a workunit and add it to the inbound queue. By default accept any workunit or accept a specific source rank. Note that this function is *blocking* and will onyl return once a workunit has been received.
References protocols::wum::WorkUnitQueue::add(), protocols::wum::get_time(), protocols::wum::WorkUnitList::get_work_unit(), protocols::wum::WorkUnitManager::inbound(), start_timer(), TIMING_CPU, TIMING_TRANSFER_RECV, TRDEBUG, protocols::wum::WorkUnitManager::work_unit_list(), protocols::wum::WUM_MPI_DATA_BLOCK, and protocols::wum::WUM_MPI_SEND_WU.
Referenced by process_incoming_msgs().
void protocols::wum::MPI_WorkUnitManager::reset_timing_stats | ( | ) | [protected] |
Reset all the stats counters.
References TIMING_end.
Referenced by MPI_WorkUnitManager(), and print_stats().
void protocols::wum::MPI_WorkUnitManager::send_MPI_workunit | ( | const WorkUnitBaseOP & | wu, |
int | dest_rank | ||
) | const [protected] |
Send a workunit to an arbitrary recipient.
References protocols::wum::get_time(), protocols::wum::mpi_npes(), protocols::wum::mpi_rank(), start_timer(), TIMING_CPU, TIMING_TRANSFER_SEND, TIMING_WAIT, TRDEBUG, protocols::wum::WUM_MPI_DATA_BLOCK, and protocols::wum::WUM_MPI_SEND_WU.
Referenced by protocols::wum::MPI_WorkUnitManager_Slave::process_outbound_wus(), send_next_WU_on_request(), and protocols::loophash::MPI_LoopHashRefine::send_random_library_struct().
void protocols::wum::MPI_WorkUnitManager::send_next_WU_on_request | ( | ) | [protected] |
References protocols::wum::WorkUnitQueue::begin(), core::sequence::end, protocols::wum::WorkUnitQueue::end(), protocols::wum::WorkUnitQueue::erase(), MPI_ANY_SOURCE, protocols::wum::WorkUnitManager::outbound(), protocols::wum::WorkUnitQueue::push_back(), send_MPI_workunit(), protocols::wum::WorkUnitQueue::size(), start_timer(), TIMING_CPU, TRDEBUG, and protocols::wum::WUM_MPI_REQUEST_WU.
Referenced by process_incoming_msgs().
core::Real protocols::wum::MPI_WorkUnitManager::start_timer | ( | MPI_TIMING | timing_mode | ) | const [protected] |
This initiates a new timer block. Note that there is no end_timer() function - you just keep calling start_timer, which automatically ends the previous block (and records times etc)
References protocols::wum::get_time(), and TIMING_end.
Referenced by protocols::loophash::MPI_LoopHashRefine::add_structure_to_library_add_n_replace(), protocols::loophash::MPI_LoopHashRefine::dump_structures(), protocols::loophash::MPI_LoopHashRefine::load_state(), protocols::loophash::MPI_LoopHashRefine::load_structures_from_cmdline_into_library(), MPI_WorkUnitManager(), protocols::wum::MPI_WorkUnitManager_Slave::process_inbound_wus(), process_incoming_msgs(), receive_MPI_workunit(), protocols::wum::MPI_WorkUnitManager_Slave::request_new_jobs(), protocols::loophash::MPI_LoopHashRefine::save_state(), send_MPI_workunit(), and send_next_WU_on_request().
long protocols::wum::MPI_WorkUnitManager::wall_time | ( | ) | const [protected] |
Return the total life time of this class in seconds.
Referenced by print_stats(), and protocols::loophash::MPI_LoopHashRefine::print_stats().