AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::sidre::IOBaton Class Reference

IOBaton ensures that during I/O operations, only one rank will interact with a particular file at one time. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/sidre/spio/IOBaton.hpp>

Public Member Functions

 IOBaton (MPI_Comm com, int num_files, int num_groups)
 Constructor. More...
 
 ~IOBaton ()
 Destructor. More...
 
int wait ()
 Wait for previous rank to pass control to the local rank. More...
 
int pass ()
 Pass control to the next rank. More...
 
int setSize () const
 Size of local rank's set. More...
 
bool isFirstInGroup () const
 Tells if the local rank is the first (lowest) in its set. More...
 
bool isLastInGroup () const
 Tells if the local rank is the last (highest) in its set. More...
 
int getNumFiles () const
 Get the number of files involved in the I/O operation. More...
 

Detailed Description

IOBaton ensures that during I/O operations, only one rank will interact with a particular file at one time.

Each rank is placed into a set of ranks, with the number of sets being equal to the number of I/O files, and then the ranks use the wait and pass methods to pass control of I/O operations from one rank to the next within the set.

Constructor & Destructor Documentation

◆ IOBaton()

axom::sidre::IOBaton::IOBaton ( MPI_Comm  com,
int  num_files,
int  num_groups 
)

Constructor.

Parameters
comMPI communicator
num_filesNumber of files involved in an I/O operation
num_groupsNumber of groups stored in the files (usually equivalent to the number of MPI ranks providing data).

◆ ~IOBaton()

axom::sidre::IOBaton::~IOBaton ( )

Destructor.

Member Function Documentation

◆ wait()

int axom::sidre::IOBaton::wait ( )

Wait for previous rank to pass control to the local rank.

Returns
An integer id for the set of which this rank is a member.

◆ pass()

int axom::sidre::IOBaton::pass ( )

Pass control to the next rank.

Returns
0 if sucessful, -1 if not.

◆ setSize()

int axom::sidre::IOBaton::setSize ( ) const
inline

Size of local rank's set.

Returns
Number of ranks in the set.

◆ isFirstInGroup()

bool axom::sidre::IOBaton::isFirstInGroup ( ) const
inline

Tells if the local rank is the first (lowest) in its set.

◆ isLastInGroup()

bool axom::sidre::IOBaton::isLastInGroup ( ) const
inline

Tells if the local rank is the last (highest) in its set.

◆ getNumFiles()

int axom::sidre::IOBaton::getNumFiles ( ) const
inline

Get the number of files involved in the I/O operation.


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