OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t > Class Template Reference

The sample Pilot (Master): Coordinates requests by sampler to workers. More...

#include <SamplePilot.h>

Inheritance diagram for SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >:
Inheritance graph
[legend]
Collaboration diagram for SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >:
Collaboration graph
[legend]

Public Member Functions

 SamplePilot (CmdArguments_t args, boost::shared_ptr< Comm_t > comm, functionDictionary_t known_expr_funcs, const DVarContainer_t &dvar, const Expressions::Named_t &obj, const std::map< std::string, std::shared_ptr< SamplingMethod > > &sampleMethods, const std::vector< std::string > &storeobjstr, const std::vector< std::string > &filesToKeep)
 
 sampleMethods_m (sampleMethods)
 
virtual ~SamplePilot ()
 

Public Attributes

 false
 

Protected Types

typedef std::map< size_t, Param_tJobs_t
 keep track of requests and running jobs More...
 
typedef Jobs_t::iterator JobIter_t
 
- Protected Types inherited from Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >
typedef MasterNode< typename
Opt_t::SolutionState_t,
SolPropagationGraph_t > 
MasterNode_t
 
typedef std::map< size_t,
std::pair< Param_t,
reqVarContainer_t > > 
Jobs_t
 keep track of requests and running jobs More...
 
typedef Jobs_t::iterator JobIter_t
 

Protected Member Functions

virtual void setup (functionDictionary_t known_expr_funcs, const std::vector< std::string > &storeobjstr, const std::vector< std::string > &filesToKeep)
 
virtual void startSampler ()
 
void startWorker (const std::vector< std::string > &storeobjstr, const std::vector< std::string > &filesToKeep)
 
virtual void postPoll ()
 executed after handling (if any) new request More...
 
virtual void sendNewJobToWorker (int worker)
 
virtual bool onMessage (MPI_Status status, size_t recv_value)
 
- Protected Member Functions inherited from Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >
void parseInputFile (functionDictionary_t known_expr_funcs, bool isOptimizationRun)
 
virtual void startOptimizer ()
 
virtual void startWorker ()
 
virtual void startPilot ()
 
virtual void setupPoll ()
 executed before starting polling loop More...
 
virtual void prePoll ()
 executed before checking for new request More...
 
virtual void onStop ()
 enable implementation to react to STOP tag More...
 
bool stop (bool isOpt=true)
 
void run ()
 
 Pilot (CmdArguments_t args, boost::shared_ptr< Comm_t > comm, const DVarContainer_t &dvar)
 
 Pilot (CmdArguments_t args, boost::shared_ptr< Comm_t > comm, functionDictionary_t known_expr_funcs)
 
 Pilot (CmdArguments_t args, boost::shared_ptr< Comm_t > comm, functionDictionary_t known_expr_funcs, const DVarContainer_t &dvar, const Expressions::Named_t &obj, const Expressions::Named_t &cons, std::vector< double > hypervolRef={}, bool isOptimizerRun=true)
 
virtual ~Pilot ()
 
 Poller (MPI_Comm comm, double delay=0.1)
 
virtual ~Poller ()
 

Protected Attributes

Jobs_t running_job_list_
 
Jobs_t request_queue_
 
- Protected Attributes inherited from Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >
MPI_Comm worker_comm_
 MPI communicator used for messages to/from worker. More...
 
MPI_Comm opt_comm_
 MPI communicator used for messages to/from optimizer. More...
 
MPI_Comm coworker_comm_
 MPI communicator used for messages between all pilots. More...
 
boost::shared_ptr< Comm_t > comm_
 
CmdArguments_t cmd_args_
 
int global_rank_
 
int my_rank_in_worker_comm_
 
int my_rank_in_opt_comm_
 
int num_coworkers_
 
boost::scoped_ptr< MasterNode_tmaster_node_
 
std::string input_file_
 input file for simulation with embedded optimization problem More...
 
int total_available_workers_
 
bool has_opt_converged_
 
bool continue_polling_
 
Expressions::Named_t objectives_
 objectives More...
 
Expressions::Named_t constraints_
 constraints More...
 
DVarContainer_t dvars_
 design variables More...
 
std::vector< double > hypervolRef_
 hypervolume reference point More...
 
std::vector< bool > is_worker_idle_
 
Jobs_t running_job_list_
 
Jobs_t request_queue_
 
boost::scoped_ptr< Tracejob_trace_
 
- 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

std::map< std::string,
std::shared_ptr
< SamplingMethod > > 
sampleMethods_m
 

Detailed Description

template<class Opt_t, class Sim_t, class SolPropagationGraph_t, class Comm_t>
class SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >

The sample Pilot (Master): Coordinates requests by sampler to workers.

Every worker thread notifies the master here if idle or not. When available the master dispatches one of the pending simulations to the worker who will run the specified simulation and report results back to the master.

See Also
SampleWorker
Sampler
Template Parameters
Opt_ttype of the sampler
Sim_ttype of the simulation
SolPropagationGraph_tstrategy to distribute solution between master islands
Comm_tcomm splitter strategy

Definition at line 33 of file SamplePilot.h.

Member Typedef Documentation

template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
typedef Jobs_t::iterator SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::JobIter_t
protected

Definition at line 81 of file SamplePilot.h.

template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
typedef std::map<size_t, Param_t > SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::Jobs_t
protected

keep track of requests and running jobs

Definition at line 80 of file SamplePilot.h.

Constructor & Destructor Documentation

template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::SamplePilot ( CmdArguments_t  args,
boost::shared_ptr< Comm_t >  comm,
functionDictionary_t  known_expr_funcs,
const DVarContainer_t dvar,
const Expressions::Named_t obj,
const std::map< std::string, std::shared_ptr< SamplingMethod > > &  sampleMethods,
const std::vector< std::string > &  storeobjstr,
const std::vector< std::string > &  filesToKeep 
)
inline

Definition at line 41 of file SamplePilot.h.

template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
virtual SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::~SamplePilot ( )
inlinevirtual

Definition at line 73 of file SamplePilot.h.

Member Function Documentation

template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
virtual bool SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage ( MPI_Status  status,
size_t  recv_value 
)
inlineprotectedvirtual
template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
virtual void SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::postPoll ( )
inlineprotectedvirtual
template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sampleMethods_m ( sampleMethods  )
inline
template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
virtual void SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker ( int  worker)
inlineprotectedvirtual
template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
virtual void SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::setup ( functionDictionary_t  known_expr_funcs,
const std::vector< std::string > &  storeobjstr,
const std::vector< std::string > &  filesToKeep 
)
inlineprotectedvirtual
template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
virtual void SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startSampler ( )
inlineprotectedvirtual
template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
void SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startWorker ( const std::vector< std::string > &  storeobjstr,
const std::vector< std::string > &  filesToKeep 
)
inlineprotected

Member Data Documentation

template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::false

Definition at line 59 of file SamplePilot.h.

template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
Jobs_t SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::request_queue_
protected
template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
Jobs_t SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::running_job_list_
protected
template<class Opt_t , class Sim_t , class SolPropagationGraph_t , class Comm_t >
std::map< std::string, std::shared_ptr<SamplingMethod> > SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sampleMethods_m
private

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