1#ifndef LINEARALGEBRA_SRC_MOLPRO_LINALG_ARRAY_DISTRARRAYMPI3_H
2#define LINEARALGEBRA_SRC_MOLPRO_LINALG_ARRAY_DISTRARRAYMPI3_H
3#include <molpro/linalg/array/DistrArray.h>
63 void sync()
const override;
72 [[nodiscard]] std::unique_ptr<LocalBuffer>
local_buffer()
override;
73 [[nodiscard]] std::unique_ptr<const LocalBuffer>
local_buffer()
const override;
80 [[nodiscard]] std::vector<value_type>
gather(
const std::vector<index_type> &indices)
const override;
81 void scatter(
const std::vector<index_type> &indices,
const std::vector<value_type> &data)
override;
82 void scatter_acc(std::vector<index_type> &indices,
const std::vector<value_type> &data)
override;
83 [[nodiscard]] std::vector<value_type>
vec()
const override;
84 void error(
const std::string &message)
const override;
91 void _gather_scatter(
const std::vector<index_type> &indices, std::vector<value_type> &data,
RMAType option);
Implementation of distributed array using MPI3 RMA operations.
Definition DistrArrayMPI3.h:21
std::unique_ptr< LocalBuffer > local_buffer() override
Access the buffer local to this process.
Definition DistrArrayMPI3.cpp:131
void set(index_type ind, value_type val) override
Set one element to a scalar. Global operation.
Definition DistrArrayMPI3.cpp:140
void _get_put(index_type lo, index_type hi, const value_type *buf, RMAType option)
does get or put or accumulate
Definition DistrArrayMPI3.cpp:142
RMAType
Definition DistrArrayMPI3.h:87
void _gather_scatter(const std::vector< index_type > &indices, std::vector< value_type > &data, RMAType option)
does gather or scatter or scatter_acc
Definition DistrArrayMPI3.cpp:200
value_type at(index_type ind) const override
Definition DistrArrayMPI3.cpp:135
const Distribution & distribution() const override
Access distribution of the array among processes.
Definition DistrArrayMPI3.cpp:234
bool m_allocated
whether the window has been created
Definition DistrArrayMPI3.h:25
void error(const std::string &message) const override
stops application with an error
Definition DistrArrayMPI3.cpp:229
void sync() const override
Synchronizes all process in this group and ensures any outstanding operations on the array have compl...
Definition DistrArrayMPI3.cpp:121
void allocate_buffer()
Definition DistrArrayMPI3.cpp:84
std::vector< value_type > vec() const override
Copies the whole buffer into a vector. Blocking.
Definition DistrArrayMPI3.cpp:225
~DistrArrayMPI3() override
Definition DistrArrayMPI3.cpp:30
friend void swap(DistrArrayMPI3 &a1, DistrArrayMPI3 &a2) noexcept
Definition DistrArrayMPI3.cpp:75
MPI_Win m_win
window object
Definition DistrArrayMPI3.h:23
std::unique_ptr< Distribution > m_distribution
describes distribution of array among processes
Definition DistrArrayMPI3.h:24
DistrArrayMPI3 & operator=(const DistrArrayMPI3 &source)
Definition DistrArrayMPI3.cpp:57
Provides access to the local portion of the array.
Definition DistrArray.h:175
Array distributed across many processes supporting remote-memory-access, access to process local buff...
Definition DistrArray.h:137
double value_type
Definition DistrArray.h:140
size_t index_type
Definition DistrArray.h:141
Non-owning container taking a pointer to the data buffer and its size and exposing routines for itera...
Definition Span.h:31
Specifies distribution of a contiguous array into non-overlapping chunks.
Definition Distribution.h:16
Definition ArrayHandler.h:19
Definition DistrArrayMPI3.h:66