ESyS-Particle  2.3.4
CMPISGBufferRoot Class Reference

Buffer for MPI scatter/gather, root component. More...

#include <mpisgbuf.h>

Inheritance diagram for CMPISGBufferRoot:
Collaboration diagram for CMPISGBufferRoot:

Public Member Functions

 CMPISGBufferRoot (MPI_Comm, int)
 
virtual ~CMPISGBufferRoot ()
 
virtual void clear ()
 
virtual void gather ()
 
virtual void scatter ()
 
virtual void append (int, int)
 
virtual void append (double, int)
 
virtual void append (const char *, int)
 
virtual int pop_int (int)
 
virtual double pop_double (int)
 
virtual void pop_doubles (int, double *, int)
 
- Public Member Functions inherited from AMPISGBufferRoot
 AMPISGBufferRoot (MPI_Comm)
 
virtual ~AMPISGBufferRoot ()
 
virtual void append (const Vec3 &, int)
 
virtual Vec3 pop_vector (int)
 
const MPI_Status & status ()
 

Private Attributes

char * m_buffer
 
char * m_dummy_buffer
 dummy buffer sent by root to itself More...
 
int m_buffersize
 the size of the buffer per slice More...
 
int * m_position
 the current end of the content in each slice More...
 

Additional Inherited Members

- Protected Attributes inherited from AMPISGBufferRoot
MPI_Comm m_comm
 the MPI communicator used for the scatter/gather operations More...
 
int m_rank
 the rank in this communicator More...
 
int m_size
 size of the communicator More...
 
int m_int_increment
 
int m_dbl_increment
 the "packing size" of int/double More...
 
MPI_Status m_status
 

Detailed Description

Buffer for MPI scatter/gather, root component.

Author
Steffen Abe $Revision$ $Date$

Constructor & Destructor Documentation

◆ CMPISGBufferRoot()

CMPISGBufferRoot::CMPISGBufferRoot ( MPI_Comm  comm,
int  buffersize 
)

Constructor for CMPISGBufferRoot

Parameters
commthe MPI communicator
buffersizebuffer size per slice

References m_buffer, m_buffersize, m_dummy_buffer, m_position, and AMPISGBufferRoot::m_size.

◆ ~CMPISGBufferRoot()

CMPISGBufferRoot::~CMPISGBufferRoot ( )
virtual

References m_buffer, m_dummy_buffer, and m_position.

Member Function Documentation

◆ append() [1/3]

void CMPISGBufferRoot::append ( const char *  str,
int  nslice 
)
virtual

Append an C string (char*) to a given slice of the buffer.

Parameters
strthe string
nslicethe nr. of the slice
Warning
No check for overflow

Implements AMPISGBufferRoot.

References esys::lsm::bpu::len(), m_buffer, m_buffersize, AMPISGBufferRoot::m_comm, m_position, and AMPISGBufferRoot::m_size.

Here is the call graph for this function:

◆ append() [2/3]

void CMPISGBufferRoot::append ( double  d,
int  nslice 
)
virtual

Append an double to a given slice of the buffer.

Parameters
dthe double
nslicethe nr. of the slice
Warning
No check for overflow

Implements AMPISGBufferRoot.

References m_buffer, m_buffersize, AMPISGBufferRoot::m_comm, m_position, and AMPISGBufferRoot::m_size.

◆ append() [3/3]

void CMPISGBufferRoot::append ( int  i,
int  nslice 
)
virtual

Append an integer to a given slice of the buffer.

Parameters
ithe integer
nslicethe nr. of the slice
Warning
No check for overflow

Implements AMPISGBufferRoot.

References m_buffer, m_buffersize, AMPISGBufferRoot::m_comm, m_position, and AMPISGBufferRoot::m_size.

◆ clear()

void CMPISGBufferRoot::clear ( )
virtual

◆ gather()

void CMPISGBufferRoot::gather ( )
virtual

Get data from all other members of the communicator, using MPI_Gather

Implements AMPISGBufferRoot.

References m_buffer, m_buffersize, AMPISGBufferRoot::m_comm, m_dummy_buffer, and AMPISGBufferRoot::m_rank.

Referenced by CLatticeMaster::checkNeighbors().

Here is the caller graph for this function:

◆ pop_double()

double CMPISGBufferRoot::pop_double ( int  nslice)
virtual

Pops an double from a given slice of the the buffer.

Parameters
nslicethe nr. of the slice
Returns
the double.
Warning
No check for underflow

Implements AMPISGBufferRoot.

References m_buffer, m_buffersize, AMPISGBufferRoot::m_comm, and m_position.

◆ pop_doubles()

void CMPISGBufferRoot::pop_doubles ( int  nslice,
double *  dbl,
int  ndb 
)
virtual

◆ pop_int()

int CMPISGBufferRoot::pop_int ( int  nslice)
virtual

Pops an integer from a given slice of the the buffer, i.e. it pops the last sizeof(MPI_INT) bytes of the buffer, interpreting them as an int.

Parameters
nslicethe nr. of the slice
Returns
the int.
Warning
No check for underflow

Implements AMPISGBufferRoot.

References m_buffer, m_buffersize, AMPISGBufferRoot::m_comm, m_position, and AMPISGBufferRoot::m_size.

Referenced by CLatticeMaster::checkNeighbors().

Here is the caller graph for this function:

◆ scatter()

void CMPISGBufferRoot::scatter ( )
virtual

Send data to all other members of the communicator, using MPI_Scatter

Implements AMPISGBufferRoot.

References m_buffer, m_buffersize, AMPISGBufferRoot::m_comm, m_dummy_buffer, and AMPISGBufferRoot::m_rank.

Member Data Documentation

◆ m_buffer

char* CMPISGBufferRoot::m_buffer
private

◆ m_buffersize

int CMPISGBufferRoot::m_buffersize
private

the size of the buffer per slice

Referenced by append(), clear(), CMPISGBufferRoot(), gather(), pop_double(), pop_doubles(), pop_int(), and scatter().

◆ m_dummy_buffer

char* CMPISGBufferRoot::m_dummy_buffer
private

dummy buffer sent by root to itself

Referenced by CMPISGBufferRoot(), gather(), scatter(), and ~CMPISGBufferRoot().

◆ m_position

int* CMPISGBufferRoot::m_position
private

the current end of the content in each slice

Referenced by append(), clear(), CMPISGBufferRoot(), pop_double(), pop_doubles(), pop_int(), and ~CMPISGBufferRoot().


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