|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
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 const std::unique_ptr< Sim_t > | SimPtr_t |
Protected Member Functions | |
| void | runCoWorker () |
| void | notifyCoWorkers (int tag) |
| notify coworkers of incoming broadcast | |
| void | setupPoll () |
| executed before starting polling loop | |
| void | prePoll () |
| executed before checking for new request | |
| void | postPoll () |
| executed after handling (if any) new request | |
| void | onStop () |
| enable implementation to react to STOP tag | |
| virtual bool | onMessage (MPI_Status status, size_t recv_value) |
| virtual void | run () |
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_ |
| MPI_Comm | comm_m |
| communicator the poller listens to requests | |
| bool | is_running_ |
| double | last_polled_ |
| time of last MPI_Test | |
| double | poll_delay_ |
| delay in seconds between polls | |
|
protected |
|
inline |
Definition at line 47 of file Worker.h.
References cmd_args_, constraints_, coworker_comm_, Comm::Bundle_t::coworkers, is_idle_, leader_pid_, Comm::Bundle_t::master_local_pid, num_coworkers_, pilot_rank_, Poller::Poller(), and simulation_name_.
Referenced by SampleWorker< Sim_t >::SampleWorker().
|
inline |
Definition at line 64 of file Worker.h.
References cmd_args_, constraints_, coworker_comm_, Comm::Bundle_t::coworkers, is_idle_, leader_pid_, Comm::Bundle_t::master_local_pid, num_coworkers_, objectives_, pilot_rank_, Poller::Poller(), Poller::run(), runCoWorker(), simulation_name_, and userVariables_.
|
inlineprotected |
notify coworkers of incoming broadcast
Definition at line 174 of file Worker.h.
References coworker_comm_, leader_pid_, and num_coworkers_.
Referenced by onMessage(), and onStop().
|
inlineprotectedvirtual |
User specific behavior on receiving a message.
Implements Poller.
Reimplemented in SampleWorker< Sim_t >.
Definition at line 201 of file Worker.h.
References cmd_args_, Poller::comm_m, constraints_, coworker_comm_, is_idle_, 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, notifyCoWorkers(), num_coworkers_, objectives_, pilot_rank_, simulation_name_, userVariables_, and OptPilotException::what().
|
inlineprotectedvirtual |
enable implementation to react to STOP tag
Implements Poller.
Definition at line 196 of file Worker.h.
References MPI_STOP_TAG, notifyCoWorkers(), and num_coworkers_.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtualinherited |
The poll loop stops when receiving a 'MPI_STOP_TAG' otherwise passes message to user.
Reimplemented in Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >.
Definition at line 79 of file Poller.h.
References comm_m, is_running_, last_polled_, MPI_STOP_TAG, onMessage(), onStop(), poll_delay_, postPoll(), prePoll(), and setupPoll().
Referenced by Sampler::initialize(), SampleWorker< Sim_t >::SampleWorker(), and Worker< Sim_t >::Worker().
|
inlineprotected |
coworkers simply wait on a job broadcast from the leader and then start a simulation..
Definition at line 112 of file Worker.h.
References cmd_args_, constraints_, coworker_comm_, Poller::is_running_, leader_pid_, MPI_Bcast_params(), MPI_COWORKER_NEW_JOB_TAG, MPI_STOP_TAG, objectives_, simulation_name_, userVariables_, and OptPilotException::what().
Referenced by Worker().
|
inlineprotectedvirtual |
executed before starting polling loop
Implements Poller.
Definition at line 184 of file Worker.h.
References Poller::comm_m, MPI_WORKER_STATUSUPDATE_TAG, and pilot_rank_.
|
protected |
Definition at line 169 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), Worker(), and Worker().
|
protectedinherited |
communicator the poller listens to requests
Definition at line 52 of file Poller.h.
Referenced by SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::onMessage(), Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::parseInputFile(), Poller(), run(), and Worker< Sim_t >::setupPoll().
|
protected |
Definition at line 107 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), Worker(), and Worker().
|
protected |
Definition at line 104 of file Worker.h.
Referenced by SampleWorker< Sim_t >::notifyCoWorkers(), notifyCoWorkers(), SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), SampleWorker< Sim_t >::SampleWorker(), Worker(), and Worker().
|
protected |
Definition at line 103 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), Worker(), and Worker().
|
protectedinherited |
Definition at line 54 of file Poller.h.
Referenced by Poller(), run(), Worker< Sim_t >::runCoWorker(), and SampleWorker< Sim_t >::runSlave().
|
protectedinherited |
|
protected |
Definition at line 165 of file Worker.h.
Referenced by SampleWorker< Sim_t >::notifyCoWorkers(), notifyCoWorkers(), SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), SampleWorker< Sim_t >::SampleWorker(), Worker(), and Worker().
|
protected |
Definition at line 166 of file Worker.h.
Referenced by SampleWorker< Sim_t >::notifyCoWorkers(), notifyCoWorkers(), SampleWorker< Sim_t >::onMessage(), onMessage(), onStop(), Worker(), and Worker().
|
protected |
Definition at line 106 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), and Worker().
|
protected |
Definition at line 167 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), setupPoll(), Worker(), and Worker().
|
protectedinherited |
|
protected |
Definition at line 168 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), Worker(), and Worker().
|
protected |
Definition at line 171 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), and Worker().