|
OPAL (Object Oriented Parallel Accelerator Library)
2.2.0
OPAL
|
A worker MPI entity consists of a processor group that runs a simulation of type Sim_t. The main loop in run() accepts new jobs from the master process runs the simulation and reports back the results. More...
#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) | |
| ~SampleWorker () | |
Protected Member Functions | |
| void | notifyCoWorkers (size_t job_id, int tag) |
| notify coworkers of incoming broadcast More... | |
| void | runSlave () |
| bool | onMessage (MPI_Status status, size_t recv_value) override |
Protected Member Functions inherited from Worker< Sim_t > | |
| 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... | |
| 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, bool isOptimizer=true) | |
| ~Worker () | |
Protected Member Functions inherited from Poller | |
| virtual void | run () |
| Poller (MPI_Comm comm, double delay=0.1) | |
| virtual | ~Poller () |
Protected Attributes | |
| const std::vector< std::string > | statVariablesToStore_m |
Protected Attributes inherited from Worker< Sim_t > | |
| 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_ |
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... | |
Private Attributes | |
| const std::vector< std::string > | filesToKeep_m |
Additional Inherited Members | |
Protected Types inherited from Worker< Sim_t > | |
| typedef boost::scoped_ptr< Sim_t > | SimPtr_t |
A worker MPI entity consists of a processor group that runs a simulation of type Sim_t. The main loop in run() accepts new jobs from the master process runs the simulation and reports back the results.
| Sim_T | type of simulation to run |
Definition at line 20 of file SampleWorker.h.
|
inline |
Definition at line 24 of file SampleWorker.h.
References Worker< Sim_t >::coworker_comm_, Worker< Sim_t >::leader_pid_, Poller::run(), and SampleWorker< Sim_t >::runSlave().

|
inline |
Definition at line 46 of file SampleWorker.h.
|
inlineprotected |
notify coworkers of incoming broadcast
Definition at line 54 of file SampleWorker.h.
References Worker< Sim_t >::coworker_comm_, Worker< Sim_t >::leader_pid_, and Worker< Sim_t >::num_coworkers_.
Referenced by SampleWorker< Sim_t >::onMessage().
|
inlineoverrideprotectedvirtual |
User specific behavior on receiving a message.
Reimplemented from Worker< Sim_t >.
Definition at line 121 of file SampleWorker.h.
References Worker< Sim_t >::cmd_args_, Poller::comm_m, Worker< Sim_t >::constraints_, Worker< Sim_t >::coworker_comm_, endl(), SampleWorker< Sim_t >::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, SampleWorker< Sim_t >::notifyCoWorkers(), Worker< Sim_t >::num_coworkers_, Worker< Sim_t >::objectives_, Worker< Sim_t >::pilot_rank_, Poller::run(), Worker< Sim_t >::simulation_name_, and OptPilotException::what().

|
inlineprotected |
coworkers simply wait on a job broadcast from the leader and then start a simulation..
Definition at line 66 of file SampleWorker.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_, Poller::run(), Worker< Sim_t >::simulation_name_, and OptPilotException::what().
Referenced by SampleWorker< Sim_t >::SampleWorker().

|
private |
Definition at line 195 of file SampleWorker.h.
Referenced by SampleWorker< Sim_t >::onMessage().
|
protected |
Definition at line 51 of file SampleWorker.h.
1.8.5