#include <SendBuffer.h>
Public Member Functions | |
SendBuffer (const libMesh::Parallel::Communicator &comm, const Context *const context, const processor_id_type pid, const ParallelStudyMethod &method, const unsigned int min_buffer_size, const unsigned int max_buffer_size, const Real buffer_growth_multiplier, const Real buffer_shrink_multiplier, const Parallel::MessageTag object_buffer_tag) | |
~SendBuffer () override | |
Destructor: ensures that all send requests have completed. More... | |
unsigned long int | objectsSent () const |
Get the number of objects sent from this buffer. More... | |
unsigned long int | buffersSent () const |
Get the number of buffers sent from this buffer. More... | |
unsigned long int | bufferPoolCreated () const |
Get the number of buffers created in the buffer pool. More... | |
bool | currentlySending () const |
Whether or not messages are currently being sent. More... | |
bool | currentlyBuffered () const |
Whether or not objects are currently waiting to be sent. More... | |
void | moveObject (std::shared_ptr< Object > &object) |
Move an object to the buffer. More... | |
void | forceSend (const bool shrink_current_buffer_size=true) |
Forces a Send for all currently buffered objects. More... | |
void | waitAll () |
Wait for all requests to finish. More... | |
void | clear () |
Clear all existing data. More... | |
void | cleanupRequests () |
Checks to see if any Requests can be finished. More... | |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
Protected Attributes | |
const Parallel::Communicator & | _communicator |
Private Attributes | |
const Context *const | _context |
The context. More... | |
const processor_id_type | _pid |
The processor ID this buffer will send to. More... | |
const ParallelStudyMethod & | _method |
const unsigned int | _min_buffer_size |
Minimum size of the buffer (in objects) More... | |
const unsigned int | _max_buffer_size |
Maximum size of the buffer (in objects) More... | |
const Real | _buffer_growth_multiplier |
Multiplier for the buffer size for growing the buffer. More... | |
const Real | _buffer_shrink_multiplier |
Multiplier for the buffer size for shrinking the buffer. More... | |
const Parallel::MessageTag | _object_buffer_tag |
MessageTag for sending objects. More... | |
unsigned int | _current_buffer_size |
Current size of the buffer (in objects) More... | |
Real | _current_buffer_size_real |
Running buffer size. More... | |
std::vector< std::shared_ptr< Object > > | _buffer |
The buffer. More... | |
std::size_t | _buffer_size_bytes |
The size of the objects in the buffer in bytes. More... | |
std::list< std::shared_ptr< Parallel::Request > > | _requests |
List of Requests. More... | |
MooseUtils::SharedPool< std::vector< typename Parallel::Packing< std::shared_ptr< Object > >::buffer_type > > | _buffer_pool |
Shared pool of buffers. More... | |
unsigned long int | _objects_sent |
Counter for objects sent. More... | |
unsigned long int | _buffers_sent |
Counter for buffers sent. More... | |
Definition at line 26 of file SendBuffer.h.
SendBuffer< Object, Context >::SendBuffer | ( | const libMesh::Parallel::Communicator & | comm, |
const Context *const | context, | ||
const processor_id_type | pid, | ||
const ParallelStudyMethod & | method, | ||
const unsigned int | min_buffer_size, | ||
const unsigned int | max_buffer_size, | ||
const Real | buffer_growth_multiplier, | ||
const Real | buffer_shrink_multiplier, | ||
const Parallel::MessageTag | object_buffer_tag | ||
) |
Definition at line 139 of file SendBuffer.h.
|
override |
Destructor: ensures that all send requests have completed.
Definition at line 167 of file SendBuffer.h.
|
inline |
Get the number of buffers created in the buffer pool.
Definition at line 55 of file SendBuffer.h.
|
inline |
Get the number of buffers sent from this buffer.
Definition at line 51 of file SendBuffer.h.
void SendBuffer< Object, Context >::cleanupRequests | ( | ) |
Checks to see if any Requests can be finished.
Definition at line 246 of file SendBuffer.h.
void SendBuffer< Object, Context >::clear | ( | ) |
Clear all existing data.
Definition at line 235 of file SendBuffer.h.
|
inline |
Whether or not objects are currently waiting to be sent.
Definition at line 64 of file SendBuffer.h.
|
inline |
Whether or not messages are currently being sent.
Definition at line 60 of file SendBuffer.h.
void SendBuffer< Object, Context >::forceSend | ( | const bool | shrink_current_buffer_size = true | ) |
Forces a Send for all currently buffered objects.
Definition at line 199 of file SendBuffer.h.
void SendBuffer< Object, Context >::moveObject | ( | std::shared_ptr< Object > & | object | ) |
Move an object to the buffer.
May cause the buffer to be communicated.
This DOES call std::move on the object
Definition at line 175 of file SendBuffer.h.
|
inline |
Get the number of objects sent from this buffer.
Definition at line 47 of file SendBuffer.h.
void SendBuffer< Object, Context >::waitAll | ( | ) |
Wait for all requests to finish.
Definition at line 263 of file SendBuffer.h.
|
private |
The buffer.
Definition at line 120 of file SendBuffer.h.
Referenced by SendBuffer< Object, Context >::currentlyBuffered(), and SendBuffer< Object, Context >::SendBuffer().
|
private |
Multiplier for the buffer size for growing the buffer.
Definition at line 107 of file SendBuffer.h.
|
private |
Shared pool of buffers.
Definition at line 130 of file SendBuffer.h.
Referenced by SendBuffer< Object, Context >::bufferPoolCreated().
|
private |
Multiplier for the buffer size for shrinking the buffer.
Definition at line 109 of file SendBuffer.h.
|
private |
The size of the objects in the buffer in bytes.
Definition at line 122 of file SendBuffer.h.
|
private |
Counter for buffers sent.
Definition at line 135 of file SendBuffer.h.
Referenced by SendBuffer< Object, Context >::buffersSent().
|
private |
The context.
Definition at line 95 of file SendBuffer.h.
|
private |
Current size of the buffer (in objects)
Definition at line 115 of file SendBuffer.h.
|
private |
Running buffer size.
Definition at line 117 of file SendBuffer.h.
|
private |
Maximum size of the buffer (in objects)
Definition at line 104 of file SendBuffer.h.
|
private |
Definition at line 99 of file SendBuffer.h.
|
private |
Minimum size of the buffer (in objects)
Definition at line 102 of file SendBuffer.h.
|
private |
MessageTag for sending objects.
Definition at line 112 of file SendBuffer.h.
|
private |
Counter for objects sent.
Definition at line 133 of file SendBuffer.h.
Referenced by SendBuffer< Object, Context >::objectsSent().
|
private |
The processor ID this buffer will send to.
Definition at line 97 of file SendBuffer.h.
|
private |
List of Requests.
Definition at line 125 of file SendBuffer.h.
Referenced by SendBuffer< Object, Context >::currentlySending().