www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
SerializerGuard Class Reference

A scope guard that guarantees that whatever happens between when it gets created and when it is destroyed is done "serially" (each MPI rank will run in turn starting from 0) More...

#include <SerializerGuard.h>

Public Member Functions

 SerializerGuard (const libMesh::Parallel::Communicator &comm, bool warn=true)
 
 ~SerializerGuard ()
 

Protected Attributes

const libMesh::Parallel::Communicator & _comm
 
bool _warn
 

Detailed Description

A scope guard that guarantees that whatever happens between when it gets created and when it is destroyed is done "serially" (each MPI rank will run in turn starting from 0)

Definition at line 25 of file SerializerGuard.h.

Constructor & Destructor Documentation

◆ SerializerGuard()

SerializerGuard::SerializerGuard ( const libMesh::Parallel::Communicator &  comm,
bool  warn = true 
)

Definition at line 16 of file SerializerGuard.C.

17  : _comm(comm), _warn(warn)
18 {
20 }
void serialBegin(const libMesh::Parallel::Communicator &comm, bool warn=true)
This function marks the begin of a section of code that is executed in serial rank by rank...
Definition: MooseUtils.C:223
const libMesh::Parallel::Communicator & _comm
MPI_Comm comm

◆ ~SerializerGuard()

SerializerGuard::~SerializerGuard ( )

Definition at line 22 of file SerializerGuard.C.

void serialEnd(const libMesh::Parallel::Communicator &comm, bool warn=true)
Closes a section of code that is executed in serial rank by rank, and that was opened with a call to ...
Definition: MooseUtils.C:237
const libMesh::Parallel::Communicator & _comm

Member Data Documentation

◆ _comm

const libMesh::Parallel::Communicator& SerializerGuard::_comm
protected

Definition at line 32 of file SerializerGuard.h.

Referenced by SerializerGuard(), and ~SerializerGuard().

◆ _warn

bool SerializerGuard::_warn
protected

Definition at line 33 of file SerializerGuard.h.

Referenced by SerializerGuard(), and ~SerializerGuard().


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