|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
#include <SamplePilot.h>
Public Member Functions | |
| SamplePilot (CmdArguments_t args, std::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, const std::map< std::string, std::string > &userVariables) | |
| virtual | ~SamplePilot () |
Protected Types | |
| typedef std::map< size_t, Param_t > | Jobs_t |
| keep track of requests and running jobs | |
| typedef Jobs_t::iterator | JobIter_t |
| typedef MasterNode< typename Opt_t::SolutionState_t, SolPropagationGraph_t > | MasterNode_t |
Protected Member Functions | |
| virtual void | setup (functionDictionary_t known_expr_funcs, const std::vector< std::string > &storeobjstr, const std::vector< std::string > &filesToKeep, const std::map< std::string, std::string > &userVariables) |
| virtual void | startSampler () |
| void | startWorker (const std::vector< std::string > &storeobjstr, const std::vector< std::string > &filesToKeep, const std::map< std::string, std::string > &userVariables) |
| virtual void | postPoll () |
| executed after handling (if any) new request | |
| virtual void | sendNewJobToWorker (int worker) |
| virtual bool | onMessage (MPI_Status status, size_t recv_value) |
| void | parseInputFile (functionDictionary_t, bool isOptimizationRun) |
| virtual void | startOptimizer () |
| virtual void | startWorker (const std::map< std::string, std::string > &userVariables) |
| virtual void | startPilot () |
| virtual void | setupPoll () |
| executed before starting polling loop | |
| virtual void | prePoll () |
| executed before checking for new request | |
| virtual void | onStop () |
| enable implementation to react to STOP tag | |
| bool | stop (bool isOpt=true) |
| void | run () |
Protected Attributes | |
| Jobs_t | running_job_list_ |
| Jobs_t | request_queue_ |
| MPI_Comm | worker_comm_ |
| MPI communicator used for messages to/from worker. | |
| MPI_Comm | opt_comm_ |
| MPI communicator used for messages to/from optimizer. | |
| MPI_Comm | coworker_comm_ |
| MPI communicator used for messages between all pilots. | |
| std::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_ |
| std::unique_ptr< MasterNode_t > | master_node_ |
| std::string | input_file_ |
| input file for simulation with embedded optimization problem | |
| int | total_available_workers_ |
| bool | has_opt_converged_ |
| bool | continue_polling_ |
| Expressions::Named_t | objectives_ |
| objectives | |
| Expressions::Named_t | constraints_ |
| constraints | |
| DVarContainer_t | dvars_ |
| design variables | |
| std::vector< double > | hypervolRef_ |
| hypervolume reference point | |
| std::vector< bool > | is_worker_idle_ |
| std::unique_ptr< Trace > | job_trace_ |
| 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 | |
| std::map< std::string, std::shared_ptr< SamplingMethod > > | sampleMethods_m |
Definition at line 46 of file SamplePilot.h.
|
protected |
Definition at line 96 of file SamplePilot.h.
|
protected |
keep track of requests and running jobs
Definition at line 95 of file SamplePilot.h.
|
protectedinherited |
|
inline |
Definition at line 54 of file SamplePilot.h.
References Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::Pilot().
|
inlinevirtual |
Definition at line 88 of file SamplePilot.h.
|
inlineprotectedvirtual |
User specific behavior on receiving a message.
Reimplemented from Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >.
Definition at line 220 of file SamplePilot.h.
References Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::comm_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::has_opt_converged_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::is_worker_idle_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::job_trace_, MPI_OPT_JOB_FINISHED_TAG, MPI_Recv_params(), MPI_Recv_reqvars(), MPI_Send_reqvars(), MPI_WORKER_FINISHED_ACK_TAG, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::opt_comm_, OPT_CONVERGED_TAG, OPT_NEW_JOB_TAG, request_queue_, running_job_list_, sendNewJobToWorker(), Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::stop(), WORKER_FINISHED_TAG, and WORKER_STATUSUPDATE_TAG.
|
inlineprotectedvirtualinherited |
|
inlineprotectedinherited |
Definition at line 234 of file Pilot.h.
References cmd_args_, Poller::comm_m, constraints_, dvars_, global_rank_, input_file_, and objectives_.
Referenced by setup(), and SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::setup().
|
inlineprotectedvirtual |
executed after handling (if any) new request
Reimplemented from Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >.
Definition at line 161 of file SamplePilot.h.
References Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::continue_polling_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::has_opt_converged_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::is_worker_idle_, MPI_STOP_TAG, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::my_rank_in_worker_comm_, request_queue_, sendNewJobToWorker(), Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::total_available_workers_, and Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::worker_comm_.
|
inlineprotectedvirtualinherited |
|
inlineprotectedvirtualinherited |
The poll loop stops when receiving a 'MPI_STOP_TAG' otherwise passes message to user.
Reimplemented from Poller.
Definition at line 602 of file Pilot.h.
References cmd_args_, continue_polling_, coworker_comm_, MPI_STOP_TAG, onMessage(), opt_comm_, OPT_CONVERGED_TAG, postPoll(), prePoll(), setupPoll(), stop(), and worker_comm_.
Referenced by startPilot().
|
inlineprotectedvirtual |
Reimplemented from Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >.
Definition at line 194 of file SamplePilot.h.
References Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::has_opt_converged_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::is_worker_idle_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::job_trace_, MPI_Send_params(), MPI_WORK_JOBID_TAG, request_queue_, running_job_list_, and Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::worker_comm_.
Referenced by onMessage(), and postPoll().
|
inlineprotectedvirtual |
Definition at line 102 of file SamplePilot.h.
References Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::comm_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::global_rank_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::parseInputFile(), Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startPilot(), startSampler(), and startWorker().
|
inlineprotectedvirtualinherited |
|
inlineprotectedvirtualinherited |
Definition at line 269 of file Pilot.h.
References cmd_args_, comm_, constraints_, dvars_, global_rank_, hypervolRef_, and objectives_.
Referenced by setup().
|
inlineprotectedvirtualinherited |
Definition at line 307 of file Pilot.h.
References cmd_args_, comm_, constraints_, continue_polling_, coworker_comm_, global_rank_, has_opt_converged_, is_worker_idle_, job_trace_, master_node_, my_rank_in_opt_comm_, my_rank_in_worker_comm_, num_coworkers_, objectives_, opt_comm_, run(), total_available_workers_, and worker_comm_.
Referenced by setup(), and SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::setup().
|
inlineprotectedvirtual |
Definition at line 120 of file SamplePilot.h.
References Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::comm_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::dvars_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::global_rank_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::objectives_, and sampleMethods_m.
Referenced by setup().
|
inlineprotectedvirtualinherited |
Definition at line 285 of file Pilot.h.
References cmd_args_, comm_, constraints_, global_rank_, input_file_, and objectives_.
Referenced by setup().
|
inlineprotected |
Definition at line 136 of file SamplePilot.h.
References Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::comm_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::constraints_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::global_rank_, Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::input_file_, and Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::objectives_.
Referenced by setup().
|
inlineprotectedinherited |
Definition at line 569 of file Pilot.h.
References cmd_args_, comm_, coworker_comm_, has_opt_converged_, MPI_STOP_TAG, num_coworkers_, opt_comm_, OPT_CONVERGED_TAG, and request_queue_.
Referenced by onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), and run().
|
protectedinherited |
Definition at line 164 of file Pilot.h.
Referenced by parseInputFile(), Pilot(), Pilot(), run(), startOptimizer(), startPilot(), startWorker(), and stop().
|
protectedinherited |
Definition at line 163 of file Pilot.h.
Referenced by onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), Pilot(), Pilot(), setup(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::setup(), startOptimizer(), startPilot(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startSampler(), startWorker(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startWorker(), and stop().
|
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 |
constraints
Definition at line 184 of file Pilot.h.
Referenced by parseInputFile(), startOptimizer(), startPilot(), startWorker(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startWorker(), and ~Pilot().
|
protectedinherited |
Definition at line 181 of file Pilot.h.
Referenced by postPoll(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::postPoll(), run(), and startPilot().
|
protectedinherited |
MPI communicator used for messages between all pilots.
Definition at line 161 of file Pilot.h.
Referenced by run(), startPilot(), and stop().
|
protectedinherited |
design variables
Definition at line 185 of file Pilot.h.
Referenced by parseInputFile(), Pilot(), startOptimizer(), and SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startSampler().
|
protectedinherited |
Definition at line 166 of file Pilot.h.
Referenced by parseInputFile(), setup(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::setup(), startOptimizer(), startPilot(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startSampler(), startWorker(), and SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startWorker().
|
protectedinherited |
Definition at line 180 of file Pilot.h.
Referenced by onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), postPoll(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::postPoll(), sendNewJobToWorker(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker(), startPilot(), and stop().
|
protectedinherited |
|
protectedinherited |
input file for simulation with embedded optimization problem
Definition at line 177 of file Pilot.h.
Referenced by parseInputFile(), startWorker(), and SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startWorker().
|
protectedinherited |
Definition at line 54 of file Poller.h.
Referenced by Poller(), run(), Worker< Sim_t >::runCoWorker(), and SampleWorker< Sim_t >::runSlave().
|
protectedinherited |
Definition at line 190 of file Pilot.h.
Referenced by onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), postPoll(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::postPoll(), sendNewJobToWorker(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker(), and startPilot().
|
protectedinherited |
Definition at line 199 of file Pilot.h.
Referenced by onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), sendNewJobToWorker(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker(), and startPilot().
|
protectedinherited |
|
protectedinherited |
Definition at line 174 of file Pilot.h.
Referenced by onMessage(), and startPilot().
|
protectedinherited |
Definition at line 168 of file Pilot.h.
Referenced by startPilot().
|
protectedinherited |
Definition at line 167 of file Pilot.h.
Referenced by postPoll(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::postPoll(), and startPilot().
|
protectedinherited |
Definition at line 170 of file Pilot.h.
Referenced by onMessage(), startPilot(), and stop().
|
protectedinherited |
objectives
Definition at line 183 of file Pilot.h.
Referenced by parseInputFile(), startOptimizer(), startPilot(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startSampler(), startWorker(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::startWorker(), and ~Pilot().
|
protectedinherited |
MPI communicator used for messages to/from optimizer.
Definition at line 159 of file Pilot.h.
Referenced by onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), run(), startPilot(), and stop().
|
protectedinherited |
|
protected |
Definition at line 98 of file SamplePilot.h.
Referenced by onMessage(), postPoll(), and sendNewJobToWorker().
|
protected |
Definition at line 97 of file SamplePilot.h.
Referenced by onMessage(), and sendNewJobToWorker().
|
private |
Definition at line 299 of file SamplePilot.h.
Referenced by startSampler().
|
protectedinherited |
Definition at line 179 of file Pilot.h.
Referenced by postPoll(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::postPoll(), and startPilot().
|
protectedinherited |
MPI communicator used for messages to/from worker.
Definition at line 157 of file Pilot.h.
Referenced by onMessage(), postPoll(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::postPoll(), run(), sendNewJobToWorker(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker(), and startPilot().