Classes | |
struct | ArrayHandlerError |
class | BufferManager |
BufferManager provides single-buffered or asynchronous double-buffered read access to the data in a collection of DistrArray objects. At construction, an amount of memory is allocated as a buffer, and the buffer is divided into one or more chunks that are independent windows on the data. Sequential access to the data is provided through iterators. More... | |
struct | CompareAbs |
class | DistrFlags |
Distributed array of integer flags with one flag per process and a locking mechanism to ensure atomic access. More... | |
class | Distribution |
Specifies distribution of a contiguous array into non-overlapping chunks. More... | |
struct | is_std_array |
struct | is_std_array< std::array< T, N > > |
class | LockMPI3 |
Atomic lock allowing only one process to acquire it. Implemented using MPI3 RMA. More... | |
struct | OperationRegister |
struct | RefEqual |
When called returns true if addresses of two references are the same. More... | |
class | ScopeLock |
Utility object that locks on creation and unlocks on destruction. More... | |
class | Task |
struct | TempHandle |
Static registrar of temporary handles. More... | |
Enumerations | |
enum | gemm_type { inner , outer } |
Functions | |
template<typename X , typename Y , typename Z , class EqualX , class EqualY , class EqualZ > | |
std::tuple< std::vector< std::tuple< size_t, size_t, size_t > >, std::vector< X >, std::vector< Y >, std::vector< Z > > | remove_duplicates (const std::list< std::tuple< X, Y, Z > > ®, EqualX equal_x, EqualY equal_y, EqualZ equal_z) |
Find duplicates references to x and y arrays and store unique elements in a separate vector. More... | |
template<class Compare > | |
std::list< std::pair< DistrArray::index_type, DistrArray::value_type > > | extrema (const DistrArray &x, int n) |
std::map< size_t, double > | select_max_dot_broadcast (size_t n, std::map< size_t, double > &local_selection, MPI_Comm communicator) |
template<typename Ind > | |
Distribution< Ind > | make_distribution_spread_remainder (size_t dimension, int n_chunks) |
Creates a distribution with first (dimension % n_chunks) chunks larger by 1 element. More... | |
template<class X , typename value_type , typename std::enable_if< std::is_compound< value_type >::value, value_type >::type * = nullptr> | |
auto | select (size_t n, const X &x, bool max=false, bool ignore_sign=false) |
Select n indices with largest (or smallest) actual (or absolute) value. More... | |
template<class X , typename value_type > | |
auto | select_sparse (size_t n, const X &x, bool max=false, bool ignore_sign=false) |
Select n indices with largest (or smallest) actual (or absolute) value. More... | |
template<class X , class Y , typename value_type , typename value_type_abs > | |
auto | select_max_dot (size_t n, const X &x, const Y &y) |
Select n indices with largest by absolute value contributions to the dot product. More... | |
template<class X , class Y , typename value_type , typename value_type_abs > | |
auto | select_max_dot_iter_sparse (size_t n, const X &x, const Y &y) |
Select n indices with largest by absolute value contributions to the dot product. More... | |
template<class X , class Y , typename value_type , typename value_type_abs > | |
auto | select_max_dot_sparse (size_t n, const X &x, const Y &y) |
Select n indices with largest by absolute value contributions to the dot product. More... | |
fs::path | temp_file_name (const fs::path &base_name, const std::string &suffix) |
Returns random file name for a temporary file. More... | |
template<class AL > | |
Matrix< typename array::mapped_or_value_type_t< AL > > | gemm_inner_distr_distr (const CVecRef< AL > &yy, const CVecRef< DistrArrayFile > &xx) |
template<class AL , typename = std::enable_if_t<!std::is_same_v<std::decay_t<AL>, DistrArrayFile>>> | |
Matrix< typename array::mapped_or_value_type_t< AL > > | gemm_inner_distr_distr (const CVecRef< DistrArrayFile > &xx, const CVecRef< AL > &yy) |
template<class AL > | |
void | gemm_outer_distr_distr (const Matrix< typename array::mapped_or_value_type_t< AL > > alphas, const CVecRef< DistrArrayFile > &xx, const VecRef< AL > &yy) |
template<class AL > | |
void | gemm_distr_distr (array::mapped_or_value_type_t< AL > *alphadata, const CVecRef< DistrArrayFile > &xx, const VecRef< AL > &yy, gemm_type gemm_type) |
template<class AL , class AR = AL> | |
Matrix< typename array::mapped_or_value_type_t< AL > > | gemm_inner_distr_distr (const CVecRef< AL > &xx, const CVecRef< AR > &yy) |
template<class AL , class AR = AL> | |
void | gemm_outer_distr_distr (const Matrix< typename array::mapped_or_value_type_t< AL > > alphas, const CVecRef< AR > &xx, const VecRef< AL > &yy) |
template<class AL , class AR = AL> | |
void | gemm_outer_distr_sparse (const Matrix< typename array::mapped_or_value_type_t< AL > > alphas, const CVecRef< AR > &xx, const VecRef< AL > &yy) |
template<class AL , class AR = AL> | |
Matrix< typename array::mapped_or_value_type_t< AL > > | gemm_inner_distr_sparse (const CVecRef< AL > &xx, const CVecRef< AR > &yy) |
template<class Handler , class AL , class AR = AL> | |
void | gemm_outer_default (Handler &handler, const Matrix< typename Handler::value_type > alphas, const CVecRef< AR > &xx, const VecRef< AL > &yy) |
template<class Handler , class AL , class AR = AL> | |
Matrix< typename Handler::value_type > | gemm_inner_default (Handler &handler, const CVecRef< AL > &xx, const CVecRef< AR > &yy) |
void | gather_all (const Distribution< size_t > &distr, MPI_Comm commun, double *first_elem) |
Replicate data of a full container on all the processes based on distributed pieces. More... | |
void | swap (DistrFlags &x, DistrFlags &y) |
Variables | |
template<typename T > | |
constexpr bool | is_std_array_v = is_std_array<T>::value |
template<typename T > | |
constexpr bool | is_array_v = std::is_array<T>::value || is_std_array_v<T> |
int | s_temp_file_name_count = 0 |
std::mutex | s_mutex |
std::list< std::pair< DistrArray::index_type, DistrArray::value_type > > molpro::linalg::array::util::extrema | ( | const DistrArray & | x, |
int | n | ||
) |
void molpro::linalg::array::util::gather_all | ( | const Distribution< size_t > & | distr, |
MPI_Comm | commun, | ||
double * | first_elem | ||
) |
Replicate data of a full container on all the processes based on distributed pieces.
distr | distribution of the container, which local data chuncks are to be replicated |
commun | MPI communicator |
first_elem | pointer to the beginning of the container, which data to be replicated |
void molpro::linalg::array::util::gemm_distr_distr | ( | array::mapped_or_value_type_t< AL > * | alphadata, |
const CVecRef< DistrArrayFile > & | xx, | ||
const VecRef< AL > & | yy, | ||
gemm_type | gemm_type | ||
) |
Matrix< typename Handler::value_type > molpro::linalg::array::util::gemm_inner_default | ( | Handler & | handler, |
const CVecRef< AL > & | xx, | ||
const CVecRef< AR > & | yy | ||
) |
Matrix< typename array::mapped_or_value_type_t< AL > > molpro::linalg::array::util::gemm_inner_distr_distr | ( | const CVecRef< AL > & | xx, |
const CVecRef< AR > & | yy | ||
) |
Matrix< typename array::mapped_or_value_type_t< AL > > molpro::linalg::array::util::gemm_inner_distr_distr | ( | const CVecRef< AL > & | yy, |
const CVecRef< DistrArrayFile > & | xx | ||
) |
Matrix< typename array::mapped_or_value_type_t< AL > > molpro::linalg::array::util::gemm_inner_distr_distr | ( | const CVecRef< DistrArrayFile > & | xx, |
const CVecRef< AL > & | yy | ||
) |
Matrix< typename array::mapped_or_value_type_t< AL > > molpro::linalg::array::util::gemm_inner_distr_sparse | ( | const CVecRef< AL > & | xx, |
const CVecRef< AR > & | yy | ||
) |
void molpro::linalg::array::util::gemm_outer_default | ( | Handler & | handler, |
const Matrix< typename Handler::value_type > | alphas, | ||
const CVecRef< AR > & | xx, | ||
const VecRef< AL > & | yy | ||
) |
void molpro::linalg::array::util::gemm_outer_distr_distr | ( | const Matrix< typename array::mapped_or_value_type_t< AL > > | alphas, |
const CVecRef< AR > & | xx, | ||
const VecRef< AL > & | yy | ||
) |
void molpro::linalg::array::util::gemm_outer_distr_distr | ( | const Matrix< typename array::mapped_or_value_type_t< AL > > | alphas, |
const CVecRef< DistrArrayFile > & | xx, | ||
const VecRef< AL > & | yy | ||
) |
void molpro::linalg::array::util::gemm_outer_distr_sparse | ( | const Matrix< typename array::mapped_or_value_type_t< AL > > | alphas, |
const CVecRef< AR > & | xx, | ||
const VecRef< AL > & | yy | ||
) |
Distribution< Ind > molpro::linalg::array::util::make_distribution_spread_remainder | ( | size_t | dimension, |
int | n_chunks | ||
) |
Creates a distribution with first (dimension % n_chunks) chunks larger by 1 element.
Ind | integer type for indexing the array |
dimension | number of elements in array |
n_chunks | number of chunks to subdivide the array into |
std::tuple< std::vector< std::tuple< size_t, size_t, size_t > >, std::vector< X >, std::vector< Y >, std::vector< Z > > molpro::linalg::array::util::remove_duplicates | ( | const std::list< std::tuple< X, Y, Z > > & | reg, |
EqualX | equal_x, | ||
EqualY | equal_y, | ||
EqualZ | equal_z | ||
) |
Find duplicates references to x and y arrays and store unique elements in a separate vector.
Vector of scalars is returned complete without truncation. The register becomes a vector of pairs, first element of a pair containing index of x array in the vector of unique x arrays, the second is for y arrays.
auto molpro::linalg::array::util::select | ( | size_t | n, |
const X & | x, | ||
bool | max = false , |
||
bool | ignore_sign = false |
||
) |
Select n indices with largest (or smallest) actual (or absolute) value.
X | type of array, must be iterable complete array |
value_type | type for X elements |
value_type_abs | type for absolute value of value_type |
n | number of indices to select |
x | array to examine |
max | If true, select largest values, otherwise smallest |
ignore_sign | If true, consider std::abs() of elements |
auto molpro::linalg::array::util::select_max_dot | ( | size_t | n, |
const X & | x, | ||
const Y & | y | ||
) |
Select n indices with largest by absolute value contributions to the dot product.
X | type of left array, must be iterable complete array |
Y | type of right array, must be iterable complete array |
value_type | type for product of X and Y elements |
value_type_abs | type for absolute value of value_type |
n | number of indices to select |
x | left array |
y | right array |
std::map< size_t, double > molpro::linalg::array::util::select_max_dot_broadcast | ( | size_t | n, |
std::map< size_t, double > & | local_selection, | ||
MPI_Comm | communicator | ||
) |
auto molpro::linalg::array::util::select_max_dot_iter_sparse | ( | size_t | n, |
const X & | x, | ||
const Y & | y | ||
) |
Select n indices with largest by absolute value contributions to the dot product.
X | type of left array, must be random access container |
Y | type of right array, must be a sparse array |
value_type | type for product of X and Y elements |
value_type_abs | type for absolute value of value_type |
n | number of indices to select |
x | left array |
y | right array |
auto molpro::linalg::array::util::select_max_dot_sparse | ( | size_t | n, |
const X & | x, | ||
const Y & | y | ||
) |
Select n indices with largest by absolute value contributions to the dot product.
X | type of left array, must be a sparse array |
Y | type of right array, must be a sparse array |
value_type | type for product of X and Y elements |
value_type_abs | type for absolute value of value_type |
n | number of indices to select |
x | left array |
y | right array |
auto molpro::linalg::array::util::select_sparse | ( | size_t | n, |
const X & | x, | ||
bool | max = false , |
||
bool | ignore_sign = false |
||
) |
Select n indices with largest (or smallest) actual (or absolute) value.
X | type of array, must be iterable complete array |
value_type | type for X elements |
n | number of indices to select |
x | array to examine |
max | If true, select largest values, otherwise smallest |
ignore_sign | If true, consider std::abs() of elements |
Select n indices with largest (or smallest) actual (or absolute) value
X | type of array, must be iterable complete array |
value_type | type for X elements |
value_type_abs | type for absolute value of value_type |
n | number of indices to select |
x | array to examine |
max | If true, select largest values, otherwise smallest |
ignore_sign | If true, consider std::abs() of elements |
void molpro::linalg::array::util::swap | ( | DistrFlags & | x, |
DistrFlags & | y | ||
) |
fs::path molpro::linalg::array::util::temp_file_name | ( | const fs::path & | base_name, |
const std::string & | suffix | ||
) |
Returns random file name for a temporary file.
base_name | base name for the file, after which a random character string will follow |
suffix | suffix to add to the file name e.g. ".hdf5" |
|
constexpr |
|
constexpr |
std::mutex molpro::linalg::array::util::s_mutex |
int molpro::linalg::array::util::s_temp_file_name_count = 0 |