Distributed array storing the buffer on disk using temporary local files.
On construction, file and corresponding stream object are created and file is then closed. On destruction, file is deleted.
- Warning
- Only local operations will be currently supported, if RMA operations are requested, exception will be thrown.
- Examples
- LinearEigensystemDistrArrayExample.cpp, and OptimizeDistrArrayExample.cpp.
|
| DistrArrayFile ()=delete |
| returns local array boundaries and size More...
|
|
| DistrArrayFile (const DistrArrayFile &source) |
|
| DistrArrayFile (DistrArrayFile &&source) |
|
| DistrArrayFile (size_t dimension, MPI_Comm comm=comm_global(), const std::string &directory=".") |
|
| DistrArrayFile (std::unique_ptr< Distribution > distribution, MPI_Comm comm=comm_global(), const std::string &directory=".") |
|
| DistrArrayFile (const DistrArray &source) |
|
DistrArrayFile & | operator= (const DistrArrayFile &source)=delete |
|
DistrArrayFile & | operator= (DistrArrayFile &&source) noexcept |
|
| ~DistrArrayFile () override |
|
bool | compatible (const DistrArrayFile &source) const |
|
void | erase () override |
| Dummy. More...
|
|
value_type | at (index_type ind) const override |
|
void | set (index_type ind, value_type val) override |
| Writes value at a given index. More...
|
|
void | get (index_type lo, index_type hi, value_type *buf) const override |
| Reads requested values. More...
|
|
std::vector< value_type > | get (index_type lo, index_type hi) const override |
|
void | put (index_type lo, index_type hi, const value_type *data) override |
| Writes requested values to file. More...
|
|
void | acc (index_type lo, index_type hi, const value_type *data) override |
|
std::vector< value_type > | gather (const std::vector< index_type > &indices) const override |
| gets elements with discontinuous indices from array. Blocking More...
|
|
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. Blocking. More...
|
|
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. Atomic, blocking, with on-sided communication More...
|
|
std::vector< value_type > | vec () const override |
| Copies the whole buffer into a vector. Blocking. More...
|
|
virtual void | erase ()=0 |
| Erase the array from disk. More...
|
|
const Distribution & | distribution () const override |
| Access distribution of the array among processes. More...
|
|
value_type | dot (const DistrArrayDisk &y) const |
|
value_type | dot (const DistrArray &y) const override |
| Scalar product of two arrays. Collective. Throws error if any array is empty. Both arrays should be part of the same processor group (same communicator). The result is broadcast to each process. More...
|
|
value_type | dot (const SparseArray &y) const override |
|
void | set_buffer_size (size_t buffer_size) |
|
void | copy (const DistrArray &y) override |
|
std::unique_ptr< LocalBuffer > | local_buffer () override |
| Access the buffer local to this process. More...
|
|
std::unique_ptr< const LocalBuffer > | local_buffer () const override |
|
std::unique_ptr< LocalBuffer > | local_buffer (const span::Span< value_type > &buffer) |
| Access local section, reading it into the provided buffer. More...
|
|
std::unique_ptr< const LocalBuffer > | local_buffer (const span::Span< value_type > &buffer) const |
| Read-only access to the local section, reading it into the provided buffer. More...
|
|
virtual | ~DistrArray ()=default |
|
MPI_Comm | communicator () const |
| return a copy of the communicator More...
|
|
virtual void | sync () const |
| Synchronizes all process in this group and ensures any outstanding operations on the array have completed. More...
|
|
size_t | size () const |
| total number of elements, same as overall dimension of array More...
|
|
bool | compatible (const DistrArray &other) const |
| Checks that arrays are of the same dimensionality. More...
|
|
virtual void | zero () |
| Set all local elements to zero. More...
|
|
virtual void | error (const std::string &message) const |
| stops application with an error More...
|
|
value_type | operator[] (size_t index) |
|
virtual void | fill (value_type val) |
|
virtual void | copy_patch (const DistrArray &y, index_type start, index_type end) |
| Copies elements in a patch of y. If both arrays are empty than does nothing. If only one is empty, throws an error. More...
|
|
virtual void | axpy (value_type a, const DistrArray &y) |
| this[:] += a * y[:]. Throws an error if any array is empty. Add a multiple of another array to this one. Blocking, collective. More...
|
|
virtual void | axpy (value_type a, const SparseArray &y) |
|
virtual void | scal (value_type a) |
| Scale by a constant. Local. More...
|
|
virtual void | add (const DistrArray &y) |
| Add another array to this. Local. Throws error if any array is empty. More...
|
|
virtual void | add (value_type a) |
| Add a constant. Local. More...
|
|
virtual void | sub (const DistrArray &y) |
| Subtract another array from this. Local. Throws error if any array is empty. More...
|
|
virtual void | sub (value_type a) |
| Subtract a constant. Local. More...
|
|
virtual void | recip () |
| Take element-wise reciprocal of this. Local. No checks are made for zero values. More...
|
|
virtual void | times (const DistrArray &y) |
| this[i] *= y[i]. Throws error if any array is empty. More...
|
|
virtual void | times (const DistrArray &y, const DistrArray &z) |
| this[i] = y[i]*z[i]. Throws error if any array is empty. More...
|
|
void | divide (const DistrArray &y, const DistrArray &z, value_type shift=0, bool append=false, bool negative=false) |
| this[i] = y[i]/(z[i]+shift). Collective. Throws error if any array is empty. More...
|
|
std::list< std::pair< index_type, value_type > > | min_n (int n) const |
| returns n smallest elements in array x Collective operation, must be called by all processes in the group. More...
|
|
std::list< std::pair< index_type, value_type > > | max_n (int n) const |
| returns n largest elements in array x Collective operation, must be called by all processes in the group. More...
|
|
std::list< std::pair< index_type, value_type > > | min_abs_n (int n) const |
| returns n elements that are largest by absolute value in array x Collective operation, must be called by all processes in the group. More...
|
|
std::list< std::pair< index_type, value_type > > | max_abs_n (int n) const |
| returns n elements that are largest by absolute value in array x Collective operation, must be called by all processes in the group. More...
|
|
std::vector< index_type > | min_loc_n (int n) const |
| find the index of n smallest components in array x Collective operation, must be called by all processes in the group. More...
|
|
std::map< size_t, value_type > | select_max_dot (size_t n, const DistrArray &y) const |
|
std::map< size_t, value_type > | select_max_dot (size_t n, const SparseArray &y) const |
|
std::map< size_t, value_type > | select (size_t n, bool max=false, bool ignore_sign=false) const |
|