Lunchbox  1.13.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
lunchbox::MPI Class Reference

MPI functionality wrapper. More...

#include <mpi.h>

+ Collaboration diagram for lunchbox::MPI:

Public Member Functions

 MPI (int argc, char **argv)
 Construct an MPI handler with command line arguments. More...
 
 MPI ()
 Construct a new MPI handler. More...
 
 ~MPI ()
 Destruct this handler instance. More...
 
bool supportsThreads () const
 
int getRank () const
 
int getSize () const
 

Detailed Description

MPI functionality wrapper.

Definition at line 30 of file mpi.h.

Constructor & Destructor Documentation

lunchbox::MPI::MPI ( int  argc,
char **  argv 
)

Construct an MPI handler with command line arguments.

Calls MPI_Init_thread requesting MPI_THREAD_MULTIPLE, unless MPI is already initialized. Will initialize the thread support to false depending on the obtained thread support. Will signal not to support threads if MPI was initialized externally.

NOTE: Be aware that MPI_THREAD_MULTIPLE is only lightly tested and likely still has some bugs. Please, refer the below links: https://www.open-mpi.org/faq/?category=supported-systems#thread-support https://www.open-mpi.org/doc/v1.4/man3/MPI_Init_thread.3.php

Version
1.1.1
lunchbox::MPI::MPI ( )

Construct a new MPI handler.

See argc, argv ctor for details.

Version
1.1.1
lunchbox::MPI::~MPI ( )

Destruct this handler instance.

Calls MPI_Finalize if it is the last copy of an instance which has initialized MPI.

Version
1.1.1

Member Function Documentation

int lunchbox::MPI::getRank ( ) const
Returns
the rank of the process that calls it
Version
1.1.1
int lunchbox::MPI::getSize ( ) const
Returns
the number of processes involved
Version
1.1.1

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