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
void scatter(const std::vector< index_type > &indices, const std::vector< value_type > &data) override
array[indices[i]] = data[i] Puts vals of elements with discontinuous indices of array....
Definition: DistrArrayMPI3.cpp:189
std::unique_ptr< LocalBuffer > local_buffer() override
Access the buffer local to this process.
Definition: DistrArrayMPI3.cpp:130
void set(index_type ind, value_type val) override
Set one element to a scalar. Global operation.
Definition: DistrArrayMPI3.cpp:139
void _get_put(index_type lo, index_type hi, const value_type *buf, RMAType option)
does get or put or accumulate
Definition: DistrArrayMPI3.cpp:141
std::vector< value_type > gather(const std::vector< index_type > &indices) const override
gets elements with discontinuous indices from array. Blocking
Definition: DistrArrayMPI3.cpp:183
void put(index_type lo, index_type hi, const value_type *data) override
array[lo:hi) = data[:] (hi is past-the-end). Blocking
Definition: DistrArrayMPI3.cpp:181
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:197
void acc(index_type lo, index_type hi, const value_type *data) override
array[lo:hi) += scaling_constant * data[:] (hi is past-the-end). Blocking
Definition: DistrArrayMPI3.cpp:224
value_type at(index_type ind) const override
Definition: DistrArrayMPI3.cpp:134
const Distribution & distribution() const override
Access distribution of the array among processes.
Definition: DistrArrayMPI3.cpp:228
bool m_allocated
whether the window has been created
Definition: DistrArrayMPI3.h:25
void get(index_type lo, index_type hi, value_type *buf) const override
Gets buffer[lo:hi) from global array (hi is past-the-end). Blocking.
Definition: DistrArrayMPI3.cpp:169
void error(const std::string &message) const override
stops application with an error
Definition: DistrArrayMPI3.cpp:226
void sync() const override
Synchronizes all process in this group and ensures any outstanding operations on the array have compl...
Definition: DistrArrayMPI3.cpp:120
void allocate_buffer()
Definition: DistrArrayMPI3.cpp:83
std::vector< value_type > vec() const override
Copies the whole buffer into a vector. Blocking.
Definition: DistrArrayMPI3.cpp:222
~DistrArrayMPI3() override
Definition: DistrArrayMPI3.cpp:29
friend void swap(DistrArrayMPI3 &a1, DistrArrayMPI3 &a2) noexcept
Definition: DistrArrayMPI3.cpp:74
MPI_Win m_win
window object
Definition: DistrArrayMPI3.h:23
void scatter_acc(std::vector< index_type > &indices, const std::vector< value_type > &data) override
array[indices[i]] += vals[i] Accumulates vals of elements into discontinuous indices of array....
Definition: DistrArrayMPI3.cpp:193
std::unique_ptr< Distribution > m_distribution
describes distribution of array among processes
Definition: DistrArrayMPI3.h:24
DistrArrayMPI3 & operator=(const DistrArrayMPI3 &source)
Definition: DistrArrayMPI3.cpp:56
Provides access to the local portion of the array.
Definition: DistrArray.h:123
Array distributed across many processes supporting remote-memory-access, access to process local buff...
Definition: DistrArray.h:90
double value_type
Definition: DistrArray.h:93
size_t index_type
Definition: DistrArray.h:94
Non-owning container taking a pointer to the data buffer and its size and exposing routines for itera...
Definition: Span.h:28
Specifies distribution of a contiguous array into non-overlapping chunks.
Definition: Distribution.h:16
Definition: ArrayHandler.h:22
Definition: DistrArrayMPI3.h:66
LocalBufferMPI3(DistrArrayMPI3 &source)
Definition: DistrArrayMPI3.cpp:234