escript Revision_
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
 
int counter () const
 returns the current value of the message tag counter
 
void incCounter (int i=1)
 increments the message tag counter by i
 
void setCounter (int value)
 sets the message tag counter to value
 
bool isValid () const
 returns true if this has a valid MPI communicator
 

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=false)
 

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

◆ counter()

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

returns the current value of the message tag counter

◆ incCounter()

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

increments the message tag counter by i

◆ isValid()

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

returns true if this has a valid MPI communicator

References 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.

◆ setCounter()

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

sets the message tag counter to value

◆ setDistribution()

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

References 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 Symbol Documentation

◆ makeInfo

JMPI makeInfo ( MPI_Comm comm,
bool owncom = false )
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 JMPI_(), and ~JMPI_().

◆ msg_tag_counter

int escript::JMPI_::msg_tag_counter
private

◆ ownscomm

bool escript::JMPI_::ownscomm
private

Referenced by ~JMPI_().

◆ rank

int escript::JMPI_::rank

Referenced by JMPI_(), and split().

◆ size

int escript::JMPI_::size

Referenced by JMPI_(), setDistribution(), and split().


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