COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
Buffer that can hold multiple data types, useful for MPI communication. More...
#include <Buffer.hpp>
Public Types | |
typedef char * | iterator |
Public Member Functions | |
const char * | buffer () const |
access to the internal buffer More... | |
void * | buffer () |
int | capacity () const |
Allocated memory. More... | |
int | size () const |
Size of valid parts of buffer. More... | |
int | unpacked_idx () const |
Unpacked memory. More... | |
int & | unpacked_idx () |
Unpacked memory. More... | |
bool | more_to_unpack () const |
Tell if everything is unpacked. More... | |
void | reserve (const Uint size) |
reserve the buffer to fit memory "size". The buffer gets allocated bigger than necessary in order to reduce future resizes. More... | |
void | resize (const Uint size) |
resize the buffer to fit memory "size". The buffer gets resized bigger than necessary in order to reduce future resizes. More... | |
void | reset () |
reset the buffer, without resizing More... | |
int | mark_pid_start () |
Create a separation, defining different parts of the buffer This is useful for parallel communication, so that you can avoid the use of std::vector<PE::Buffer> in e.g. all_to_all communication. More... | |
std::vector< int > & | strides () |
std::vector< int > & | displs () |
const std::vector< int > & | strides () const |
const std::vector< int > & | displs () const |
const iterator | begin () const |
begin iterator More... | |
const iterator | end () const |
end iterator More... | |
template<> | |
void | pack (const bool *data, const Uint data_size) |
pack specialization for bool More... | |
template<> | |
void | unpack (bool *data, const Uint data_size) |
unpack specialization for bool More... | |
Constructor/Destructor | |
Buffer (const Uint size=0u) | |
Constructor. More... | |
virtual | ~Buffer () |
Destructor, deallocates internal buffer. More... | |
Pack/Unpackfunctions for POD arrays | |
template<typename T > | |
void | pack (const T *data, const Uint data_size) |
Pack data in the buffer. The data must be POD (plain old data). More... | |
template<class T > | |
void | unpack (T *data, const Uint data_size) |
Unpack data in the buffer. The data must be POD (plain old data). More... | |
Pack/Unpack functions for POD | |
void | pack (const bool &data) |
void | pack (const char &data) |
void | pack (const unsigned char &data) |
void | pack (const short &data) |
void | pack (const unsigned short &data) |
void | pack (const int &data) |
void | pack (const unsigned int &data) |
void | pack (const long &data) |
void | pack (const unsigned long &data) |
void | pack (const long long &data) |
void | pack (const unsigned long long &data) |
void | pack (const float &data) |
void | pack (const double &data) |
void | pack (const long double &data) |
void | pack (const std::string &data) |
void | pack (const bool *data) |
void | pack (const char *data) |
void | pack (const unsigned char *data) |
void | pack (const short *data) |
void | pack (const unsigned short *data) |
void | pack (const int *data) |
void | pack (const unsigned int *data) |
void | pack (const long *data) |
void | pack (const unsigned long *data) |
void | pack (const long long *data) |
void | pack (const unsigned long long *data) |
void | pack (const float *data) |
void | pack (const double *data) |
void | pack (const long double *data) |
void | pack (const std::string *data) |
void | unpack (bool &data) |
void | unpack (char &data) |
void | unpack (unsigned char &data) |
void | unpack (short &data) |
void | unpack (unsigned short &data) |
void | unpack (int &data) |
void | unpack (unsigned int &data) |
void | unpack (long &data) |
void | unpack (unsigned long &data) |
void | unpack (long long &data) |
void | unpack (unsigned long long &data) |
void | unpack (float &data) |
void | unpack (double &data) |
void | unpack (long double &data) |
void | unpack (std::string &data) |
void | unpack (bool *data) |
void | unpack (char *data) |
void | unpack (unsigned char *data) |
void | unpack (short *data) |
void | unpack (unsigned short *data) |
void | unpack (int *data) |
void | unpack (unsigned int *data) |
void | unpack (long *data) |
void | unpack (unsigned long *data) |
void | unpack (long long *data) |
void | unpack (unsigned long long *data) |
void | unpack (float *data) |
void | unpack (double *data) |
void | unpack (long double *data) |
void | unpack (std::string *data) |
Pack/Unpack of some container types | |
template<typename T > | |
void | pack (const std::vector< T > &data) |
template<class T > | |
void | unpack (std::vector< T > &data) |
template<typename T > | |
void | pack (boost::detail::multi_array::sub_array< T, 1 > data) |
template<typename T > | |
void | pack (const boost::detail::multi_array::const_sub_array< T, 1, T const * > &data) |
template<typename T > | |
void | unpack (boost::detail::multi_array::sub_array< T, 1 > data) |
MPI collective operations | |
void | broadcast (const Uint root) |
Broadcast the buffer from the root process. More... | |
void | all_gather (Buffer &recv) |
All Gather collective operation for buffers. More... | |
void | all_to_all (Buffer &recv) |
All To All collective operation for buffers. More... | |
Private Attributes | |
char * | m_buffer |
internal buffer More... | |
int | m_capacity |
allocated memory in buffer More... | |
int | m_size |
packed memory in buffer More... | |
int | m_unpacked_idx |
unpacked memory in buffer More... | |
std::vector< int > | m_displs |
markers for separation More... | |
std::vector< int > | m_strides |
Buffer that can hold multiple data types, useful for MPI communication.
Buffer can be packed repetitively, with different data types. The size of the buffer grows automatically The buffer can be unpacked repetitively. Knowledge of every unpacked type must be known.
Definition at line 34 of file Buffer.hpp.
typedef char* iterator |
Definition at line 37 of file Buffer.hpp.
Constructor.
Definition at line 42 of file Buffer.hpp.
|
inlinevirtual |
Destructor, deallocates internal buffer.
Definition at line 52 of file Buffer.hpp.
|
inline |
All Gather collective operation for buffers.
The received buffer contains all sent buffers from all ranks
[out] | recv | output buffer |
Definition at line 483 of file Buffer.hpp.
|
inline |
All To All collective operation for buffers.
The received buffer contains those chunks from the sent buffer, that were marked for the receiving pid.
[out] | recv | output buffer |
Definition at line 509 of file Buffer.hpp.
|
inline |
begin iterator
Definition at line 107 of file Buffer.hpp.
|
inline |
Broadcast the buffer from the root process.
The buffer on all receiving ranks gets resized and overwritten with the buffer from the broadcasting rank.
[in] | root | The broadcasting rank |
Definition at line 464 of file Buffer.hpp.
|
inline |
access to the internal buffer
Definition at line 59 of file Buffer.hpp.
|
inline |
Definition at line 61 of file Buffer.hpp.
|
inline |
Allocated memory.
Definition at line 64 of file Buffer.hpp.
|
inline |
Definition at line 102 of file Buffer.hpp.
|
inline |
Definition at line 104 of file Buffer.hpp.
|
inline |
end iterator
Definition at line 110 of file Buffer.hpp.
|
inline |
Create a separation, defining different parts of the buffer This is useful for parallel communication, so that you can avoid the use of std::vector<PE::Buffer> in e.g. all_to_all communication.
Definition at line 301 of file Buffer.hpp.
|
inline |
Tell if everything is unpacked.
Definition at line 80 of file Buffer.hpp.
|
inline |
Pack data in the buffer. The data must be POD (plain old data).
[in] | data | data array |
[in] | data_size | number of elements in the array. (data_size=1 in case the data is not an array) |
Definition at line 311 of file Buffer.hpp.
|
inline |
Definition at line 405 of file Buffer.hpp.
|
inline |
Definition at line 130 of file Buffer.hpp.
|
inline |
Definition at line 131 of file Buffer.hpp.
|
inline |
Definition at line 132 of file Buffer.hpp.
|
inline |
Definition at line 133 of file Buffer.hpp.
|
inline |
Definition at line 134 of file Buffer.hpp.
|
inline |
Definition at line 135 of file Buffer.hpp.
|
inline |
Definition at line 136 of file Buffer.hpp.
|
inline |
Definition at line 137 of file Buffer.hpp.
|
inline |
Definition at line 138 of file Buffer.hpp.
|
inline |
Definition at line 139 of file Buffer.hpp.
|
inline |
Definition at line 140 of file Buffer.hpp.
|
inline |
Definition at line 141 of file Buffer.hpp.
|
inline |
Definition at line 142 of file Buffer.hpp.
|
inline |
Definition at line 440 of file Buffer.hpp.
|
inline |
Definition at line 406 of file Buffer.hpp.
|
inline |
Definition at line 146 of file Buffer.hpp.
|
inline |
Definition at line 147 of file Buffer.hpp.
|
inline |
Definition at line 148 of file Buffer.hpp.
|
inline |
Definition at line 149 of file Buffer.hpp.
|
inline |
Definition at line 150 of file Buffer.hpp.
|
inline |
Definition at line 151 of file Buffer.hpp.
|
inline |
Definition at line 152 of file Buffer.hpp.
|
inline |
Definition at line 153 of file Buffer.hpp.
|
inline |
Definition at line 154 of file Buffer.hpp.
|
inline |
Definition at line 155 of file Buffer.hpp.
|
inline |
Definition at line 156 of file Buffer.hpp.
|
inline |
Definition at line 157 of file Buffer.hpp.
|
inline |
Definition at line 158 of file Buffer.hpp.
|
inline |
Definition at line 441 of file Buffer.hpp.
|
inline |
Definition at line 350 of file Buffer.hpp.
|
inline |
Definition at line 370 of file Buffer.hpp.
|
inline |
Definition at line 387 of file Buffer.hpp.
|
inline |
pack specialization for bool
Definition at line 397 of file Buffer.hpp.
|
inline |
reserve the buffer to fit memory "size". The buffer gets allocated bigger than necessary in order to reduce future resizes.
Definition at line 266 of file Buffer.hpp.
|
inline |
reset the buffer, without resizing
This is useful to reuse an already allocated buffer.
Definition at line 291 of file Buffer.hpp.
|
inline |
resize the buffer to fit memory "size". The buffer gets resized bigger than necessary in order to reduce future resizes.
Definition at line 283 of file Buffer.hpp.
|
inline |
Size of valid parts of buffer.
Definition at line 67 of file Buffer.hpp.
|
inline |
Definition at line 101 of file Buffer.hpp.
|
inline |
Definition at line 103 of file Buffer.hpp.
|
inline |
Unpack data in the buffer. The data must be POD (plain old data).
[out] | data | data array |
[in] | data_size | number of elements in the array. (data_size=1 in case the data is not an array) |
Definition at line 335 of file Buffer.hpp.
|
inline |
Definition at line 422 of file Buffer.hpp.
|
inline |
Definition at line 162 of file Buffer.hpp.
|
inline |
Definition at line 163 of file Buffer.hpp.
|
inline |
Definition at line 164 of file Buffer.hpp.
|
inline |
Definition at line 165 of file Buffer.hpp.
|
inline |
Definition at line 166 of file Buffer.hpp.
|
inline |
Definition at line 167 of file Buffer.hpp.
|
inline |
Definition at line 168 of file Buffer.hpp.
|
inline |
Definition at line 169 of file Buffer.hpp.
|
inline |
Definition at line 170 of file Buffer.hpp.
|
inline |
Definition at line 171 of file Buffer.hpp.
|
inline |
Definition at line 172 of file Buffer.hpp.
|
inline |
Definition at line 173 of file Buffer.hpp.
|
inline |
Definition at line 174 of file Buffer.hpp.
|
inline |
Definition at line 459 of file Buffer.hpp.
|
inline |
Definition at line 423 of file Buffer.hpp.
|
inline |
Definition at line 178 of file Buffer.hpp.
|
inline |
Definition at line 179 of file Buffer.hpp.
|
inline |
Definition at line 180 of file Buffer.hpp.
|
inline |
Definition at line 181 of file Buffer.hpp.
|
inline |
Definition at line 182 of file Buffer.hpp.
|
inline |
Definition at line 183 of file Buffer.hpp.
|
inline |
Definition at line 184 of file Buffer.hpp.
|
inline |
Definition at line 185 of file Buffer.hpp.
|
inline |
Definition at line 186 of file Buffer.hpp.
|
inline |
Definition at line 187 of file Buffer.hpp.
|
inline |
Definition at line 188 of file Buffer.hpp.
|
inline |
Definition at line 189 of file Buffer.hpp.
|
inline |
Definition at line 190 of file Buffer.hpp.
|
inline |
Definition at line 460 of file Buffer.hpp.
|
inline |
Definition at line 359 of file Buffer.hpp.
|
inline |
Definition at line 377 of file Buffer.hpp.
|
inline |
unpack specialization for bool
Definition at line 412 of file Buffer.hpp.
|
inline |
|
inline |
|
private |
internal buffer
Definition at line 247 of file Buffer.hpp.
|
private |
allocated memory in buffer
Definition at line 250 of file Buffer.hpp.
|
private |
markers for separation
Definition at line 259 of file Buffer.hpp.
|
private |
packed memory in buffer
Definition at line 253 of file Buffer.hpp.
|
private |
Definition at line 260 of file Buffer.hpp.
|
private |
unpacked memory in buffer
Definition at line 256 of file Buffer.hpp.
Send comments to: COOLFluiD Web Admin |