OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <Worker.h>
Public Member Functions | |
Worker (Expressions::Named_t constraints, std::string simName, Comm::Bundle_t comms, CmdArguments_t args) | |
Worker (Expressions::Named_t objectives, Expressions::Named_t constraints, std::string simName, Comm::Bundle_t comms, CmdArguments_t args, const std::map< std::string, std::string > &userVariables, bool isOptimizer=true) | |
~Worker () | |
Protected Types | |
typedef boost::scoped_ptr< Sim_t > | SimPtr_t |
Protected Member Functions | |
void | runCoWorker () |
void | notifyCoWorkers (int tag) |
notify coworkers of incoming broadcast More... | |
void | setupPoll () |
executed before starting polling loop More... | |
void | prePoll () |
executed before checking for new request More... | |
void | postPoll () |
executed after handling (if any) new request More... | |
void | onStop () |
enable implementation to react to STOP tag More... | |
virtual bool | onMessage (MPI_Status status, size_t recv_value) |
Protected Member Functions inherited from Poller | |
virtual void | run () |
Poller (MPI_Comm comm, double delay=0.1) | |
virtual | ~Poller () |
Protected Attributes | |
bool | is_idle_ |
MPI_Comm | coworker_comm_ |
Expressions::Named_t | objectives_ |
Expressions::Named_t | constraints_ |
int | leader_pid_ |
int | num_coworkers_ |
int | pilot_rank_ |
std::string | simulation_name_ |
CmdArguments_t | cmd_args_ |
const std::map< std::string, std::string > | userVariables_ |
Protected Attributes inherited from Poller | |
MPI_Comm | comm_m |
communicator the poller listens to requests More... | |
bool | is_running_ |
double | last_polled_ |
time of last MPI_Test More... | |
double | poll_delay_ |
delay in seconds between polls More... | |
|
inline |
Definition at line 49 of file Worker.h.
References Worker< Sim_t >::constraints_, Worker< Sim_t >::coworker_comm_, Comm::Bundle_t::coworkers, Worker< Sim_t >::is_idle_, Worker< Sim_t >::leader_pid_, Comm::Bundle_t::master_local_pid, Worker< Sim_t >::num_coworkers_, Worker< Sim_t >::pilot_rank_, and Worker< Sim_t >::simulation_name_.
|
inline |
Definition at line 66 of file Worker.h.
References Worker< Sim_t >::constraints_, Worker< Sim_t >::coworker_comm_, Comm::Bundle_t::coworkers, Worker< Sim_t >::is_idle_, Worker< Sim_t >::leader_pid_, Comm::Bundle_t::master_local_pid, Worker< Sim_t >::num_coworkers_, Worker< Sim_t >::objectives_, Worker< Sim_t >::pilot_rank_, Poller::run(), Worker< Sim_t >::runCoWorker(), and Worker< Sim_t >::simulation_name_.
|
inlineprotected |
notify coworkers of incoming broadcast
Definition at line 176 of file Worker.h.
References Worker< Sim_t >::coworker_comm_, Worker< Sim_t >::leader_pid_, and Worker< Sim_t >::num_coworkers_.
Referenced by Worker< Sim_t >::onMessage(), and Worker< Sim_t >::onStop().
|
inlineprotectedvirtual |
User specific behavior on receiving a message.
Implements Poller.
Reimplemented in SampleWorker< Sim_t >.
Definition at line 203 of file Worker.h.
References Worker< Sim_t >::cmd_args_, Poller::comm_m, Worker< Sim_t >::constraints_, Worker< Sim_t >::coworker_comm_, endl(), Worker< Sim_t >::is_idle_, Worker< Sim_t >::leader_pid_, MPI_Bcast_params(), MPI_COWORKER_NEW_JOB_TAG, MPI_Recv_params(), MPI_Send_reqvars(), MPI_WORK_JOBID_TAG, MPI_WORKER_FINISHED_ACK_TAG, MPI_WORKER_FINISHED_TAG, Worker< Sim_t >::notifyCoWorkers(), Worker< Sim_t >::num_coworkers_, Worker< Sim_t >::objectives_, Worker< Sim_t >::pilot_rank_, Worker< Sim_t >::simulation_name_, Worker< Sim_t >::userVariables_, and OptPilotException::what().
|
inlineprotectedvirtual |
enable implementation to react to STOP tag
Implements Poller.
Definition at line 198 of file Worker.h.
References MPI_STOP_TAG, Worker< Sim_t >::notifyCoWorkers(), and Worker< Sim_t >::num_coworkers_.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotected |
coworkers simply wait on a job broadcast from the leader and then start a simulation..
Definition at line 114 of file Worker.h.
References Worker< Sim_t >::cmd_args_, Worker< Sim_t >::constraints_, Worker< Sim_t >::coworker_comm_, endl(), Poller::is_running_, Worker< Sim_t >::leader_pid_, MPI_Bcast_params(), MPI_COWORKER_NEW_JOB_TAG, MPI_STOP_TAG, Worker< Sim_t >::objectives_, Worker< Sim_t >::simulation_name_, Worker< Sim_t >::userVariables_, and OptPilotException::what().
Referenced by Worker< Sim_t >::Worker().
|
inlineprotectedvirtual |
executed before starting polling loop
Implements Poller.
Definition at line 186 of file Worker.h.
References Poller::comm_m, MPI_WORKER_STATUSUPDATE_TAG, and Worker< Sim_t >::pilot_rank_.
|
protected |
Definition at line 171 of file Worker.h.
Referenced by Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), and SampleWorker< Sim_t >::runSlave().
|
protected |
Definition at line 109 of file Worker.h.
Referenced by Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), SampleWorker< Sim_t >::runSlave(), and Worker< Sim_t >::Worker().
|
protected |
Definition at line 106 of file Worker.h.
Referenced by Worker< Sim_t >::notifyCoWorkers(), SampleWorker< Sim_t >::notifyCoWorkers(), Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), SampleWorker< Sim_t >::runSlave(), SampleWorker< Sim_t >::SampleWorker(), and Worker< Sim_t >::Worker().
|
protected |
Definition at line 105 of file Worker.h.
Referenced by Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), and Worker< Sim_t >::Worker().
|
protected |
Definition at line 167 of file Worker.h.
Referenced by Worker< Sim_t >::notifyCoWorkers(), SampleWorker< Sim_t >::notifyCoWorkers(), Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), SampleWorker< Sim_t >::runSlave(), SampleWorker< Sim_t >::SampleWorker(), and Worker< Sim_t >::Worker().
|
protected |
Definition at line 168 of file Worker.h.
Referenced by Worker< Sim_t >::notifyCoWorkers(), SampleWorker< Sim_t >::notifyCoWorkers(), Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::onStop(), and Worker< Sim_t >::Worker().
|
protected |
Definition at line 108 of file Worker.h.
Referenced by Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), SampleWorker< Sim_t >::runSlave(), and Worker< Sim_t >::Worker().
|
protected |
Definition at line 169 of file Worker.h.
Referenced by Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::setupPoll(), and Worker< Sim_t >::Worker().
|
protected |
Definition at line 170 of file Worker.h.
Referenced by Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), SampleWorker< Sim_t >::runSlave(), and Worker< Sim_t >::Worker().
|
protected |
Definition at line 173 of file Worker.h.
Referenced by Worker< Sim_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), and SampleWorker< Sim_t >::runSlave().