|
ESyS-Particle
2.3.4
|
class for variable size scatter/gather buffer, leaf component More...
#include <mpisgvbuf.h>


Public Member Functions | |
| CMPIVarSGBufferLeaf (MPI_Comm, int, int isize=16) | |
| virtual | ~CMPIVarSGBufferLeaf () |
| 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 () |
Protected Member Functions | |
| void | grow () |
| void | growTo (int) |
Private Attributes | |
| char * | m_vbuffer |
| int | m_vbuffersize |
| the size of the buffer More... | |
| int | m_position |
| the current end of the content More... | |
| int | m_data_size |
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 |
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 |
References m_position, m_vbuffer, and m_vbuffersize.
|
virtual |
References m_vbuffer.
|
virtual |
Append a string to the buffer. If necessary, the buffer is enlarged.
Implements AMPIBuffer.
References grow(), esys::lsm::bpu::len(), AMPIBuffer::m_comm, AMPISGBufferLeaf::m_int_increment, m_position, m_vbuffer, and m_vbuffersize.

|
virtual |
Append a double to the buffer. If necessary, the buffer is enlarged.
Implements AMPISGBufferLeaf.
References grow(), AMPIBuffer::m_comm, AMPISGBufferLeaf::m_dbl_increment, m_position, m_vbuffer, and m_vbuffersize.

|
virtual |
Append an integer to the buffer. If necessary, the buffer is enlarged.
Implements AMPISGBufferLeaf.
References grow(), AMPIBuffer::m_comm, AMPISGBufferLeaf::m_int_increment, m_position, m_vbuffer, and m_vbuffersize.
Referenced by TSubLattice< T >::countParticles().


|
virtual |
Implements AMPISGBufferLeaf.
References m_position.
|
protected |
Grows the buffer to twice its current size, thus guaranteeing that append works in amortized constant time.
References m_position, m_vbuffer, and m_vbuffersize.
Referenced by append().

|
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 |
References m_position, m_vbuffer, and m_vbuffersize.
Referenced by receive().

|
virtual |
Pops a double from the buffer.
Implements AMPISGBufferLeaf.
References AMPIBuffer::m_comm, m_position, m_vbuffer, and m_vbuffersize.
|
virtual |
Implements AMPISGBufferLeaf.
References AMPIBuffer::m_comm, m_position, m_vbuffer, and m_vbuffersize.
|
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, m_position, m_vbuffer, and m_vbuffersize.
|
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 esys::lsm::bpu::len(), AMPIBuffer::m_comm, m_position, m_vbuffer, and m_vbuffersize.

|
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, m_data_size, AMPISGBufferLeaf::m_root, m_vbuffer, m_vbuffersize, and NULL.

|
virtual |
Send data to the root process, using MPI_Gather/MPI_Gatherv
Implements AMPISGBufferLeaf.
References AMPIBuffer::m_comm, m_position, AMPISGBufferLeaf::m_root, m_vbuffer, and NULL.
Referenced by TSubLattice< T >::countParticles().

|
private |
Referenced by receive().
|
private |
the current end of the content
Referenced by append(), clear(), CMPIVarSGBufferLeaf(), grow(), growTo(), pop_double(), pop_doubles(), pop_int(), pop_string(), and send().
|
private |
Referenced by append(), CMPIVarSGBufferLeaf(), grow(), growTo(), pop_double(), pop_doubles(), pop_int(), pop_string(), receive(), send(), and ~CMPIVarSGBufferLeaf().
|
private |
the size of the buffer
Referenced by append(), CMPIVarSGBufferLeaf(), grow(), growTo(), pop_double(), pop_doubles(), pop_int(), pop_string(), and receive().