ESyS-Particle  2.3.4
CMPISGBufferLeaf Class Reference

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

#include <mpisgbuf.h>

Inheritance diagram for CMPISGBufferLeaf:
Collaboration diagram for CMPISGBufferLeaf:

Public Member Functions

 CMPISGBufferLeaf (MPI_Comm, int, int)
 
virtual ~CMPISGBufferLeaf ()
 
virtual void clear ()
 
virtual void send ()
 
virtual void receive ()
 
virtual void append (int)
 
virtual void append (double)
 
virtual void append (const char *)
 
virtual int pop_int ()
 
virtual double pop_double ()
 
virtual void pop_doubles (double *, int)
 
virtual std::string pop_string ()
 
- Public Member Functions inherited from AMPISGBufferLeaf
 AMPISGBufferLeaf (MPI_Comm, int)
 
virtual ~AMPISGBufferLeaf ()
 
const MPI_Status & status ()
 
- Public Member Functions inherited from AMPIBuffer
 AMPIBuffer (MPI_Comm comm)
 
virtual ~AMPIBuffer ()
 
virtual void append (const Vec3 &)
 
virtual Vec3 pop_vector ()
 
const MPI_Status & status ()
 

Private Attributes

char * m_buffer
 
int m_buffersize
 the size of the buffer More...
 
int m_position
 the current end of the content More...
 

Additional Inherited Members

- Protected Attributes inherited from AMPISGBufferLeaf
int m_root
 rank of the root process More...
 
int m_int_increment
 
int m_dbl_increment
 the "packing size" of int/double More...
 
- Protected Attributes inherited from AMPIBuffer
MPI_Comm m_comm
 the MPI Communicator used for the send/recv operations More...
 
MPI_Status m_status
 

Detailed Description

Buffer for MPI scatter/gather, leaf component.

Author
Steffen Abe $Revision$ $Date$

Constructor & Destructor Documentation

◆ CMPISGBufferLeaf()

CMPISGBufferLeaf::CMPISGBufferLeaf ( MPI_Comm  comm,
int  root,
int  buffersize 
)

Constuctor for CMPISGBufferLeaf

Parameters
commthe MPI communicator
rootrank of the root process
buffersizesize of the communication buffer

References m_buffer, m_buffersize, and m_position.

◆ ~CMPISGBufferLeaf()

CMPISGBufferLeaf::~CMPISGBufferLeaf ( )
virtual

References m_buffer.

Member Function Documentation

◆ append() [1/3]

void CMPISGBufferLeaf::append ( const char *  str)
virtual

Append a string to the buffer. The string appended is a normal (zero-terminated) C-string, but is internally handeled by packing the length frist and then the string.

Warning
No check for overflow

Implements AMPIBuffer.

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

Here is the call graph for this function:

◆ append() [2/3]

void CMPISGBufferLeaf::append ( double  d)
virtual

Append a double to the buffer.

Warning
No check for overflow

Implements AMPISGBufferLeaf.

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

◆ append() [3/3]

void CMPISGBufferLeaf::append ( int  i)
virtual

Append an integer to the buffer.

Warning
No check for overflow

Implements AMPISGBufferLeaf.

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

Referenced by TSubLattice< T >::checkNeighbors().

Here is the caller graph for this function:

◆ clear()

void CMPISGBufferLeaf::clear ( )
virtual

Implements AMPISGBufferLeaf.

References m_position.

◆ pop_double()

double CMPISGBufferLeaf::pop_double ( )
virtual

Pops a double from the buffer.

Warning
No check for underflow
Returns
the double.
See also
CMPIBuffer::pop_int()

Implements AMPISGBufferLeaf.

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

◆ pop_doubles()

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

◆ pop_int()

int CMPISGBufferLeaf::pop_int ( )
virtual

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

Warning
No check for underflow
Returns
the int.

Implements AMPISGBufferLeaf.

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

◆ pop_string()

std::string CMPISGBufferLeaf::pop_string ( )
virtual

Pops a string from the buffer. The first for bytes are interpreted as int, giving the length of the string (without terminating '\0'), the rest as the characters.

Warning
no consistency check, i.e. it is not checked if the length is smaller than the buffersize.
Returns
the double.
See also
CMPISingle::pop_int()

Implements AMPISGBufferLeaf.

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

Here is the call graph for this function:

◆ receive()

void CMPISGBufferLeaf::receive ( )
virtual

Receive data from root process, using MPI_Scatter

Implements AMPISGBufferLeaf.

References m_buffer, m_buffersize, AMPIBuffer::m_comm, AMPISGBufferLeaf::m_root, and NULL.

◆ send()

void CMPISGBufferLeaf::send ( )
virtual

Send data to the root process, using MPI_Gather

Implements AMPISGBufferLeaf.

References m_buffer, m_buffersize, AMPIBuffer::m_comm, AMPISGBufferLeaf::m_root, and NULL.

Referenced by TSubLattice< T >::checkNeighbors().

Here is the caller graph for this function:

Member Data Documentation

◆ m_buffer

char* CMPISGBufferLeaf::m_buffer
private

◆ m_buffersize

int CMPISGBufferLeaf::m_buffersize
private

the size of the buffer

Referenced by append(), CMPISGBufferLeaf(), pop_double(), pop_doubles(), pop_int(), pop_string(), receive(), and send().

◆ m_position

int CMPISGBufferLeaf::m_position
private

the current end of the content

Referenced by append(), clear(), CMPISGBufferLeaf(), pop_double(), pop_doubles(), pop_int(), and pop_string().


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