seapodym-parallel
Fish dynamics models with parameter estimations
Loading...
Searching...
No Matches
SeapodymCourier Class Reference

SeapodymCourier class for managing memory exposure and data fetching between MPI processes. More...

#include <SeapodymCourier.h>

Public Member Functions

 SeapodymCourier (MPI_Comm comm=MPI_COMM_WORLD)
 Constructor.
 ~SeapodymCourier ()
 Destructor.
double * getDataPtr () const
 Get the pointer to the exposed data.
void expose (double *data, int data_size)
 Expose the memory to other processes.
std::vector< double > fetch (int source_worker)
 Fetch data from a remote process and store it in the local data array.
std::vector< double > accumulate (int targetWorker)
 Accumulate the data from all workers.
void free ()
 Free the MPI window and reset the data pointer.
 SeapodymCourier (const SeapodymCourier &)=delete
SeapodymCourieroperator= (const SeapodymCourier &)=delete
 SeapodymCourier (SeapodymCourier &&other) noexcept
SeapodymCourieroperator= (SeapodymCourier &&other) noexcept

Detailed Description

SeapodymCourier class for managing memory exposure and data fetching between MPI processes.

This class allows workers to expose their memory to other processes and fetch data from them. It uses MPI windows for memory exposure and communication.

Constructor & Destructor Documentation

◆ SeapodymCourier()

SeapodymCourier::SeapodymCourier ( MPI_Comm comm = MPI_COMM_WORLD)

Constructor.

Parameters
commMPI communicator to use for communication

Member Function Documentation

◆ accumulate()

std::vector< double > SeapodymCourier::accumulate ( int targetWorker)

Accumulate the data from all workers.

Parameters
targetWorkerRank of the target process to which to accumulate data
Returns
A vector containing the accumulated data from all workers

◆ expose()

void SeapodymCourier::expose ( double * data,
int data_size )

Expose the memory to other processes.

Parameters
dataPointer to the data to be exposed
data_sizeNumber of elements in the data array

◆ fetch()

std::vector< double > SeapodymCourier::fetch ( int source_worker)

Fetch data from a remote process and store it in the local data array.

Parameters
source_workerRank of the target process from which to fetch data
Returns
data

◆ getDataPtr()

double * SeapodymCourier::getDataPtr ( ) const
inline

Get the pointer to the exposed data.

Returns
Pointer to the exposed data

The documentation for this class was generated from the following files: