www.mooseframework.org
Public Member Functions | Private Attributes | List of all members
Moose::ScopedCommSwapper Class Reference

#include <Moose.h>

Public Member Functions

 ScopedCommSwapper (MPI_Comm new_comm)
 Swaps the current libmesh MPI communicator for new_comm. More...
 
virtual ~ScopedCommSwapper ()
 
void forceSwap ()
 Forcibly swap the currently swapped-out communicator back in to libmesh. More...
 

Private Attributes

MPI_Comm _orig
 

Detailed Description

Definition at line 155 of file Moose.h.

Constructor & Destructor Documentation

Moose::ScopedCommSwapper::ScopedCommSwapper ( MPI_Comm  new_comm)
inline

Swaps the current libmesh MPI communicator for new_comm.

new_comm will be automatically swapped back in as the current libmesh communicator when this object is destructed.

Definition at line 160 of file Moose.h.

160 : _orig(swapLibMeshComm(new_comm)) {}
MPI_Comm swapLibMeshComm(MPI_Comm new_comm)
Swap the libMesh MPI communicator out for ours.
Definition: Moose.C:1242
virtual Moose::ScopedCommSwapper::~ScopedCommSwapper ( )
inlinevirtual

Definition at line 161 of file Moose.h.

MPI_Comm swapLibMeshComm(MPI_Comm new_comm)
Swap the libMesh MPI communicator out for ours.
Definition: Moose.C:1242

Member Function Documentation

void Moose::ScopedCommSwapper::forceSwap ( )
inline

Forcibly swap the currently swapped-out communicator back in to libmesh.

Calling this function twice in a row leaves communicators exactly as they were before this function was called. Usually you should not need/use this function because MPI communicators are swapped automatically when this object is constructed/destructed.

Definition at line 166 of file Moose.h.

MPI_Comm swapLibMeshComm(MPI_Comm new_comm)
Swap the libMesh MPI communicator out for ours.
Definition: Moose.C:1242

Member Data Documentation

MPI_Comm Moose::ScopedCommSwapper::_orig
private

Definition at line 168 of file Moose.h.


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