3#ifndef SEAPODYM_COURIER
4#define SEAPODYM_COURIER
7using Tuple3 = std::tuple<MPI_Win, double*, std::size_t>;
57 void expose(
double* data,
int data_size);
63 void fetch(
int target_worker);
70 void accumulate(
const std::set<int>& source_workers,
int target_worker);
76 if (this->win != MPI_WIN_NULL) {
77 MPI_Win_free(&this->win);
SeapodymCourier class for managing memory exposure and data fetching between MPI processes.
Definition SeapodymCourier.h:15
void fetch(int target_worker)
Fetch data from a remote process and store it in the local data array.
Definition SeapodymCourier.cpp:31
void accumulate(const std::set< int > &source_workers, int target_worker)
Accumulate/sum the data from multiple source workers into a target worker's local data array.
Definition SeapodymCourier.cpp:47
void free()
Free the MPI window and reset the data pointer.
Definition SeapodymCourier.h:75
double * getDataPtr() const
Get the pointer to the exposed data.
Definition SeapodymCourier.h:50
~SeapodymCourier()
Destructor.
Definition SeapodymCourier.cpp:15
void expose(double *data, int data_size)
Expose the memory to other processes.
Definition SeapodymCourier.cpp:20
SeapodymCourier(MPI_Comm comm=MPI_COMM_WORLD)
Constructor.
Definition SeapodymCourier.cpp:7