|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
#include <SampleWorker.h>
Public Member Functions | |
| SampleWorker (Expressions::Named_t objectives, Expressions::Named_t constraints, std::string simName, Comm::Bundle_t comms, CmdArguments_t args, const std::vector< std::string > &storeobjstr, const std::vector< std::string > &filesToKeep, const std::map< std::string, std::string > &userVariables) | |
| ~SampleWorker () | |
Protected Types | |
| typedef const std::unique_ptr< Sim_t > | SimPtr_t |
Protected Member Functions | |
| void | notifyCoWorkers (size_t job_id, int tag) |
| notify coworkers of incoming broadcast | |
| void | runSlave () |
| bool | onMessage (MPI_Status status, size_t recv_value) override |
| 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 void | run () |
Protected Attributes | |
| const std::vector< std::string > | statVariablesToStore_m |
| 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 | |
Private Attributes | |
| const std::vector< std::string > | filesToKeep_m |
Definition at line 36 of file SampleWorker.h.
|
protectedinherited |
|
inline |
Definition at line 40 of file SampleWorker.h.
References Worker< Sim_t >::coworker_comm_, filesToKeep_m, Worker< Sim_t >::leader_pid_, Poller::run(), runSlave(), statVariablesToStore_m, and Worker< Sim_t >::Worker().
|
inline |
Definition at line 63 of file SampleWorker.h.
|
inlineprotected |
notify coworkers of incoming broadcast
Definition at line 71 of file SampleWorker.h.
References Worker< Sim_t >::coworker_comm_, Worker< Sim_t >::leader_pid_, and Worker< Sim_t >::num_coworkers_.
Referenced by onMessage().
|
inlineprotectedinherited |
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().
|
inlineoverrideprotectedvirtual |
User specific behavior on receiving a message.
Reimplemented from Worker< Sim_t >.
Definition at line 139 of file SampleWorker.h.
References Worker< Sim_t >::cmd_args_, Poller::comm_m, Worker< Sim_t >::constraints_, Worker< Sim_t >::coworker_comm_, filesToKeep_m, 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, 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().
|
inlineprotectedvirtualinherited |
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_.
|
inlineprotectedvirtualinherited |
|
inlineprotectedvirtualinherited |
|
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().
|
inlineprotectedinherited |
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().
|
inlineprotected |
coworkers simply wait on a job broadcast from the leader and then start a simulation..
Definition at line 83 of file SampleWorker.h.
References Worker< Sim_t >::cmd_args_, Worker< Sim_t >::constraints_, Worker< Sim_t >::coworker_comm_, 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 SampleWorker().
|
inlineprotectedvirtualinherited |
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_.
|
protectedinherited |
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().
|
protectedinherited |
Definition at line 107 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), Worker(), and Worker().
|
protectedinherited |
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().
|
private |
Definition at line 214 of file SampleWorker.h.
Referenced by onMessage(), and SampleWorker().
|
protectedinherited |
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 |
|
protectedinherited |
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().
|
protectedinherited |
Definition at line 166 of file Worker.h.
Referenced by SampleWorker< Sim_t >::notifyCoWorkers(), notifyCoWorkers(), SampleWorker< Sim_t >::onMessage(), onMessage(), onStop(), Worker(), and Worker().
|
protectedinherited |
Definition at line 106 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), and Worker().
|
protectedinherited |
Definition at line 167 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), setupPoll(), Worker(), and Worker().
|
protectedinherited |
|
protectedinherited |
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 68 of file SampleWorker.h.
Referenced by SampleWorker().
|
protectedinherited |
Definition at line 171 of file Worker.h.
Referenced by SampleWorker< Sim_t >::onMessage(), onMessage(), runCoWorker(), SampleWorker< Sim_t >::runSlave(), and Worker().