Sierra Toolkit  Version of the Day
mpih.hpp File Reference
#include <vector>
#include <mpi.h>
#include <stk_util/parallel/Exception.hpp>
#include <MPIH_Include.h>
Include dependency graph for mpih.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 sierra
 

Functions

void sierra::mpih::Enable ()
 Member function Enable initializes exception handling. More...
 
void sierra::mpih::Keyval_delete (MPI_Comm comm)
 
void sierra::mpih::Sub_Communicator (MPI_Comm old_comm, MPI_Comm new_comm)
 Member function Sub_Communicator initialize a new communicator from an old one. This is an unusual call in that the communicators have to be explicitly passed. Normally the default communicator is taken as sierra::Fmwk::Env::comm(). Sub_Communicator is used when Env is reset with a partition of communicators. Each of the new sub communicators need to be initialized from the old one. This avoids having to register all of the exception handlers again. The new communicator will inherit everything from the old and even use the same memory to store flags and such. More...
 
void sierra::mpih::Register_Handles ()
 Member function Register_Handles is called during creation of this singleton. All of the exception subclasses that can be thrown by Fmwk are registered as handles with the MPIH subsystem. More...
 
void sierra::mpih::Add_Handle (const ExParallel &X)
 Member function Add_Handle additional exceptions can be added with Add_Handle. This would be neccessary if an application defined its own exception classes. More...
 
void sierra::mpih::Delete_Handles ()
 Member function Delete_Handles deletes all exception handles. Should only be called in destructor.
 
void sierra::mpih::Bcast (void *buffer, int count, MPI_Datatype datatype, int root)
 
void sierra::mpih::Allreduce (void *in_buffer, void *out_buffer, int count, MPI_Datatype datatype, MPI_Op op)
 
void sierra::mpih::Gather (void *send_buf, int send_size, MPI_Datatype send_datatype, void *recv_buf, int recv_size, MPI_Datatype recv_datatype, int root)
 
void sierra::mpih::Reduce (void *in_buffer, void *out_buffer, int count, MPI_Datatype datatype, MPI_Op op, int root)
 
void sierra::mpih::Reduce_Scatter (void *in_buffer, void *out_buffer, int recv_count, MPI_Datatype datatype, MPI_Op op)
 
void sierra::mpih::Scatter (void *send_buf, int send_size, MPI_Datatype send_datatype, void *recv_buf, int recv_size, MPI_Datatype recv_datatype, int root)
 
void sierra::mpih::Map_Free (MPIH_Map *map)
 
void sierra::mpih::Map_Query (MPIH_Map map, int *symmetric, size_t *nsend, std::vector< int > *sendlist, std::vector< int > *sendlength, std::vector< int > *sendbuflen, size_t *nrecv, std::vector< int > *recvlist, std::vector< int > *recvlength, std::vector< int > *recvbuflen)
 
void sierra::mpih::Sparse (void *sendbuf, MPI_Datatype sendtype, void *recvbuf, MPI_Datatype recvtype, int transpose, MPIH_Map map)
 
void sierra::mpih::Initialize_Sparse (void *sendbuf, MPI_Datatype sendtype, void *recvbuf, MPI_Datatype recvtype, int transpose, MPIH_Map map)
 
void sierra::mpih::Wait_Sparse (MPIH_Map map)
 
void sierra::mpih::Sparse_Map (const std::vector< int > &lengths, const std::vector< int > &buflens, const std::vector< int > &sendlist, MPIH_Map *map)
 
void sierra::mpih::Sparse_Symmetric_Map (const std::vector< int > &lengths, const std::vector< int > &buflens, const std::vector< int > &sendlist, MPIH_Map *map)
 
void sierra::mpih::ParallelExceptionCheck ()
 
void sierra::mpih::Activate_Handles ()
 
void sierra::mpih::Deactivate_Handles ()
 
int sierra::mpih::Get_Nhandles ()
 
void sierra::mpih::Get_Handles (ExParallel **handles)
 
ExParallel * sierra::mpih::Get_Local_Handle ()
 
void sierra::mpih::Set_Local_Handle (ExParallel &handle)
 
void sierra::mpih::Reset_Local_Handle ()
 
void sierra::mpih::Get_Global_Handles (ExParallel **handles)
 
int sierra::mpih::Get_Global_Status ()
 
void sierra::mpih::Set_Status_Check ()
 
void sierra::mpih::Reset_Status_Check ()
 
int sierra::mpih::Get_Status_Check ()
 
void sierra::mpih::Get_Tags (int *active, int *tag_sparse, int *tag_normal, int *tag_message)
 
void sierra::mpih::Get_Functions (MPIH_Handler_compete *handler_compete_fn, MPIH_Handler_execute *handler_execute_fn)
 
int sierra::mpih::Get_Control_Message ()
 
const char * sierra::mpih::get_product_name ()
 
const char * sierra::mpih::get_product_version ()
 
const char * sierra::mpih::get_product_qualifier ()
 
void sierra::mpih::register_product ()
 

Detailed Description

Framework interface to MPIH system.

sierra::mpih provides a C++ interface to the C based MPIH system. It handles all of the explicit exception handling and run time type identification that is not possible in C. Sierra applications should not have to call MPIH directly, but should call sierra::mpih.

Definition in file mpih.hpp.

Function Documentation

◆ Enable()

void sierra::mpih::Enable ( )

Member function Enable initializes exception handling.

Enable() wraps the MPIH_enable fuction call, defaulting all of the parameters. Enable() should be called after MPI_Init and before Register_Handles.

See also
MPIH_Comm_Enable

◆ Sub_Communicator()

void sierra::mpih::Sub_Communicator ( MPI_Comm  old_comm,
MPI_Comm  new_comm 
)

Member function Sub_Communicator initialize a new communicator from an old one. This is an unusual call in that the communicators have to be explicitly passed. Normally the default communicator is taken as sierra::Fmwk::Env::comm(). Sub_Communicator is used when Env is reset with a partition of communicators. Each of the new sub communicators need to be initialized from the old one. This avoids having to register all of the exception handlers again. The new communicator will inherit everything from the old and even use the same memory to store flags and such.

Parameters
old_comma MPI_Comm value of the old MPI communicator.
new_comma MPI_Comm value of the new MPI communicator.

◆ Register_Handles()

void sierra::mpih::Register_Handles ( )

Member function Register_Handles is called during creation of this singleton. All of the exception subclasses that can be thrown by Fmwk are registered as handles with the MPIH subsystem.

See also
Register_Handles

◆ Add_Handle()

void sierra::mpih::Add_Handle ( const ExParallel X)

Member function Add_Handle additional exceptions can be added with Add_Handle. This would be neccessary if an application defined its own exception classes.

See also
MPIH_Comm_add_handle
Parameters
Xan ExParallel reference to the exception singleton to add to the registered exceptions list.

◆ Bcast()

void sierra::mpih::Bcast ( void *  buffer,
int  count,
MPI_Datatype  datatype,
int  root 
)

Collective Communication routine. Bcast, Allreduce, ... are the standard collective communication calls. These are simple wrappers that default the communicator to sierra::Env::mpi::comm() and check for error return codes. All of these functions sierra::Env::abort() on error, so there is no return code to check. If an exception has been thrown, that is automatically handled also.

See also
MPIH_Allreduce MPIH_Bcast MPIH_Gather MPIH_Reduce MPIH_Reduce_scatter MPIH_Scatter