DistDataCollector is a class that collects data stored on multiple MPI processes into a large array stored on rank 0.
More...
#include <DistDataCollector.h>
|
| | DistDataCollector (MPI_Comm comm, int numChunks, int numSize) |
| | Constructor.
|
|
| ~DistDataCollector () |
| | Destructor.
|
|
void | startEpoch () |
| | Start an epoch for RMA operations.
|
|
void | flush () |
| | Ensure that all RMA operations are completed.
|
|
void | endEpoch () |
| | End an epoch for RMA operations.
|
| void | put (int chunkId, const double *data) |
| | Put the local data into the collected array.
|
| void | putAsync (int chunkId, const double *data) |
| | Put the local data into the collected array (non-blocking)
|
| std::vector< double > | get (int chunkId) |
| | Get a slice of the remote, collected array to the local worker.
|
| void | get (int chunkId, double *buffer) |
| | Get a slice of the remote, collected array to the local worker.
|
| void | getAsync (int chunkId, double *buffer) |
| | Get a slice of the remote, collected array to the local worker (non-blocking)
|
| double * | getCollectedDataPtr () |
| int | getNumChunks () const |
| int | getNumSize () const |
|
void | free () |
| | Free the MPI window and empty the collected data.
|
|
| DistDataCollector (const DistDataCollector &)=delete |
|
DistDataCollector & | operator= (const DistDataCollector &)=delete |
|
| DistDataCollector (DistDataCollector &&other) noexcept |
|
DistDataCollector & | operator= (DistDataCollector &&other) noexcept |
|
|
const double | BAD_VALUE = std::numeric_limits<double>::quiet_NaN() |
DistDataCollector is a class that collects data stored on multiple MPI processes into a large array stored on rank 0.
◆ DistDataCollector()
| DistDataCollector::DistDataCollector |
( |
MPI_Comm | comm, |
|
|
int | numChunks, |
|
|
int | numSize ) |
Constructor.
- Parameters
-
| comm | MPI communicator to use for communication |
| numChunks | The number of array slices on rank 0 |
| numSize | The size of each slice |
◆ get() [1/2]
| std::vector< double > DistDataCollector::get |
( |
int | chunkId | ) |
|
Get a slice of the remote, collected array to the local worker.
- Parameters
-
| chunkId | Leading index in the collected array |
- Returns
- data array
- Note
- this should be executed on the source process, typically by the worker
◆ get() [2/2]
| void DistDataCollector::get |
( |
int | chunkId, |
|
|
double * | buffer ) |
Get a slice of the remote, collected array to the local worker.
- Parameters
-
| chunkId | Leading index in the collected array |
| buffer | will hold the fetched data |
- Note
- this should be executed on the source process, typically by the worker
◆ getAsync()
| void DistDataCollector::getAsync |
( |
int | chunkId, |
|
|
double * | buffer ) |
|
inline |
Get a slice of the remote, collected array to the local worker (non-blocking)
- Parameters
-
| chunkId | Leading index in the collected array |
| buffer | will hold the fetched data |
- Note
- this should be executed on the source process, typically by the worker. This is a non-blocking call which relies on startEpoch/flush/endEpoch to complete
◆ getCollectedDataPtr()
| double * DistDataCollector::getCollectedDataPtr |
( |
| ) |
|
|
inline |
Get the pointer to the collected data
- Returns
- pointer
- Note
- this returns a null pointer on ranks other than 0
◆ getNumChunks()
| int DistDataCollector::getNumChunks |
( |
| ) |
const |
|
inline |
Get the number of chunks
- Returns
- number
◆ getNumSize()
| int DistDataCollector::getNumSize |
( |
| ) |
const |
|
inline |
Get the size of each chunk
- Returns
- number
◆ put()
| void DistDataCollector::put |
( |
int | chunkId, |
|
|
const double * | data ) |
Put the local data into the collected array.
- Parameters
-
| chunkId | Leading index in the collected array |
| data | Pointer to the local data to inject
|
- Note
- this should be executed on the source process, typically by the worker
◆ putAsync()
| void DistDataCollector::putAsync |
( |
int | chunkId, |
|
|
const double * | data ) |
|
inline |
Put the local data into the collected array (non-blocking)
- Parameters
-
| chunkId | Leading index in the collected array |
| data | Pointer to the local data to inject
|
- Note
- this should be executed on the source process, typically by the worker This is a non-blocking call which relies on startEpoch/flush/endEpoch to
The documentation for this class was generated from the following files: