7#include <unordered_map>
10#ifndef DATA_PROVIDER_H
11#define DATA_PROVIDER_H
20 DataProvider(
const DataProvider&) =
delete;
21 DataProvider& operator=(
const DataProvider&) =
delete;
28 DataProvider(MPI_Comm comm,
const std::vector<std::pair<std::string, std::size_t> >& nameSizePairs);
53 auto it = this->data_.find(name);
54 return it != this->data_.end() ? std::get<0>(it->second) :
nullptr;
62 auto it = this->data_.find(name);
63 return it != this->data_.end() ? std::get<1>(it->second) : 0;
71 return this->shmcomm_;
77 std::unordered_map< std::string, std::tuple<double*, std::size_t, MPI_Win> > data_;
bool isShmRoot() const
Check if the calling process is the root of the shared memory communicator (i.e., the one that provid...
Definition DataProvider.h:42
int getShmRank() const
Get the rank of the calling process in the shared memory communicator.
Definition DataProvider.h:36
MPI_Comm getShmComm() const
Definition DataProvider.h:70
double * getDataPtr(const std::string &name) const
Get a pointer to the shared data array.
Definition DataProvider.h:52
size_t getNumElements(const std::string &name) const
Get the number of elements in the shared data array.
Definition DataProvider.h:61