|
Pakman
|
#include <Manager.h>
Public Types | |
| enum | worker_t { forked_worker, mpi_worker } |
Public Member Functions | |
| Manager (const Command &simulator, worker_t worker_type, bool *p_program_terminated) | |
| ~Manager () | |
| bool | isActive () const |
| void | iterate () |
A helper class for performing simulation tasks in parallel using MPI.
The role of Managers is to accept simulation tasks from the MPIMaster, spawn child processes (also called Workers) to perform the simulation, and report the results back to MPIMaster.
The Workers can be either a forked Worker or an MPI Worker. These are represented by the ForkedWorkerHandler and MPIWorkerHandler classes, respectively (both are derived form the AbstractWorkerHandler class). The MPI Worker is necessary when the simulator uses MPI. See MPIMaster for more details.
As with the MPIMaster, Managers are meant to be run in an event loop. Therefore, the event loop in MPIMaster::run() will call Manager::iterate().
| enum Manager::worker_t |
Constructor.
| simulator | command to run simulation. |
| worker_type | type of Worker |
| p_program_terminated | pointer to boolean flag that is set when the execution of Pakman is terminated by the user. |
Definition at line 21 of file Manager.cc.
| Manager::~Manager | ( | ) |
Default destructor destroys MPI_Request objects.
Definition at line 30 of file Manager.cc.
| bool Manager::isActive | ( | ) | const |
Definition at line 49 of file Manager.cc.
| void Manager::iterate | ( | ) |
Iterates the Manager in an event loop.
Definition at line 55 of file Manager.cc.