SpinParser  1.0
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Typedefs | Functions
LoadManager.hpp File Reference

Implementation of an automatic hybrid OpenMP / MPI load balancer. More...

#include <vector>
#include <functional>
#include <thread>
#include <mutex>
#include <boost/date_time.hpp>
#include "lib/Log.hpp"
#include "lib/Exception.hpp"
#include "mpi.h"
#include "omp.h"
Include dependency graph for LoadManager.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  HMP::LoadManager
 Common load manager interface for both, the MPI server rank and slave ranks. More...
 
struct  HMP::LoadManager::DataStackBase
 Abstract base class for DataStack types. More...
 
struct  HMP::LoadManager::DataStack< StackT >
 Concrete derivation of DataStackBase, managing an array of fundamental data types (or tuples thereof, if DataStackBase::typeMultiplicity is greater than one). More...
 
struct  HMP::LoadManager::Chunk
 Definition of a small chunk of work. Used to communicate workload between different LoadManager instances. More...
 
class  HMP::LoadManagerMaster
 LoadManager master implementation, which is responsible for distributing work and synchronizing data. More...
 
class  HMP::LoadManagerSlave
 LoadManager slave implementation, responsible for receiving and executing workload chunks form a LoadManagerMaster implementation. More...
 

Macros

#define HMP_CHUNK_PROPERTY_STACK   0
 Memory offset of the stack id in the chunk properties.
 
#define HMP_CHUNK_PROPERTY_BEGIN   1
 Memory offset of the workload begin in the chunk properties.
 
#define HMP_CHUNK_PROPERTY_END   2
 Memory offset of the workload end in the chunk properties.
 
#define HMP_MPI_ENABLED
 Defined, if MPI parallelization is enabled.
 
#define HMP_ENABLE_IF_MPI(X)   X
 Print argument if MPI parallelization is enabled.
 
#define HMP_DISABLE_IF_MPI(X)
 Do not print argument if MPI parallelization is enabled.
 
#define HMP_APPEND_IF_MPI(X)   ,X
 Append argument if MPI parallelizatino is enabled.
 

Typedefs

typedef int HMP::StackIdentifier
 DataStack identifier.
 

Functions

LoadManager * HMP::newLoadManager (const int serverRank=0, const MPI_Comm communicator=MPI_COMM_WORLD)
 Create a new LoadManager instance. If the current MPI rank is the designated master rank, returns a LoadManagerMaster instance, otherwise returns a LoadManagerSlave instance. More...
 

Detailed Description

Implementation of an automatic hybrid OpenMP / MPI load balancer.

Author
Finn Lasse Buessen

Function Documentation

◆ newLoadManager()

LoadManager* HMP::newLoadManager ( const int  serverRank = 0,
const MPI_Comm  communicator = MPI_COMM_WORLD 
)
inline

Create a new LoadManager instance. If the current MPI rank is the designated master rank, returns a LoadManagerMaster instance, otherwise returns a LoadManagerSlave instance.

Parameters
serverRankMPI rank to assume the master role.
communicatorThe MPI communicator to operate on.
Returns
LoadManager* Newly generated LoadManager instance.