TiledArray
0.7.0
|
Forward declarations. More...
#include <clone.h>
Public Member Functions | |
DistArray () | |
Default constructor. More... | |
DistArray (const DistArray_ &other) | |
Copy constructor. More... | |
DistArray (World &world, const trange_type &trange, const std::shared_ptr< pmap_interface > &pmap=std::shared_ptr< pmap_interface >()) | |
Dense array constructor. More... | |
DistArray (World &world, const trange_type &trange, const shape_type &shape, const std::shared_ptr< pmap_interface > &pmap=std::shared_ptr< pmap_interface >()) | |
Sparse array constructor. More... | |
template<typename OtherTile , typename = std::enable_if_t<not std::is_same<DistArray_,DistArray<OtherTile,Policy>>::value>> | |
DistArray (const DistArray< OtherTile, Policy > &other) | |
converting copy constructor More... | |
template<typename OtherTile , typename Op > | |
DistArray (const DistArray< OtherTile, Policy > &other, Op &&op) | |
Unary transform constructor. More... | |
~DistArray () | |
Destructor. More... | |
DistArray_ | clone () const |
Create a deep copy of this array. More... | |
DistArray_ & | operator= (const DistArray_ &other) |
Copy constructor. More... | |
madness::uniqueidT | id () const |
Global object id. More... | |
iterator | begin () |
Begin iterator factory function. More... | |
const_iterator | begin () const |
Begin const iterator factory function. More... | |
iterator | end () |
End iterator factory function. More... | |
const_iterator | end () const |
End const iterator factory function. More... | |
template<typename Index > | |
Future< value_type > | find (const Index &i) const |
Find local or remote tile. More... | |
template<typename Integer > | |
Future< value_type > | find (const std::initializer_list< Integer > &i) const |
Find local or remote tile. More... | |
template<typename Index , typename InIter > | |
std::enable_if< detail::is_input_iterator< InIter >::value >::type | set (const Index &i, InIter first) |
Set a tile and fill it using a sequence. More... | |
template<typename Integer , typename InIter > | |
std::enable_if< detail::is_input_iterator< InIter >::value >::type | set (const std::initializer_list< Integer > &i, InIter first) |
Set a tile and fill it using a sequence. More... | |
template<typename Index > | |
void | set (const Index &i, const element_type &value=element_type()) |
Set a tile and fill it using a value. More... | |
template<typename Integer > | |
void | set (const std::initializer_list< Integer > &i, const element_type &value=element_type()) |
Set a tile and fill it using a value. More... | |
template<typename Index > | |
void | set (const Index &i, const Future< value_type > &f) |
Set a tile directly using a future. More... | |
template<typename Integer > | |
void | set (const std::initializer_list< Integer > &i, const Future< value_type > &f) |
Set a tile directly using a future. More... | |
template<typename Index > | |
void | set (const Index &i, const value_type &v) |
Set a tile using a Tile object. More... | |
template<typename Integer > | |
void | set (const std::initializer_list< Integer > &i, const value_type &v) |
Set a tile using a Tile object. More... | |
void | fill_local (const element_type &value=element_type(), bool skip_set=false) |
Fill all local tiles. More... | |
void | fill (const element_type &value=element_type(), bool skip_set=false) |
Fill all local tiles. More... | |
void | fill_random (bool skip_set=false) |
template<typename Op > | |
void | init_tiles (Op &&op, bool skip_set=false) |
Initialize (local) tiles with a user provided functor. More... | |
template<typename Op > | |
void | init_elements (Op &&op, bool skip_set=false) |
Initialize (local) elements with a user provided functor. More... | |
const trange_type & | trange () const |
Tiled range accessor. More... | |
const range_type & | range () const |
Tile range accessor. More... | |
DEPRECATED const trange_type::range_type & | elements () const |
const trange_type::range_type & | elements_range () const |
Element range accessor. More... | |
size_type | size () const |
TiledArray::expressions::TsrExpr< const DistArray_, true > | operator() (const std::string &vars) const |
Create a tensor expression. More... | |
TiledArray::expressions::TsrExpr< DistArray_, true > | operator() (const std::string &vars) |
Create a tensor expression. More... | |
DEPRECATED World & | get_world () const |
World & | world () const |
World accessor. More... | |
DEPRECATED const std::shared_ptr< pmap_interface > & | get_pmap () const |
const std::shared_ptr< pmap_interface > & | pmap () const |
Process map accessor. More... | |
bool | is_dense () const |
Check dense/sparse. More... | |
DEPRECATED const shape_type & | get_shape () const |
const shape_type & | shape () const |
Shape accessor. More... | |
template<typename Index > | |
ProcessID | owner (const Index &i) const |
Tile ownership. More... | |
template<typename Index1 > | |
ProcessID | owner (const std::initializer_list< Index1 > &i) const |
Tile ownership. More... | |
template<typename Index > | |
bool | is_local (const Index &i) const |
Check if the tile at index i is stored locally. More... | |
template<typename Index1 > | |
bool | is_local (const std::initializer_list< Index1 > &i) const |
Check if the tile at index i is stored locally. More... | |
template<typename Index > | |
bool | is_zero (const Index &i) const |
Check for zero tiles. More... | |
template<typename Index1 > | |
bool | is_zero (const std::initializer_list< Index1 > &i) const |
Check for zero tiles. More... | |
void | swap (DistArray_ &other) |
Swap this array with other . More... | |
void | make_replicated () |
Convert a distributed array into a replicated array. More... | |
void | truncate () |
Update shape data and remove tiles that are below the zero threshold. More... | |
bool | is_initialized () const |
Check if the array is initialized. More... | |
Static Public Member Functions | |
static void | wait_for_lazy_cleanup (World &world, const double=60.0) |
Wait for lazy tile cleanup. More... | |
Forward declarations.
A (multidimensional) tiled array.
DistArray is the local representation of a global object. This means that the local array object will only contain a portion of the data. It may be used to construct distributed tensor algebraic operations.
T | The element type of for array tiles |
Tile | The tile type [ Default = Tensor<T> ] |
typedef impl_type::const_iterator TiledArray::DistArray< Tile, Policy >::const_iterator |
Local tile const iterator.
Definition at line 70 of file dist_array.h.
typedef impl_type::const_reference TiledArray::DistArray< Tile, Policy >::const_reference |
future
type
Definition at line 68 of file dist_array.h.
typedef DistArray<Tile, Policy> TiledArray::DistArray< Tile, Policy >::DistArray_ |
This object's type.
Definition at line 54 of file dist_array.h.
typedef detail::numeric_type<Tile>::type TiledArray::DistArray< Tile, Policy >::element_type |
The tile element type.
Definition at line 57 of file dist_array.h.
typedef impl_type::eval_type TiledArray::DistArray< Tile, Policy >::eval_type |
The tile evaluation type.
Definition at line 65 of file dist_array.h.
typedef impl_type::reference TiledArray::DistArray< Tile, Policy >::future |
Future of value_type
.
Definition at line 66 of file dist_array.h.
typedef TiledArray::detail::ArrayImpl<Tile, Policy> TiledArray::DistArray< Tile, Policy >::impl_type |
Definition at line 55 of file dist_array.h.
typedef impl_type::range_type::index TiledArray::DistArray< Tile, Policy >::index |
Array coordinate index type.
Definition at line 62 of file dist_array.h.
typedef impl_type::iterator TiledArray::DistArray< Tile, Policy >::iterator |
Local tile iterator.
Definition at line 69 of file dist_array.h.
typedef impl_type::pmap_interface TiledArray::DistArray< Tile, Policy >::pmap_interface |
Process map interface type.
Definition at line 71 of file dist_array.h.
typedef impl_type::policy_type TiledArray::DistArray< Tile, Policy >::policy_type |
Policy type.
Definition at line 56 of file dist_array.h.
typedef impl_type::range_type TiledArray::DistArray< Tile, Policy >::range_type |
Elements/tiles range type.
Definition at line 60 of file dist_array.h.
typedef impl_type::reference TiledArray::DistArray< Tile, Policy >::reference |
future
type
Definition at line 67 of file dist_array.h.
typedef detail::scalar_type<Tile>::type TiledArray::DistArray< Tile, Policy >::scalar_type |
The tile scalar type.
Definition at line 58 of file dist_array.h.
typedef impl_type::shape_type TiledArray::DistArray< Tile, Policy >::shape_type |
Shape type for array tiling.
Definition at line 61 of file dist_array.h.
typedef impl_type::size_type TiledArray::DistArray< Tile, Policy >::size_type |
Size type.
Definition at line 63 of file dist_array.h.
typedef impl_type::trange_type TiledArray::DistArray< Tile, Policy >::trange_type |
Tile range type.
Definition at line 59 of file dist_array.h.
typedef impl_type::value_type TiledArray::DistArray< Tile, Policy >::value_type |
Tile type.
Definition at line 64 of file dist_array.h.
|
inline |
Default constructor.
Constructs an uninitialized array object. Uninitialized arrays contain no tile or meta data. Most of the functions are not available when the array is uninitialized, but these arrays may be assign via a tensor expression assignment or the copy construction.
Definition at line 171 of file dist_array.h.
|
inline |
Copy constructor.
This is a shallow copy, that is no data is copied.
other | The array to be copied |
Definition at line 177 of file dist_array.h.
|
inline |
Dense array constructor.
Constructs an array with the given meta data. This constructor only initializes the array meta data; the array tiles are empty and must be assigned by the user.
world | The world where the array will live. |
trange | The tiled range object that will be used to set the array tiling. |
pmap | The tile index -> process map |
Definition at line 187 of file dist_array.h.
|
inline |
Sparse array constructor.
Constructs an array with the given meta data. This constructor only initializes the array meta data; the array tiles are empty and must be assigned by the user.
world | The world where the array will live. |
trange | The tiled range object that will be used to set the array tiling. |
shape | The array shape that defines zero and non-zero tiles |
pmap | The tile index -> process map |
Definition at line 201 of file dist_array.h.
|
inlineexplicit |
converting copy constructor
This constructor uses the meta data of other
to initialize the meta data of the new array. In addition, the tiles of the new array are also initialized using TiledArray::Cast<Tile,OtherTile>
other | The array to be copied |
Definition at line 213 of file dist_array.h.
|
inline |
Unary transform constructor.
This constructor uses the meta data of other
to initialize the meta data of the new array. In addition, the tiles of the new array are also initialized using the op
function/functor, which transforms each tile in other
using op
other | The array to be copied |
Definition at line 227 of file dist_array.h.
|
inline |
Destructor.
This is a distributed lazy destructor. The object will only be deleted after the last reference to the world object on all nodes has been destroyed.
Definition at line 238 of file dist_array.h.
|
inline |
Begin iterator factory function.
Definition at line 288 of file dist_array.h.
|
inline |
Begin const iterator factory function.
Definition at line 296 of file dist_array.h.
|
inline |
Create a deep copy of this array.
Definition at line 243 of file dist_array.h.
|
inline |
|
inline |
Element range accessor.
Definition at line 568 of file dist_array.h.
|
inline |
End iterator factory function.
Definition at line 304 of file dist_array.h.
|
inline |
End const iterator factory function.
Definition at line 312 of file dist_array.h.
|
inline |
Fill all local tiles.
value | The fill value |
skip_set | If false, will throw if any tiles are already set |
Definition at line 445 of file dist_array.h.
|
inline |
Fill all local tiles.
value | The fill value |
skip_set | If false, will throw if any tiles are already set |
Definition at line 436 of file dist_array.h.
|
inline |
Fill all local tiles with random values obtained as
skip_set | If false, will throw if any tiles are already set |
Definition at line 451 of file dist_array.h.
|
inline |
Find local or remote tile.
Index | The index type |
i | The tile index |
future
to tile i
TiledArray::Exception | When tile i is zero |
Definition at line 324 of file dist_array.h.
|
inline |
Find local or remote tile.
Integer | An integer type |
i | The tile index, as an std::initializer_list<Integer> |
future
to tile i
TiledArray::Exception | When tile i is zero |
Definition at line 336 of file dist_array.h.
|
inline |
Definition at line 639 of file dist_array.h.
|
inline |
Definition at line 661 of file dist_array.h.
|
inline |
Definition at line 625 of file dist_array.h.
|
inline |
Global object id.
Definition at line 283 of file dist_array.h.
|
inline |
Initialize (local) elements with a user provided functor.
This function is used to initialize elements of the array via a function (or functor). The work is done in parallel, therefore op
must be a thread safe function/functor. The signature of the functor should be:
For example, in the following code, the array elements are initialized with random numbers from 0 to 1:
Op | Element generator type |
op | The operation used to generate elements |
skip_set | If false, will throw if any tiles are already set |
Definition at line 530 of file dist_array.h.
|
inline |
Initialize (local) tiles with a user provided functor.
This function is used to initialize tiles of the array via a function (or functor). The work is done in parallel, therefore op
must be a thread safe function/functor. The signature of the functor should be:
For example, in the following code, the array tiles are initialized with random numbers from 0 to 1:
Op | Tile operation type |
op | The operation used to generate tiles |
skip_set | If false, will throw if any tiles are already set |
Definition at line 488 of file dist_array.h.
|
inline |
Check dense/sparse.
true
when Array
is dense, false
otherwise. Definition at line 655 of file dist_array.h.
|
inline |
Check if the array is initialized.
false
if the array has been default initialized, otherwise true
. Definition at line 773 of file dist_array.h.
|
inline |
Check if the tile at index i
is stored locally.
Index | A coordinate or ordinal index type |
i | The coordinate or ordinal index of the tile to be checked |
true
if owner(i)
is equal to the MPI process rank, otherwise false
. Definition at line 702 of file dist_array.h.
|
inline |
Check if the tile at index i
is stored locally.
Index | A coordinate or ordinal index type |
i | The coordinate or ordinal index of the tile to be checked |
true
if owner(i)
is equal to the MPI process rank, otherwise false
. Definition at line 714 of file dist_array.h.
|
inline |
Check for zero tiles.
true
if tile at index i
is zero, false if the tile is non-zero or remote existence data is not available. Definition at line 723 of file dist_array.h.
|
inline |
Check for zero tiles.
true
if tile at index i
is zero, false if the tile is non-zero or remote existence data is not available. Definition at line 733 of file dist_array.h.
|
inline |
Convert a distributed array into a replicated array.
Definition at line 743 of file dist_array.h.
|
inline |
Create a tensor expression.
vars | A string with a comma-separated list of variables |
Definition at line 583 of file dist_array.h.
|
inline |
Create a tensor expression.
vars | A string with a comma-separated list of variables |
Definition at line 606 of file dist_array.h.
|
inline |
Copy constructor.
This is a shallow copy, that is no data is copied.
other | The array to be copied |
Definition at line 272 of file dist_array.h.
|
inline |
Tile ownership.
Index | An index type |
i | The index of a tile |
Definition at line 678 of file dist_array.h.
|
inline |
Tile ownership.
Index | An index type |
i | The index of a tile |
Definition at line 691 of file dist_array.h.
|
inline |
Process map accessor.
Definition at line 647 of file dist_array.h.
|
inline |
Tile range accessor.
Definition at line 555 of file dist_array.h.
|
inline |
Set a tile and fill it using a sequence.
Index | An index or integral type |
InIter | An input iterator |
i | The index or the ordinal of the tile to be set |
first | The iterator that points to the start of the input sequence |
Definition at line 348 of file dist_array.h.
|
inline |
Set a tile and fill it using a sequence.
Integer | An integral type |
InIter | An input iterator |
i | The tile index, as an std::initializer_list<Integer> |
first | The iterator that points to the new tile data |
Definition at line 361 of file dist_array.h.
|
inline |
Set a tile and fill it using a value.
Index | An index or integral type |
InIter | An input iterator |
i | The index or the ordinal of the tile to be set |
value | the value used to fill the tile |
Definition at line 372 of file dist_array.h.
|
inline |
Set a tile and fill it using a value.
Integer | An integral type |
InIter | An input iterator |
i | The tile index, as an std::initializer_list<Integer> |
value | the value used to fill the tile |
Definition at line 384 of file dist_array.h.
|
inline |
Set a tile directly using a future.
Index | An index or integral type |
i | The index or the ordinal of the tile to be set |
f | A future to the tile |
Definition at line 395 of file dist_array.h.
|
inline |
Set a tile directly using a future.
Integer | An integral type |
i | The tile index, as an std::initializer_list<Integer> |
f | A future to the tile |
Definition at line 406 of file dist_array.h.
|
inline |
Set a tile using a Tile object.
Index | An index or integral type |
i | The tile index to be set |
v | The tile value |
Definition at line 417 of file dist_array.h.
|
inline |
Set a tile using a Tile object.
Integer | An integral type |
i | The tile index, as an std::initializer_list<Integer> |
v | The tile value |
Definition at line 428 of file dist_array.h.
|
inline |
Shape accessor.
Returns shape object. No communication is required.
TiledArray::Exception | When the Array is dense. |
Definition at line 668 of file dist_array.h.
|
inline |
|
inline |
Swap this array with other
.
other | The array to be swapped with this array. |
Definition at line 740 of file dist_array.h.
|
inline |
Tiled range accessor.
Definition at line 547 of file dist_array.h.
|
inline |
Update shape data and remove tiles that are below the zero threshold.
Definition at line 767 of file dist_array.h.
|
inlinestatic |
Wait for lazy tile cleanup.
This function will wait for cleanup of tile data that has been scheduled for lazy deletion. Ready tasks will be executed by this function while waiting for cleanup. This function will timeout if the wait time exceeds the timeout specified in the MAD_WAIT_TIMEOUT
environment variable. The default timeout is 900 seconds.
world | The world that to be used to execute ready tasks. |
madness::MadnessException | When timeout has been exceeded. |
Definition at line 256 of file dist_array.h.
|
inline |
World accessor.
Definition at line 633 of file dist_array.h.