walberla::mpi::Tokenizing Class Reference

Detailed Description

MPI tokenizing ensures that not more than N processes execute the same code portion simultaneously.

Usage:

mpi::Tokenizing tokenizing ( 10 );
tokenizing.pre();
criticalFunction(); // maximal 10 processes execute that function simultaneously
tokenizing.post()

#include <Tokenizing.h>

Public Member Functions

 Tokenizing (uint_t nrOfTokens, MPI_Comm comm=MPI_COMM_WORLD)
 
void pre () const
 
void post () const
 

Protected Attributes

uint_t nrOfTokens_
 
MPI_Comm communicator_
 

Static Protected Attributes

static const int mpiTag = 513
 

Constructor & Destructor Documentation

◆ Tokenizing()

walberla::mpi::Tokenizing::Tokenizing ( uint_t  nrOfTokens,
MPI_Comm  comm = MPI_COMM_WORLD 
)

Member Function Documentation

◆ post()

void walberla::mpi::Tokenizing::post ( ) const

◆ pre()

void walberla::mpi::Tokenizing::pre ( ) const

Member Data Documentation

◆ communicator_

MPI_Comm walberla::mpi::Tokenizing::communicator_
protected

◆ mpiTag

const int walberla::mpi::Tokenizing::mpiTag = 513
staticprotected

◆ nrOfTokens_

uint_t walberla::mpi::Tokenizing::nrOfTokens_
protected

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