|
ESyS-Particle
2.3.4
|
Constant size MPI send/recv buffer. More...
#include <mpibuf.h>


Public Member Functions | |
| CMPIBuffer (MPI_Comm, int) | |
| virtual | ~CMPIBuffer () |
| virtual void | clear () |
| virtual void | sendTo (int, int) |
| virtual void | receiveFrom (int src=MPI_ANY_SOURCE, int tag=MPI_ANY_TAG) |
| virtual void | append (int) |
| virtual void | append (double) |
| virtual void | append (const char *) |
| bool | append_checked (int) |
| bool | append_checked (double) |
| virtual int | pop_int () |
| virtual double | pop_double () |
| virtual void | pop_doubles (double *, int) |
| virtual std::string | pop_string () |
Public Member Functions inherited from AMPIBufferPP | |
| AMPIBufferPP (MPI_Comm comm) | |
| virtual | ~AMPIBufferPP () |
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 () |
Private Attributes | |
| char * | m_buffer |
| int | m_buffersize |
| the size of the buffer More... | |
| int | m_position |
| the current end of the content More... | |
| int | m_int_increment |
| int | m_dbl_increment |
| the "packing size" of int/double More... | |
Additional Inherited Members | |
Protected Attributes inherited from AMPIBuffer | |
| MPI_Comm | m_comm |
| the MPI Communicator used for the send/recv operations More... | |
| MPI_Status | m_status |
Constant size MPI send/recv buffer.
CMPIBuffer implements a send/receive buffer. MPI_pack/MPI_unpack is used the transfer arbitrary data. Type information is not transported. i.e. the user has to know the type of the content of a received message.
| CMPIBuffer::CMPIBuffer | ( | MPI_Comm | comm, |
| int | s | ||
| ) |
Constructor. Allocates the buffer and sets the MPI communicator to be used for send/receive operations.
| comm | the MPI communicator |
| s | the size of the buffer |
References m_buffer, m_buffersize, AMPIBuffer::m_comm, m_dbl_increment, m_int_increment, and m_position.
|
virtual |
References m_buffer.
|
virtual |
Append a string to the buffer. The string appended is a normal (zero-terminated) C-string, but is internally handeled by packing the length frist and then the string.
Implements AMPIBuffer.
References esys::lsm::bpu::len(), m_buffer, m_buffersize, AMPIBuffer::m_comm, and m_position.

|
virtual |
Append a double to the buffer.
Implements AMPIBuffer.
References m_buffer, m_buffersize, AMPIBuffer::m_comm, and m_position.
|
virtual |
Append an integer to the buffer.
Implements AMPIBuffer.
References m_buffer, m_buffersize, AMPIBuffer::m_comm, and m_position.
| bool CMPIBuffer::append_checked | ( | double | d | ) |
Append a double to the buffer with overflow check.
References m_buffer, m_buffersize, AMPIBuffer::m_comm, m_dbl_increment, and m_position.
| bool CMPIBuffer::append_checked | ( | int | i | ) |
Append an integer to the buffer with overflow check. If the buffer is big enough the integer is appended, if not nothing is done.
References m_buffer, m_buffersize, AMPIBuffer::m_comm, m_int_increment, and m_position.
|
inlinevirtual |
Implements AMPIBuffer.
References m_position.
|
virtual |
Pops a double from the buffer.
Implements AMPIBuffer.
References m_buffer, m_buffersize, AMPIBuffer::m_comm, and m_position.
|
virtual |
pop an array of doubles from a buffer
Implements AMPIBuffer.
References m_buffer, m_buffersize, AMPIBuffer::m_comm, and m_position.
|
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 AMPIBuffer.
References m_buffer, m_buffersize, AMPIBuffer::m_comm, and m_position.
|
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 AMPIBuffer.
References esys::lsm::bpu::len(), m_buffer, m_buffersize, AMPIBuffer::m_comm, and m_position.

|
virtual |
Recieves a message from a given source and stores it in the buffer. It is assumed that the buffer is large enough the take the message. If no source and no tag are given, any message from any source is accepted.
| src | rank of the sender in the current communicator, defaults to MPI_ANY_SOURCE |
| tag | the message tag, defaults to MPI_ANY_TAG |
Implements AMPIBufferPP.
References m_buffer, m_buffersize, AMPIBuffer::m_comm, m_position, and AMPIBuffer::m_status.
|
virtual |
Sends the contents of the buffer to a given destination.
| dest | the rank of the destination process in the current communicator |
| tag | the message tag |
Implements AMPIBufferPP.
References m_buffer, AMPIBuffer::m_comm, and m_position.
|
private |
Referenced by append(), append_checked(), CMPIBuffer(), pop_double(), pop_doubles(), pop_int(), pop_string(), receiveFrom(), sendTo(), and ~CMPIBuffer().
|
private |
the size of the buffer
Referenced by append(), append_checked(), CMPIBuffer(), pop_double(), pop_doubles(), pop_int(), pop_string(), and receiveFrom().
|
private |
the "packing size" of int/double
Referenced by append_checked(), and CMPIBuffer().
|
private |
Referenced by append_checked(), and CMPIBuffer().
|
private |
the current end of the content
Referenced by append(), append_checked(), clear(), CMPIBuffer(), pop_double(), pop_doubles(), pop_int(), pop_string(), receiveFrom(), and sendTo().