escript  Revision_
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
escript::JMPI_ Class Reference

#include <EsysMPI.h>

Public Member Functions

 ~JMPI_ ()
 
DataTypes::dim_t setDistribution (DataTypes::index_t min_id, DataTypes::index_t max_id, DataTypes::index_t *distribution)
 
void split (DataTypes::dim_t N, DataTypes::dim_t *local_N, DataTypes::index_t *offset)
 
int mod_rank (int k) const
 
std::string appendRankToFileName (const std::string &fileName) const
 appends MPI rank to a file name if MPI size > 1 More...
 
int counter () const
 returns the current value of the message tag counter More...
 
void incCounter (int i=1)
 increments the message tag counter by i More...
 
void setCounter (int value)
 sets the message tag counter to value More...
 
bool isValid () const
 returns true if this has a valid MPI communicator More...
 

Public Attributes

int size
 
int rank
 
MPI_Comm comm
 

Private Member Functions

 JMPI_ (MPI_Comm comm, bool owncomm)
 

Private Attributes

bool ownscomm
 
int msg_tag_counter
 

Friends

JMPI makeInfo (MPI_Comm comm, bool owncom)
 

Constructor & Destructor Documentation

◆ ~JMPI_()

escript::JMPI_::~JMPI_ ( )

References comm, MPI_COMM_NULL, and ownscomm.

◆ JMPI_()

escript::JMPI_::JMPI_ ( MPI_Comm  comm,
bool  owncomm 
)
private

References comm, MPI_COMM_NULL, rank, and size.

Member Function Documentation

◆ appendRankToFileName()

std::string escript::JMPI_::appendRankToFileName ( const std::string &  fileName) const
inline

appends MPI rank to a file name if MPI size > 1

References rank, and size.

◆ counter()

int escript::JMPI_::counter ( ) const
inline

returns the current value of the message tag counter

References msg_tag_counter.

◆ incCounter()

void escript::JMPI_::incCounter ( int  i = 1)
inline

increments the message tag counter by i

References msg_tag_counter.

◆ isValid()

bool escript::JMPI_::isValid ( ) const
inline

returns true if this has a valid MPI communicator

References comm, and MPI_COMM_NULL.

◆ mod_rank()

int escript::JMPI_::mod_rank ( int  k) const
inline

N = #CPUs, k is a CPU number but out of range or even negative. Return a CPU number in 0...N-1.

References size.

◆ setCounter()

void escript::JMPI_::setCounter ( int  value)
inline

sets the message tag counter to value

References msg_tag_counter.

◆ setDistribution()

dim_t escript::JMPI_::setDistribution ( DataTypes::index_t  min_id,
DataTypes::index_t  max_id,
DataTypes::index_t distribution 
)

References paso::N, and size.

◆ split()

void escript::JMPI_::split ( DataTypes::dim_t  N,
DataTypes::dim_t local_N,
DataTypes::index_t offset 
)

References rank, and size.

Friends And Related Function Documentation

◆ makeInfo

JMPI makeInfo ( MPI_Comm  comm,
bool  owncom 
)
friend

creates a JMPI shared pointer from MPI communicator if owncom is true, the communicator is freed when mpi info is destroyed.

Member Data Documentation

◆ comm

MPI_Comm escript::JMPI_::comm

Referenced by isValid(), JMPI_(), and ~JMPI_().

◆ msg_tag_counter

int escript::JMPI_::msg_tag_counter
private

Referenced by counter(), incCounter(), and setCounter().

◆ ownscomm

bool escript::JMPI_::ownscomm
private

Referenced by ~JMPI_().

◆ rank

int escript::JMPI_::rank

◆ size

int escript::JMPI_::size

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