Pakman
Manager Class Reference

#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 ()
 

Detailed Description

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().

Definition at line 31 of file Manager.h.

Member Enumeration Documentation

◆ worker_t

Enumerate type for Worker types.

Definition at line 36 of file Manager.h.

Constructor & Destructor Documentation

◆ Manager()

Manager::Manager ( const Command simulator,
worker_t  worker_type,
bool *  p_program_terminated 
)

Constructor.

Parameters
simulatorcommand to run simulation.
worker_typetype of Worker
p_program_terminatedpointer 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::~Manager ( )

Default destructor destroys MPI_Request objects.

Definition at line 30 of file Manager.cc.

Member Function Documentation

◆ isActive()

bool Manager::isActive ( ) const
Returns
whether the Manager is active.

Definition at line 49 of file Manager.cc.

◆ iterate()

void Manager::iterate ( )

Iterates the Manager in an event loop.

Definition at line 55 of file Manager.cc.


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