OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
SampleWorker< Sim_t > Class Template Reference

#include <SampleWorker.h>

Inheritance diagram for SampleWorker< Sim_t >:
Inheritance graph
[legend]
Collaboration diagram for SampleWorker< Sim_t >:
Collaboration graph
[legend]

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 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, const std::map< std::string, std::string > &userVariables, 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_
 
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...
 

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
 

Detailed Description

template<class Sim_t>
class SampleWorker< Sim_t >

Definition at line 36 of file SampleWorker.h.

Constructor & Destructor Documentation

◆ SampleWorker()

template<class Sim_t >
SampleWorker< Sim_t >::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 
)
inline

Definition at line 40 of file SampleWorker.h.

References Worker< Sim_t >::coworker_comm_, Worker< Sim_t >::leader_pid_, Poller::run(), and SampleWorker< Sim_t >::runSlave().

Here is the call graph for this function:

◆ ~SampleWorker()

template<class Sim_t >
SampleWorker< Sim_t >::~SampleWorker ( )
inline

Definition at line 63 of file SampleWorker.h.

Member Function Documentation

◆ notifyCoWorkers()

template<class Sim_t >
void SampleWorker< Sim_t >::notifyCoWorkers ( size_t  job_id,
int  tag 
)
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 SampleWorker< Sim_t >::onMessage().

◆ onMessage()

template<class Sim_t >
bool SampleWorker< Sim_t >::onMessage ( MPI_Status  status,
size_t  recv_value 
)
inlineoverrideprotectedvirtual

◆ runSlave()

template<class Sim_t >
void SampleWorker< Sim_t >::runSlave ( )
inlineprotected

Member Data Documentation

◆ filesToKeep_m

template<class Sim_t >
const std::vector<std::string> SampleWorker< Sim_t >::filesToKeep_m
private

Definition at line 214 of file SampleWorker.h.

Referenced by SampleWorker< Sim_t >::onMessage().

◆ statVariablesToStore_m

template<class Sim_t >
const std::vector<std::string> SampleWorker< Sim_t >::statVariablesToStore_m
protected

Definition at line 68 of file SampleWorker.h.


The documentation for this class was generated from the following file: