Lunchbox  1.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lunchbox::MPI Class Reference

MPI functionality wrapper. More...

#include <mpi.h>

+ Collaboration diagram for lunchbox::MPI:

Public Member Functions

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

Detailed Description

MPI functionality wrapper.

Definition at line 30 of file mpi.h.

Constructor & Destructor Documentation

LUNCHBOX_API 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. Initialized 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_API lunchbox::MPI::MPI ( )

Construct a new MPI handler.

See argc, argv ctor for details.

Version
1.1.1
LUNCHBOX_API 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

LUNCHBOX_API int lunchbox::MPI::getRank ( ) const
Returns
the rank of the process that calls it
Version
1.1.1
LUNCHBOX_API 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: