ESyS-Particle  4.0.1
Public Member Functions | Protected Member Functions
CMPIVarSGBufferLeaf Class Reference

class for variable size scatter/gather buffer, leaf component More...

#include <mpisgvbuf.h>

Inheritance diagram for CMPIVarSGBufferLeaf:
Inheritance graph
[legend]
Collaboration diagram for CMPIVarSGBufferLeaf:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CMPIVarSGBufferLeaf (MPI_Comm, int, int isize=16)
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 ()

Protected Member Functions

void grow ()
void growTo (int)

Detailed Description

class for variable size scatter/gather buffer, leaf component

Author:
Steffen Abe $Revision$ $Date$

Constructor & Destructor Documentation

CMPIVarSGBufferLeaf::CMPIVarSGBufferLeaf ( MPI_Comm  comm,
int  root,
int  isize = 16 
)

Constuctor for CMPISGBufferLeaf

Parameters:
commthe MPI communicator
rootrank of the root process
isizeinitial size of the communication buffer, default 16

Member Function Documentation

void CMPIVarSGBufferLeaf::append ( int  i) [virtual]

Append an integer to the buffer. If necessary, the buffer is enlarged.

Warning:
currently does not check if there is enough free space to allocate larger buffer

Implements AMPISGBufferLeaf.

References grow(), and AMPIBuffer::m_comm.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void CMPIVarSGBufferLeaf::append ( double  d) [virtual]

Append a double to the buffer. If necessary, the buffer is enlarged.

Warning:
currently does not check if there is enough free space to allocate larger buffer
See also:
grow()

Implements AMPISGBufferLeaf.

References grow(), AMPIBuffer::m_comm, and AMPISGBufferLeaf::m_dbl_increment.

Here is the call graph for this function:

void CMPIVarSGBufferLeaf::append ( const char *  str) [virtual]

Append a string to the buffer. If necessary, the buffer is enlarged.

Warning:
currently does not check if there is enough free space to allocate larger buffer
See also:
grow()

Implements AMPIBuffer.

References grow(), and AMPIBuffer::m_comm.

Here is the call graph for this function:

void CMPIVarSGBufferLeaf::grow ( ) [protected]

Grows the buffer to twice its current size, thus guaranteeing that append works in amortized constant time.

Referenced by append().

Here is the caller graph for this function:

void CMPIVarSGBufferLeaf::growTo ( int  size) [protected]

Grows the buffer to a given size. If the buffer is already larger that the given size, nothing is done. Used by receiveFrom.

Parameters:
sizesize to which the buffer is grown

Referenced by receive().

Here is the caller graph for this function:

double CMPIVarSGBufferLeaf::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 AMPIBuffer::m_comm.

int CMPIVarSGBufferLeaf::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 AMPIBuffer::m_comm.

std::string CMPIVarSGBufferLeaf::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 string.
See also:
CVarMPISingle::pop_int()

Implements AMPISGBufferLeaf.

References AMPIBuffer::m_comm.

void CMPIVarSGBufferLeaf::receive ( ) [virtual]

Receive data from root process, using MPI_Scatter/MPI_Scatterv. The buffer grows to fit the data, if neccesary.

Implements AMPISGBufferLeaf.

References growTo(), AMPIBuffer::m_comm, and AMPISGBufferLeaf::m_root.

Here is the call graph for this function:

void CMPIVarSGBufferLeaf::send ( ) [virtual]

Send data to the root process, using MPI_Gather/MPI_Gatherv

Implements AMPISGBufferLeaf.

References AMPIBuffer::m_comm, and AMPISGBufferLeaf::m_root.

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

Here is the caller graph for this function:


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