Distributed array of integer flags with one flag per process and a locking mechanism to ensure atomic access. More...
#include <DistrFlags.h>
Distributed array of integer flags with one flag per process and a locking mechanism to ensure atomic access.
Classes | |
class | Proxy |
Proxy for accessing the stored flags. The flag on a given rank is locked on construction and unlocked on destruction. More... | |
Public Member Functions | |
DistrFlags ()=default | |
DistrFlags (const DistrFlags &source) | |
DistrFlags (DistrFlags &&source) noexcept | |
DistrFlags & | operator= (const DistrFlags &source) |
DistrFlags & | operator= (DistrFlags &&source) noexcept |
~DistrFlags () | |
DistrFlags (MPI_Comm comm, int value=0) | |
Construct the distributed array with initial value of flag. More... | |
bool | empty () const |
Whether distributed array was allocated. More... | |
Proxy | access () const |
Proxy | access (int rank) const |
MPI_Comm | communicator () const |
Protected Attributes | |
MPI_Comm | m_comm = {} |
mpi communicator More... | |
MPI_Win | m_win = MPI_WIN_NULL |
std::shared_ptr< int > | m_counter |
empty window handle More... | |
Friends | |
void | swap (DistrFlags &x, DistrFlags &y) |
|
default |
molpro::linalg::array::util::DistrFlags::DistrFlags | ( | const DistrFlags & | source | ) |
|
noexcept |
molpro::linalg::array::util::DistrFlags::~DistrFlags | ( | ) |
molpro::linalg::array::util::DistrFlags::DistrFlags | ( | MPI_Comm | comm, |
int | value = 0 |
||
) |
Construct the distributed array with initial value of flag.
DistrFlags::Proxy molpro::linalg::array::util::DistrFlags::access | ( | ) | const |
Access flag on current process through a proxy, locking access for all other processes until the proxy is destroyed. Cannot be called on an empty object.
DistrFlags::Proxy molpro::linalg::array::util::DistrFlags::access | ( | int | rank | ) | const |
Access flag on current process rank a proxy, locking access for all other processes until the proxy is destroyed. Cannot be called on an empty object.
|
inline |
bool molpro::linalg::array::util::DistrFlags::empty | ( | ) | const |
Whether distributed array was allocated.
DistrFlags & molpro::linalg::array::util::DistrFlags::operator= | ( | const DistrFlags & | source | ) |
|
noexcept |
|
friend |
|
protected |
mpi communicator
|
protected |
empty window handle
counter of Proxy objects created. They must all be destroyed before this can be destroyed
|
protected |