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.
 
void fetch (int target_worker)
 Fetch data from a remote process and store it in the local data array.
 
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.
 
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()

void SeapodymCourier::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.

Parameters
source_workersSet of ranks of source processes from which to fetch data
target_workerRank of the target process from which to fetch data

◆ 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()

void SeapodymCourier::fetch ( int target_worker)

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

Parameters
target_workerRank of the target process from which to fetch 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: