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


Public Member Functions | |
| CMPIVarSGBufferRoot (MPI_Comm, int isize=16) | |
| virtual | ~CMPIVarSGBufferRoot () |
| 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) |
Public Member Functions inherited from AMPISGBufferRoot | |
| AMPISGBufferRoot (MPI_Comm) | |
| virtual | ~AMPISGBufferRoot () |
| virtual void | append (const Vec3 &, int) |
| virtual Vec3 | pop_vector (int) |
| const MPI_Status & | status () |
Protected Member Functions | |
| void | grow () |
| void | growTo (int) |
Private Attributes | |
| char * | m_vbuffer |
| char * | m_dummy_vbuffer |
| dummy buffer sent by root to itself More... | |
| int | m_vbuffersize |
| the size of the buffer per slice More... | |
| int * | m_position |
| the current end of the content in each slice More... | |
| int * | m_rpos |
| the number of bytes in the slice (i.e. m_position-m_displ) More... | |
| int * | m_recvcount |
| the buffer for the transfer of the size of the vbuffer More... | |
| int * | m_displ |
| int | m_ndummy |
Additional Inherited Members | |
Protected Attributes inherited from AMPISGBufferRoot | |
| MPI_Comm | m_comm |
| the MPI communicator used for the scatter/gather operations More... | |
| int | m_rank |
| the rank in this communicator More... | |
| int | m_size |
| size of the communicator More... | |
| int | m_int_increment |
| int | m_dbl_increment |
| the "packing size" of int/double More... | |
| MPI_Status | m_status |
class for variable size scatter/gather buffer, root component
| CMPIVarSGBufferRoot::CMPIVarSGBufferRoot | ( | MPI_Comm | comm, |
| int | isize = 16 |
||
| ) |
Constructor for CMPISGBufferRoot
| comm | the MPI communicator |
| isize | initial buffer size per slice, default 16 byte |
References m_displ, m_dummy_vbuffer, m_position, m_recvcount, m_rpos, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.
|
virtual |
References m_displ, m_dummy_vbuffer, m_position, m_recvcount, m_rpos, and m_vbuffer.
|
virtual |
Append a C-string to a given slice of the buffer.
| str | the string |
| nslice | the nr. of the slice |
Implements AMPISGBufferRoot.
References grow(), esys::lsm::bpu::len(), AMPISGBufferRoot::m_comm, m_displ, AMPISGBufferRoot::m_int_increment, m_position, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.

|
virtual |
Append a double to a given slice of the buffer.
| d | the double |
| nslice | the nr. of the slice |
Implements AMPISGBufferRoot.
References grow(), AMPISGBufferRoot::m_comm, AMPISGBufferRoot::m_dbl_increment, m_displ, m_position, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.

|
virtual |
Append an integer to a given slice of the buffer.
| i | the integer |
| nslice | the nr. of the slice |
Implements AMPISGBufferRoot.
References grow(), AMPISGBufferRoot::m_comm, m_displ, AMPISGBufferRoot::m_int_increment, m_position, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.

|
virtual |
Implements AMPISGBufferRoot.
References m_displ, m_position, and AMPISGBufferRoot::m_size.
|
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 growTo(), AMPISGBufferRoot::m_comm, m_displ, m_dummy_vbuffer, m_position, AMPISGBufferRoot::m_rank, m_recvcount, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.

|
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.
References m_displ, m_position, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.
Referenced by append().

|
protected |
References m_displ, m_position, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.
Referenced by gather().

|
virtual |
Pops an double from a given slice of the the buffer.
| nslice | the nr. of the slice |
Implements AMPISGBufferRoot.
References AMPISGBufferRoot::m_comm, m_position, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.
|
virtual |
Implements AMPISGBufferRoot.
References AMPISGBufferRoot::m_comm, m_position, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.
|
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.
| nslice | the nr. of the slice |
Implements AMPISGBufferRoot.
References AMPISGBufferRoot::m_comm, m_position, AMPISGBufferRoot::m_size, m_vbuffer, and m_vbuffersize.
|
virtual |
Send data to all other members of the communicator, using MPI_Scatter/MPI_Scatterv
Implements AMPISGBufferRoot.
References AMPISGBufferRoot::m_comm, m_displ, m_dummy_vbuffer, m_ndummy, m_position, AMPISGBufferRoot::m_rank, m_rpos, AMPISGBufferRoot::m_size, and m_vbuffer.
|
private |
Referenced by append(), clear(), CMPIVarSGBufferRoot(), gather(), grow(), growTo(), scatter(), and ~CMPIVarSGBufferRoot().
|
private |
dummy buffer sent by root to itself
Referenced by CMPIVarSGBufferRoot(), gather(), scatter(), and ~CMPIVarSGBufferRoot().
|
private |
Referenced by scatter().
|
private |
the current end of the content in each slice
Referenced by append(), clear(), CMPIVarSGBufferRoot(), gather(), grow(), growTo(), pop_double(), pop_doubles(), pop_int(), scatter(), and ~CMPIVarSGBufferRoot().
|
private |
the buffer for the transfer of the size of the vbuffer
Referenced by CMPIVarSGBufferRoot(), gather(), and ~CMPIVarSGBufferRoot().
|
private |
the number of bytes in the slice (i.e. m_position-m_displ)
Referenced by CMPIVarSGBufferRoot(), scatter(), and ~CMPIVarSGBufferRoot().
|
private |
Referenced by append(), CMPIVarSGBufferRoot(), gather(), grow(), growTo(), pop_double(), pop_doubles(), pop_int(), scatter(), and ~CMPIVarSGBufferRoot().
|
private |
the size of the buffer per slice
Referenced by append(), CMPIVarSGBufferRoot(), gather(), grow(), growTo(), pop_double(), pop_doubles(), and pop_int().