Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
oomph::MPI_Helpers Class Reference

MPI_Helpers class contains static helper methods to support MPI within oomph-lib. The methods init(...) and finalize() initialize and finalize MPI in oomph-lib and manage the oomph-libs global communicator communicator_pt(). NOTE: This class encapsulates static helper methods and instances of it CANNOT be instantiated. More...

#include <oomph_utilities.h>

Static Public Member Functions

static void init (int argc, char **argv, const bool &make_duplicate_of_mpi_comm_world=true)
 initialise mpi (oomph-libs equivalent of MPI_Init(...)) Initialises MPI and creates the global oomph-lib communicator. If optional boolean flag is set to false, we use MPI_COMM_WORLD itself as oomph-lib's communicator. Defaults to true. More...
 
static void finalize ()
 finalize mpi (oomph-lib equivalent of MPI_Finalize()) Deletes the global oomph-lib communicator and finalizes MPI. More...
 
static OomphCommunicatorcommunicator_pt ()
 access to global communicator. This is the oomph-lib equivalent of MPI_COMM_WORLD More...
 
static bool mpi_has_been_initialised ()
 return true if MPI has been initialised More...
 

Private Member Functions

 MPI_Helpers ()
 private default constructor definition (to prevent instances of the class being instantiated) More...
 
 MPI_Helpers (const MPI_Helpers &)
 private copy constructor definition (to prevent instances of the class being instantiated) More...
 

Static Private Attributes

static bool MPI_has_been_initialised = false
 Bool set to true if MPI has been initialised. More...
 
static OomphCommunicatorCommunicator_pt = 0
 the global communicator More...
 

Detailed Description

MPI_Helpers class contains static helper methods to support MPI within oomph-lib. The methods init(...) and finalize() initialize and finalize MPI in oomph-lib and manage the oomph-libs global communicator communicator_pt(). NOTE: This class encapsulates static helper methods and instances of it CANNOT be instantiated.

Definition at line 831 of file oomph_utilities.h.

Constructor & Destructor Documentation

◆ MPI_Helpers() [1/2]

oomph::MPI_Helpers::MPI_Helpers ( )
private

private default constructor definition (to prevent instances of the class being instantiated)

◆ MPI_Helpers() [2/2]

oomph::MPI_Helpers::MPI_Helpers ( const MPI_Helpers )
private

private copy constructor definition (to prevent instances of the class being instantiated)

Member Function Documentation

◆ communicator_pt()

OomphCommunicator * oomph::MPI_Helpers::communicator_pt ( )
static

◆ finalize()

void oomph::MPI_Helpers::finalize ( )
static

finalize mpi (oomph-lib equivalent of MPI_Finalize()) Deletes the global oomph-lib communicator and finalizes MPI.

finalize mpi

Definition at line 1032 of file oomph_utilities.cc.

References Communicator_pt.

Referenced by oomph::CommandLineArgs::parse_and_assign().

◆ init()

void oomph::MPI_Helpers::init ( int  argc,
char **  argv,
const bool &  make_duplicate_of_mpi_comm_world = true 
)
static

initialise mpi (oomph-libs equivalent of MPI_Init(...)) Initialises MPI and creates the global oomph-lib communicator. If optional boolean flag is set to false, we use MPI_COMM_WORLD itself as oomph-lib's communicator. Defaults to true.

Initialize mpi. If optional boolean flag is set to false, we use MPI_COMM_WORLD itself as oomph-lib's communicator. Defaults to true.

Definition at line 983 of file oomph_utilities.cc.

References oomph::MPIOutputModifier::communicator_pt(), Communicator_pt, MPI_has_been_initialised, oomph::oomph_info, oomph::oomph_mpi_output, and oomph::OomphInfo::output_modifier_pt().

◆ mpi_has_been_initialised()

static bool oomph::MPI_Helpers::mpi_has_been_initialised ( )
inlinestatic

Member Data Documentation

◆ Communicator_pt

OomphCommunicator * oomph::MPI_Helpers::Communicator_pt = 0
staticprivate

the global communicator

Definition at line 869 of file oomph_utilities.h.

Referenced by communicator_pt(), finalize(), and init().

◆ MPI_has_been_initialised

bool oomph::MPI_Helpers::MPI_has_been_initialised = false
staticprivate

Bool set to true if MPI has been initialised.

Definition at line 866 of file oomph_utilities.h.

Referenced by communicator_pt(), and init().


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