Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Private Attributes | List of all members
Utilities::MPI::DuplicatedCommunicator Class Reference

#include <deal.II/base/mpi.h>

Public Member Functions

 DuplicatedCommunicator (const MPI_Comm &communicator)
 
 DuplicatedCommunicator (const DuplicatedCommunicator &)=delete
 
 ~DuplicatedCommunicator ()
 
const MPI_Commoperator* () const
 
DuplicatedCommunicatoroperator= (const DuplicatedCommunicator &)=delete
 

Private Attributes

MPI_Comm comm
 

Detailed Description

Helper class to automatically duplicate and free an MPI communicator.

This class duplicates the communicator given in the constructor using duplicate_communicator() and frees it automatically when this object gets destroyed by calling free_communicator(). You can access the wrapped communicator using operator*.

This class exists to easily allow duplicating communicators without having to worry when and how to free it after usage.

Definition at line 248 of file mpi.h.

Constructor & Destructor Documentation

◆ DuplicatedCommunicator() [1/2]

Utilities::MPI::DuplicatedCommunicator::DuplicatedCommunicator ( const MPI_Comm communicator)
inlineexplicit

Create a duplicate of the given communicator.

Definition at line 254 of file mpi.h.

◆ DuplicatedCommunicator() [2/2]

Utilities::MPI::DuplicatedCommunicator::DuplicatedCommunicator ( const DuplicatedCommunicator )
delete

Do not allow making copies.

◆ ~DuplicatedCommunicator()

Utilities::MPI::DuplicatedCommunicator::~DuplicatedCommunicator ( )
inline

The destructor will free the communicator automatically.

Definition at line 266 of file mpi.h.

Member Function Documentation

◆ operator*()

const MPI_Comm& Utilities::MPI::DuplicatedCommunicator::operator* ( ) const
inline

Access the stored communicator.

Definition at line 274 of file mpi.h.

◆ operator=()

DuplicatedCommunicator& Utilities::MPI::DuplicatedCommunicator::operator= ( const DuplicatedCommunicator )
delete

Do not allow assignment of this class.

Member Data Documentation

◆ comm

MPI_Comm Utilities::MPI::DuplicatedCommunicator::comm
private

The communicator of course.

Definition at line 290 of file mpi.h.


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