OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
MPIHelper.cpp File Reference
#include <string.h>
#include <boost/static_assert.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include "Util/MPIHelper.h"
Include dependency graph for MPIHelper.cpp:

Go to the source code of this file.

Functions

void serialize (Param_t params, std::ostringstream &os)
 serializes params using Boost archive
void serialize (reqVarContainer_t reqvars, std::ostringstream &os)
void deserialize (char *buffer, Param_t &params)
 deserializes params using Boost archive
void deserialize (char *buffer, reqVarContainer_t &reqvars)
void MPI_Bcast_params (Param_t &params, size_t root, MPI_Comm comm)
 broadcast params to all entities in comm
void MPI_Send_params (Param_t params, size_t pid, MPI_Comm comm)
std::pair< size_t *, char * > MPI_ISend_params (Param_t params, size_t pid, MPI_Comm comm, MPI_Request *req)
void MPI_Recv_params (Param_t &params, size_t pid, MPI_Comm comm)
void MPI_Send_reqvars (reqVarContainer_t reqvars, size_t pid, MPI_Comm comm)
void MPI_Recv_reqvars (reqVarContainer_t &reqvars, size_t pid, MPI_Comm comm)

Function Documentation

◆ deserialize() [1/2]

void deserialize ( char * buffer,
Param_t & params )

deserializes params using Boost archive

Definition at line 44 of file MPIHelper.cpp.

Referenced by MPI_Bcast_params(), MPI_Recv_params(), MPI_Recv_reqvars(), and MPI_Recv_serialized().

◆ deserialize() [2/2]

void deserialize ( char * buffer,
reqVarContainer_t & reqvars )

Definition at line 52 of file MPIHelper.cpp.

◆ MPI_Bcast_params()

void MPI_Bcast_params ( Param_t & params,
size_t root,
MPI_Comm comm )

broadcast params to all entities in comm

Definition at line 60 of file MPIHelper.cpp.

References deserialize(), and serialize().

Referenced by SampleWorker< Sim_t >::onMessage(), Worker< Sim_t >::onMessage(), Worker< Sim_t >::runCoWorker(), and SampleWorker< Sim_t >::runSlave().

Here is the call graph for this function:

◆ MPI_ISend_params()

std::pair< size_t *, char * > MPI_ISend_params ( Param_t params,
size_t pid,
MPI_Comm comm,
MPI_Request * req )

Serializes a parameter list and asynchronously sends (MPI) to another processor. The memory associated with returned buffers must be freed by the consumer.

Parameters
paramsparameter list to serialize
pidprocessor ID to send data to
commMPI communicator group used for sending the data
reqMPI request assigned with the ISend

Definition at line 105 of file MPIHelper.cpp.

References MPI_EXCHANGE_SERIALIZED_DATA_TAG, and serialize().

Here is the call graph for this function:

◆ MPI_Recv_params()

void MPI_Recv_params ( Param_t & params,
size_t pid,
MPI_Comm comm )

Receives and unpacks a parameter list from another (MPI) processor.

Parameters
paramsparameter list to store data
pidprocessor ID to receive data from
commMPI communicator group used for receiving the data

Definition at line 128 of file MPIHelper.cpp.

References deserialize(), and MPI_EXCHANGE_SERIALIZED_DATA_TAG.

Referenced by Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), and Worker< Sim_t >::onMessage().

Here is the call graph for this function:

◆ MPI_Recv_reqvars()

void MPI_Recv_reqvars ( reqVarContainer_t & reqvars,
size_t pid,
MPI_Comm comm )

Receives and unpacks a required variable list from another (MPI) processor.

Parameters
reqvarsvariable list to store data
pidprocessor ID to receive data from
commMPI communicator group used for receiving the data

Definition at line 165 of file MPIHelper.cpp.

References deserialize(), and MPI_EXCHANGE_SERIALIZED_DATA_TAG.

Referenced by Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), and Sampler::onMessage().

Here is the call graph for this function:

◆ MPI_Send_params()

void MPI_Send_params ( Param_t params,
size_t pid,
MPI_Comm comm )

Serializes a parameter list and sends (MPI) to another processor.

Parameters
paramsparameter list to serialize
pidprocessor ID to send data to
commMPI communicator group used for sending the data

Definition at line 87 of file MPIHelper.cpp.

References MPI_EXCHANGE_SERIALIZED_DATA_TAG, and serialize().

Referenced by Sampler::dispatch_forward_solves(), Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker(), and SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::sendNewJobToWorker().

Here is the call graph for this function:

◆ MPI_Send_reqvars()

void MPI_Send_reqvars ( reqVarContainer_t reqvars,
size_t pid,
MPI_Comm comm )

Serializes requested variable list and sends (MPI) to another processor.

Parameters
reqvarsvariable list list to serialize
pidprocessor ID to send data to
commMPI communicator group used for sending the data

Definition at line 146 of file MPIHelper.cpp.

References MPI_EXCHANGE_SERIALIZED_DATA_TAG, and serialize().

Referenced by Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), SamplePilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >::onMessage(), SampleWorker< Sim_t >::onMessage(), and Worker< Sim_t >::onMessage().

Here is the call graph for this function:

◆ serialize() [1/2]

void serialize ( Param_t params,
std::ostringstream & os )

◆ serialize() [2/2]

void serialize ( reqVarContainer_t reqvars,
std::ostringstream & os )

Definition at line 38 of file MPIHelper.cpp.