TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
#include <nda/mpi/scatter.hpp>
Specialization of the mpi::lazy
class for nda::Array types and the mpi::tag::scatter
tag.
An object of this class is returned when scattering nda::Array objects across multiple MPI processes.
It models an nda::ArrayInitializer, that means it can be used to initialize and assign to nda::basic_array and nda::basic_array_view objects. The input array will be a chunked along its first dimension using mpi::chunk_length
.
See nda::mpi_scatter for an example.
A | nda::Array type to be scattered. |
Definition at line 49 of file scatter.hpp.
Public Member Functions | |
template<nda::Array T> | |
void | invoke (T &&target) const |
Execute the lazy MPI operation and write the result to a target array/view. | |
auto | shape () const |
Compute the shape of the target array. | |
Public Attributes | |
const bool | all {false} |
Should all processes receive the result. (doesn't make sense for scatter) | |
mpi::communicator | comm |
MPI communicator. | |
const_view_type | rhs |
View of the array/view to be scattered. | |
const int | root {0} |
MPI root process. | |
|
inline |
Execute the lazy MPI operation and write the result to a target array/view.
T | nda::Array type of the target array/view. |
target | Target array/view. |
Definition at line 93 of file scatter.hpp.
|
inlinenodiscard |
Compute the shape of the target array.
The target shape will be the same as the input shape, except that the first dimension of the input array is chunked into equal (as much as possible) parts using mpi::chunk_length
and assigned to each MPI process.
Definition at line 78 of file scatter.hpp.