|
Pakman
|
#include <MPIMaster.h>


Public Member Functions | |
| MPIMaster (bool *p_program_terminated) | |
| virtual | ~MPIMaster () override |
| virtual bool | isActive () const override |
| virtual bool | needMorePendingTasks () const override |
| virtual void | pushPendingTask (const std::string &input_string) override |
| virtual bool | finishedTasksEmpty () const override |
| virtual TaskHandler & | frontFinishedTask () override |
| virtual void | popFinishedTask () override |
| virtual void | flush () override |
| virtual void | terminate () override |
Public Member Functions inherited from AbstractMaster | |
| AbstractMaster (bool *p_program_terminated) | |
| virtual | ~AbstractMaster ()=default |
Static Public Member Functions | |
| static std::string | help () |
| static void | addLongOptions (LongOptions &lopts) |
| static void | run (controller_t controller, const Arguments &args) |
| static void | cleanup () |
Static Public Member Functions inherited from AbstractMaster | |
| static master_t | getMaster (const std::string &arg) |
| static std::string | help (master_t master) |
| static void | addLongOptions (master_t master, LongOptions &lopts) |
| static void | run (master_t master, controller_t controller, const Arguments &args) |
| static void | cleanup (master_t master) |
Protected Member Functions | |
| virtual void | iterate () override |
Protected Member Functions inherited from AbstractMaster | |
| void | assignController (std::shared_ptr< AbstractController > p_controller) |
| bool | programTerminated () const |
Additional Inherited Members | |
Protected Attributes inherited from AbstractMaster | |
| std::weak_ptr< AbstractController > | m_p_controller |
A Master class for performing simulation tasks in parallel using MPI.
The MPIMaster class performs simulation tasks in parallel using MPI by delegating simulation tasks to a pool of Managers (as implemented by the Manager class). These Managers then perform simulation tasks by spawning child processes with fork()–exec() to run simulation.
For instructions on how to use Pakman with the MPI master, execute the following command
Definition at line 38 of file MPIMaster.h.
| MPIMaster::MPIMaster | ( | bool * | p_program_terminated | ) |
Constructor saves program termination flag.
| p_program_terminated | pointer to boolean flag that is set when the execution of Pakman is terminated by the user. |
Definition at line 19 of file MPIMaster.cc.
|
overridevirtual |
Default destructor does nothing.
Definition at line 36 of file MPIMaster.cc.
|
static |
Add long command-line options.
| lopts | long command-line options that the MPIMaster needs. |
Definition at line 93 of file MPIMasterStatic.cc.
|
static |
Terminate all Managers, as well as the MPIWorker associated with rank 0, and terminate MPI.
This function is used when an exception occurs in run() and MPI processes need to be cleaned up appropriately so that the program does not hang after an exception.
Definition at line 226 of file MPIMasterStatic.cc.
|
overridevirtual |
Implements AbstractMaster.
Definition at line 207 of file MPIMaster.cc.
|
overridevirtual |
Flush all finished, busy and pending tasks.
Implements AbstractMaster.
Definition at line 225 of file MPIMaster.cc.
|
overridevirtual |
Implements AbstractMaster.
Definition at line 213 of file MPIMaster.cc.
|
static |
Definition at line 29 of file MPIMasterStatic.cc.
|
overridevirtual |
Implements AbstractMaster.
Definition at line 56 of file MPIMaster.cc.
|
overrideprotectedvirtual |
Iterates the MPIMaster in an event loop.
Implements AbstractMaster.
Definition at line 62 of file MPIMaster.cc.
|
overridevirtual |
Implements AbstractMaster.
Definition at line 91 of file MPIMaster.cc.
|
overridevirtual |
|
overridevirtual |
Push a new pending task.
| input_string | input string to simulation job. |
Implements AbstractMaster.
Definition at line 201 of file MPIMaster.cc.
|
static |
Run MPIMaster in an event loop.
This function creates the MPIMaster and Controller objects, and runs them in an event loop.
| controller | controller type. |
| args | command-line arguments. |
Definition at line 103 of file MPIMasterStatic.cc.
|
overridevirtual |