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 262 of file Moose.h.

Constructor & Destructor Documentation

◆ ScopedCommSwapper()

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 267 of file Moose.h.

267 : _orig(swapLibMeshComm(new_comm)) {}
MPI_Comm swapLibMeshComm(MPI_Comm new_comm)
Swap the libMesh MPI communicator out for ours.
Definition: Moose.C:615

◆ ~ScopedCommSwapper()

virtual Moose::ScopedCommSwapper::~ScopedCommSwapper ( )
inlinevirtual

Definition at line 268 of file Moose.h.

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

Member Function Documentation

◆ forceSwap()

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 273 of file Moose.h.

Referenced by MultiAppUserObjectTransfer::execute().

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

Member Data Documentation

◆ _orig

MPI_Comm Moose::ScopedCommSwapper::_orig
private

Definition at line 276 of file Moose.h.


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