ESyS-Particle
4.0.1
|
class for variable size scatter/gather buffer, leaf component More...
#include <mpisgvbuf.h>
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) |
class for variable size scatter/gather buffer, leaf component
CMPIVarSGBufferLeaf::CMPIVarSGBufferLeaf | ( | MPI_Comm | comm, |
int | root, | ||
int | isize = 16 |
||
) |
Constuctor for CMPISGBufferLeaf
comm | the MPI communicator |
root | rank of the root process |
isize | initial size of the communication buffer, default 16 |
void CMPIVarSGBufferLeaf::append | ( | int | i | ) | [virtual] |
Append an integer to the buffer. If necessary, the buffer is enlarged.
Implements AMPISGBufferLeaf.
References grow(), and AMPIBuffer::m_comm.
Referenced by TSubLattice< T >::countParticles().
void CMPIVarSGBufferLeaf::append | ( | double | d | ) | [virtual] |
Append a double to the buffer. If necessary, the buffer is enlarged.
Implements AMPISGBufferLeaf.
References grow(), AMPIBuffer::m_comm, and AMPISGBufferLeaf::m_dbl_increment.
void CMPIVarSGBufferLeaf::append | ( | const char * | str | ) | [virtual] |
Append a string to the buffer. If necessary, the buffer is enlarged.
Implements AMPIBuffer.
References grow(), and AMPIBuffer::m_comm.
void CMPIVarSGBufferLeaf::grow | ( | ) | [protected] |
Grows the buffer to twice its current size, thus guaranteeing that append works in amortized constant time.
Referenced by append().
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.
size | size to which the buffer is grown |
Referenced by receive().
double CMPIVarSGBufferLeaf::pop_double | ( | ) | [virtual] |
Pops a double from the buffer.
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.
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.
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.
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().