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

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

#include <mpisgvbuf.h>

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

List of all members.

Public Member Functions

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

Protected Member Functions

void grow ()
void growTo (int)

Detailed Description

class for variable size scatter/gather buffer, root component

Author:
Steffen Abe $Revision$ $Date$

Constructor & Destructor Documentation

CMPIVarSGBufferRoot::CMPIVarSGBufferRoot ( MPI_Comm  comm,
int  isize = 16 
)

Constructor for CMPISGBufferRoot

Parameters:
commthe MPI communicator
isizeinitial buffer size per slice, default 16 byte

References AMPISGBufferRoot::m_size.


Member Function Documentation

void CMPIVarSGBufferRoot::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 grow(), and AMPISGBufferRoot::m_comm.

Here is the call graph for this function:

void CMPIVarSGBufferRoot::append ( double  d,
int  nslice 
) [virtual]

Append a double to a given slice of the buffer.

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

Implements AMPISGBufferRoot.

References grow(), AMPISGBufferRoot::m_comm, and AMPISGBufferRoot::m_dbl_increment.

Here is the call graph for this function:

void CMPIVarSGBufferRoot::append ( const char *  str,
int  nslice 
) [virtual]

Append a C-string to a given slice of the buffer.

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

Implements AMPISGBufferRoot.

References grow(), and AMPISGBufferRoot::m_comm.

Here is the call graph for this function:

void CMPIVarSGBufferRoot::gather ( ) [virtual]

Send data to the root process, using MPI_Gather and MPI_Gatherv. The receive buffer grows to fit the data if neccessary.

Implements AMPISGBufferRoot.

References AMPISGBufferRoot::m_comm, AMPISGBufferRoot::m_rank, and AMPISGBufferRoot::m_size.

void CMPIVarSGBufferRoot::grow ( ) [protected]

Grows the buffer to twice its current size, thus guaranteeing that append works in amortized constant time. Currently grows the buffer homogeneously, i.e. all slices have the same size.

Warning:
no check if there is enough space for the new buffer

References AMPISGBufferRoot::m_size.

Referenced by append().

Here is the caller graph for this function:

double CMPIVarSGBufferRoot::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 AMPISGBufferRoot::m_comm.

int CMPIVarSGBufferRoot::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 AMPISGBufferRoot::m_comm.

void CMPIVarSGBufferRoot::scatter ( ) [virtual]

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

Implements AMPISGBufferRoot.

References AMPISGBufferRoot::m_comm, AMPISGBufferRoot::m_rank, and AMPISGBufferRoot::m_size.


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