Communicator definition representation for multi-process communicators.
More...
#include <pearl/MpiComm.h>
The MpiComm class provides a specialized communicator definition representation for multi-process communicators. In addition to the functionality provided by the base class Communicator, the MpiComm class provides access to an MPI communicator handle resembling the communication context used in the target application.
◆ MpiComm() [1/2]
Creates a new instance with the given global identifier id
, communicator name
, associated multi-process communication set commSet
, and a parent
communicator.
- Parameters
-
id | Global communicator identifier |
name | Communicator name |
group | Associated multi-process communication set (MPI group) |
parent | Parent communicator (nullptr for root communicators or when this information is not available) \n@par Exception safety\n <b class="paramname">Strong guarantee:</b> no effects in case an exception is thrown. <br>\n
However, this call may abort if the underlying MPI calls fail (MPI errors are fatal). |
- Exceptions
-
std::bad_alloc | on failure to allocate storage |
◆ ~MpiComm()
virtual pearl::MpiComm::~MpiComm |
( |
| ) |
|
|
virtual |
Destroys the communicator instance.
\n@par Exception safety\n <b class="paramname">No-throw guarantee:</b> never throws exceptions. <br>\n
However, this call may abort if the underlying MPI calls fail
(MPI errors are fatal).
◆ MpiComm() [2/2]
pearl::MpiComm::MpiComm |
( |
const MpiComm & |
comm | ) |
|
|
protected |
Copies the given instance and duplicates the associated MPI communicator handle using MPI_Comm_dup
. It is 'protected' to prevent accidental invocation; users need to call MpiComm::duplicate() explicitly to create a communicator copy.
- Parameters
-
comm | Multi-process communicator definition to duplicate \n@par Exception safety\n <b class="paramname">No-throw guarantee:</b> never throws exceptions. <br>\n
However, this call may abort if the underlying MPI calls fail (MPI errors are fatal). |
◆ duplicate()
MpiComm* pearl::MpiComm::duplicate |
( |
| ) |
const |
Returns a pointer to a copy of the instance (including a copy of the MPI communicator handle).
- Returns
- Copy of the instance
\n@par Exception safety\n <b class="paramname">No-throw guarantee:</b> never throws exceptions. <br>\n
However, this call may abort if the underlying MPI calls fail (MPI errors are fatal).
◆ getHandle()
MPI_Comm pearl::MpiComm::getHandle |
( |
| ) |
const |
Returns the MPI communicator handle associated with this communicator object.
- Returns
- MPI communicator handle
\n@par Exception safety\n <b class="paramname">No-throw guarantee:</b> never throws exceptions. <br>\n
The documentation for this class was generated from the following file: