TiledArray  0.7.0
TiledArray::DistArray< Tile, Policy > Class Template Reference

Forward declarations. More...

#include <clone.h>

Public Types

typedef DistArray< Tile, Policy > DistArray_
 This object's type. More...
 
typedef TiledArray::detail::ArrayImpl< Tile, Policy > impl_type
 
typedef impl_type::policy_type policy_type
 Policy type. More...
 
typedef detail::numeric_type< Tile >::type element_type
 The tile element type. More...
 
typedef detail::scalar_type< Tile >::type scalar_type
 The tile scalar type. More...
 
typedef impl_type::trange_type trange_type
 Tile range type. More...
 
typedef impl_type::range_type range_type
 Elements/tiles range type. More...
 
typedef impl_type::shape_type shape_type
 Shape type for array tiling. More...
 
typedef impl_type::range_type::index index
 Array coordinate index type. More...
 
typedef impl_type::size_type size_type
 Size type. More...
 
typedef impl_type::value_type value_type
 Tile type. More...
 
typedef impl_type::eval_type eval_type
 The tile evaluation type. More...
 
typedef impl_type::reference future
 Future of value_type. More...
 
typedef impl_type::reference reference
 future type More...
 
typedef impl_type::const_reference const_reference
 future type More...
 
typedef impl_type::iterator iterator
 Local tile iterator. More...
 
typedef impl_type::const_iterator const_iterator
 Local tile const iterator. More...
 
typedef impl_type::pmap_interface pmap_interface
 Process map interface type. More...
 

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_typefind (const Index &i) const
 Find local or remote tile. More...
 
template<typename Integer >
Future< value_typefind (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_typetrange () const
 Tiled range accessor. More...
 
const range_typerange () 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_typeget_shape () const
 
const shape_typeshape () 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...
 

Detailed Description

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
class TiledArray::DistArray< Tile, Policy >

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.

Template Parameters
TThe element type of for array tiles
TileThe tile type [ Default = Tensor<T> ]

Definition at line 32 of file clone.h.

Member Typedef Documentation

◆ const_iterator

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::const_iterator TiledArray::DistArray< Tile, Policy >::const_iterator

Local tile const iterator.

Definition at line 70 of file dist_array.h.

◆ const_reference

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::const_reference TiledArray::DistArray< Tile, Policy >::const_reference

future type

Definition at line 68 of file dist_array.h.

◆ DistArray_

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef DistArray<Tile, Policy> TiledArray::DistArray< Tile, Policy >::DistArray_

This object's type.

Definition at line 54 of file dist_array.h.

◆ element_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
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.

◆ eval_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::eval_type TiledArray::DistArray< Tile, Policy >::eval_type

The tile evaluation type.

Definition at line 65 of file dist_array.h.

◆ future

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::reference TiledArray::DistArray< Tile, Policy >::future

Future of value_type.

Definition at line 66 of file dist_array.h.

◆ impl_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef TiledArray::detail::ArrayImpl<Tile, Policy> TiledArray::DistArray< Tile, Policy >::impl_type

Definition at line 55 of file dist_array.h.

◆ index

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::range_type::index TiledArray::DistArray< Tile, Policy >::index

Array coordinate index type.

Definition at line 62 of file dist_array.h.

◆ iterator

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::iterator TiledArray::DistArray< Tile, Policy >::iterator

Local tile iterator.

Definition at line 69 of file dist_array.h.

◆ pmap_interface

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::pmap_interface TiledArray::DistArray< Tile, Policy >::pmap_interface

Process map interface type.

Definition at line 71 of file dist_array.h.

◆ policy_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::policy_type TiledArray::DistArray< Tile, Policy >::policy_type

Policy type.

Definition at line 56 of file dist_array.h.

◆ range_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::range_type TiledArray::DistArray< Tile, Policy >::range_type

Elements/tiles range type.

Definition at line 60 of file dist_array.h.

◆ reference

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::reference TiledArray::DistArray< Tile, Policy >::reference

future type

Definition at line 67 of file dist_array.h.

◆ scalar_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
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.

◆ shape_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
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.

◆ size_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::size_type TiledArray::DistArray< Tile, Policy >::size_type

Size type.

Definition at line 63 of file dist_array.h.

◆ trange_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::trange_type TiledArray::DistArray< Tile, Policy >::trange_type

Tile range type.

Definition at line 59 of file dist_array.h.

◆ value_type

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
typedef impl_type::value_type TiledArray::DistArray< Tile, Policy >::value_type

Tile type.

Definition at line 64 of file dist_array.h.

Constructor & Destructor Documentation

◆ DistArray() [1/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::DistArray ( )
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.

◆ DistArray() [2/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::DistArray ( const DistArray_ other)
inline

Copy constructor.

This is a shallow copy, that is no data is copied.

Parameters
otherThe array to be copied

Definition at line 177 of file dist_array.h.

◆ DistArray() [3/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
const std::shared_ptr< pmap_interface > &  pmap = std::shared_ptr<pmap_interface>() 
)
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.

Parameters
worldThe world where the array will live.
trangeThe tiled range object that will be used to set the array tiling.
pmapThe tile index -> process map

Definition at line 187 of file dist_array.h.

◆ DistArray() [4/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::DistArray ( World &  world,
const trange_type trange,
const shape_type shape,
const std::shared_ptr< pmap_interface > &  pmap = std::shared_ptr<pmap_interface>() 
)
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.

Parameters
worldThe world where the array will live.
trangeThe tiled range object that will be used to set the array tiling.
shapeThe array shape that defines zero and non-zero tiles
pmapThe tile index -> process map

Definition at line 201 of file dist_array.h.

◆ DistArray() [5/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename OtherTile , typename = std::enable_if_t<not std::is_same<DistArray_,DistArray<OtherTile,Policy>>::value>>
TiledArray::DistArray< Tile, Policy >::DistArray ( const DistArray< OtherTile, Policy > &  other)
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>

Parameters
otherThe array to be copied

Definition at line 213 of file dist_array.h.

◆ DistArray() [6/6]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename OtherTile , typename Op >
TiledArray::DistArray< Tile, Policy >::DistArray ( const DistArray< OtherTile, Policy > &  other,
Op &&  op 
)
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

Parameters
otherThe array to be copied

Definition at line 227 of file dist_array.h.

◆ ~DistArray()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
TiledArray::DistArray< Tile, Policy >::~DistArray ( )
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.

Member Function Documentation

◆ begin() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
iterator TiledArray::DistArray< Tile, Policy >::begin ( )
inline

Begin iterator factory function.

Returns
An iterator to the first local tile.

Definition at line 288 of file dist_array.h.

Here is the caller graph for this function:

◆ begin() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
const_iterator TiledArray::DistArray< Tile, Policy >::begin ( ) const
inline

Begin const iterator factory function.

Returns
A const iterator to the first local tile.

Definition at line 296 of file dist_array.h.

◆ clone()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
DistArray_ TiledArray::DistArray< Tile, Policy >::clone ( ) const
inline

Create a deep copy of this array.

Returns
An array that is equal to this array

Definition at line 243 of file dist_array.h.

Here is the call graph for this function:

◆ elements()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
DEPRECATED const trange_type::range_type& TiledArray::DistArray< Tile, Policy >::elements ( ) const
inline
Deprecated:
use DistArray::elements_range()

Definition at line 561 of file dist_array.h.

Here is the call graph for this function:

◆ elements_range()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
const trange_type::range_type& TiledArray::DistArray< Tile, Policy >::elements_range ( ) const
inline

Element range accessor.

Returns
A const reference to the range object for the array elements

Definition at line 568 of file dist_array.h.

Here is the caller graph for this function:

◆ end() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
iterator TiledArray::DistArray< Tile, Policy >::end ( )
inline

End iterator factory function.

Returns
An iterator to one past the last local tile.

Definition at line 304 of file dist_array.h.

Here is the caller graph for this function:

◆ end() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
const_iterator TiledArray::DistArray< Tile, Policy >::end ( ) const
inline

End const iterator factory function.

Returns
A const iterator to one past the last local tile.

Definition at line 312 of file dist_array.h.

◆ fill()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::fill ( const element_type value = element_type(),
bool  skip_set = false 
)
inline

Fill all local tiles.

Parameters
valueThe fill value
skip_setIf false, will throw if any tiles are already set

Definition at line 445 of file dist_array.h.

Here is the call graph for this function:

◆ fill_local()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::fill_local ( const element_type value = element_type(),
bool  skip_set = false 
)
inline

Fill all local tiles.

Parameters
valueThe fill value
skip_setIf false, will throw if any tiles are already set

Definition at line 436 of file dist_array.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill_random()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::fill_random ( bool  skip_set = false)
inline

Fill all local tiles with random values obtained as

(element_type)std::rand()/RAND_MAX
Parameters
skip_setIf false, will throw if any tiles are already set

Definition at line 451 of file dist_array.h.

Here is the call graph for this function:

◆ find() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index >
Future<value_type> TiledArray::DistArray< Tile, Policy >::find ( const Index &  i) const
inline

Find local or remote tile.

Template Parameters
IndexThe index type
Parameters
iThe tile index
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero

Definition at line 324 of file dist_array.h.

Here is the caller graph for this function:

◆ find() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Integer >
Future<value_type> TiledArray::DistArray< Tile, Policy >::find ( const std::initializer_list< Integer > &  i) const
inline

Find local or remote tile.

Template Parameters
IntegerAn integer type
Parameters
iThe tile index, as an std::initializer_list<Integer>
Returns
A future to tile i
Exceptions
TiledArray::ExceptionWhen tile i is zero

Definition at line 336 of file dist_array.h.

◆ get_pmap()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
DEPRECATED const std::shared_ptr<pmap_interface>& TiledArray::DistArray< Tile, Policy >::get_pmap ( ) const
inline
Deprecated:
use DistArray::pmap()

Definition at line 639 of file dist_array.h.

◆ get_shape()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
DEPRECATED const shape_type& TiledArray::DistArray< Tile, Policy >::get_shape ( ) const
inline
Deprecated:
use DistArray::shape()

Definition at line 661 of file dist_array.h.

◆ get_world()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
DEPRECATED World& TiledArray::DistArray< Tile, Policy >::get_world ( ) const
inline
Deprecated:
use DistArray::world()

Definition at line 625 of file dist_array.h.

◆ id()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
madness::uniqueidT TiledArray::DistArray< Tile, Policy >::id ( ) const
inline

Global object id.

Returns
A globally unique identifier.
Note
This function is primarily used for debugging purposes. Users should not rely on this function.

Definition at line 283 of file dist_array.h.

◆ init_elements()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Op >
void TiledArray::DistArray< Tile, Policy >::init_elements ( Op &&  op,
bool  skip_set = false 
)
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:

value_type op(const index&)

For example, in the following code, the array elements are initialized with random numbers from 0 to 1:

array.init_elements([] (const auto&)
{
return (double)std::rand() / RAND_MAX;
});
Template Parameters
OpElement generator type
Parameters
opThe operation used to generate elements
skip_setIf false, will throw if any tiles are already set

Definition at line 530 of file dist_array.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_tiles()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Op >
void TiledArray::DistArray< Tile, Policy >::init_tiles ( Op &&  op,
bool  skip_set = false 
)
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:

array.init_tiles([] (const TiledArray::Range& range) -> TiledArray::Tensor<double>
{
// Initialize the tile with the given range object
// Initialize the random number generator
std::default_random_engine generator;
std::uniform_real_distribution<double> distribution(0.0,1.0);
// Fill the tile with random numbers
for(auto& value : tile)
value = distribution(generator);
return tile;
});
Template Parameters
OpTile operation type
Parameters
opThe operation used to generate tiles
skip_setIf false, will throw if any tiles are already set

Definition at line 488 of file dist_array.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_dense()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
bool TiledArray::DistArray< Tile, Policy >::is_dense ( ) const
inline

Check dense/sparse.

Returns
true when Array is dense, false otherwise.

Definition at line 655 of file dist_array.h.

◆ is_initialized()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
bool TiledArray::DistArray< Tile, Policy >::is_initialized ( ) const
inline

Check if the array is initialized.

Returns
false if the array has been default initialized, otherwise true.

Definition at line 773 of file dist_array.h.

◆ is_local() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index >
bool TiledArray::DistArray< Tile, Policy >::is_local ( const Index &  i) const
inline

Check if the tile at index i is stored locally.

Template Parameters
IndexA coordinate or ordinal index type
Parameters
iThe coordinate or ordinal index of the tile to be checked
Returns
true if owner(i) is equal to the MPI process rank, otherwise false.

Definition at line 702 of file dist_array.h.

Here is the caller graph for this function:

◆ is_local() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index1 >
bool TiledArray::DistArray< Tile, Policy >::is_local ( const std::initializer_list< Index1 > &  i) const
inline

Check if the tile at index i is stored locally.

Template Parameters
IndexA coordinate or ordinal index type
Parameters
iThe coordinate or ordinal index of the tile to be checked
Returns
true if owner(i) is equal to the MPI process rank, otherwise false.

Definition at line 714 of file dist_array.h.

◆ is_zero() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index >
bool TiledArray::DistArray< Tile, Policy >::is_zero ( const Index &  i) const
inline

Check for zero tiles.

Returns
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.

Here is the caller graph for this function:

◆ is_zero() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index1 >
bool TiledArray::DistArray< Tile, Policy >::is_zero ( const std::initializer_list< Index1 > &  i) const
inline

Check for zero tiles.

Returns
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.

◆ make_replicated()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::make_replicated ( )
inline

Convert a distributed array into a replicated array.

Definition at line 743 of file dist_array.h.

Here is the call graph for this function:

◆ operator()() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
TiledArray::expressions::TsrExpr<const DistArray_, true> TiledArray::DistArray< Tile, Policy >::operator() ( const std::string &  vars) const
inline

Create a tensor expression.

Parameters
varsA string with a comma-separated list of variables
Returns
A const tensor expression object

Definition at line 583 of file dist_array.h.

◆ operator()() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
TiledArray::expressions::TsrExpr<DistArray_, true> TiledArray::DistArray< Tile, Policy >::operator() ( const std::string &  vars)
inline

Create a tensor expression.

Parameters
varsA string with a comma-separated list of variables
Returns
A non-const tensor expression object

Definition at line 606 of file dist_array.h.

◆ operator=()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
DistArray_& TiledArray::DistArray< Tile, Policy >::operator= ( const DistArray_ other)
inline

Copy constructor.

This is a shallow copy, that is no data is copied.

Parameters
otherThe array to be copied

Definition at line 272 of file dist_array.h.

Here is the caller graph for this function:

◆ owner() [1/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index >
ProcessID TiledArray::DistArray< Tile, Policy >::owner ( const Index &  i) const
inline

Tile ownership.

Template Parameters
IndexAn index type
Parameters
iThe index of a tile
Returns
The process ID of the owner of a tile.
Note
This does not indicate whether a tile exists or not. Only, the rank of the process that would own it if it does exist.

Definition at line 678 of file dist_array.h.

◆ owner() [2/2]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index1 >
ProcessID TiledArray::DistArray< Tile, Policy >::owner ( const std::initializer_list< Index1 > &  i) const
inline

Tile ownership.

Template Parameters
IndexAn index type
Parameters
iThe index of a tile
Returns
The process ID of the owner of a tile.
Note
This does not indicate whether a tile exists or not. Only, the rank of the process that would own it if it does exist.

Definition at line 691 of file dist_array.h.

◆ pmap()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
const std::shared_ptr<pmap_interface>& TiledArray::DistArray< Tile, Policy >::pmap ( ) const
inline

Process map accessor.

Returns
A reference to the process map that owns this array.

Definition at line 647 of file dist_array.h.

Here is the caller graph for this function:

◆ range()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
const range_type& TiledArray::DistArray< Tile, Policy >::range ( ) const
inline

Tile range accessor.

Returns
A const reference to the range object for the array tiles

Definition at line 555 of file dist_array.h.

Here is the caller graph for this function:

◆ set() [1/8]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index , typename InIter >
std::enable_if<detail::is_input_iterator<InIter>::value>::type TiledArray::DistArray< Tile, Policy >::set ( const Index &  i,
InIter  first 
)
inline

Set a tile and fill it using a sequence.

Template Parameters
IndexAn index or integral type
InIterAn input iterator
Parameters
iThe index or the ordinal of the tile to be set
firstThe iterator that points to the start of the input sequence

Definition at line 348 of file dist_array.h.

Here is the caller graph for this function:

◆ set() [2/8]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Integer , typename InIter >
std::enable_if<detail::is_input_iterator<InIter>::value>::type TiledArray::DistArray< Tile, Policy >::set ( const std::initializer_list< Integer > &  i,
InIter  first 
)
inline

Set a tile and fill it using a sequence.

Template Parameters
IntegerAn integral type
InIterAn input iterator
Parameters
iThe tile index, as an std::initializer_list<Integer>
firstThe iterator that points to the new tile data

Definition at line 361 of file dist_array.h.

◆ set() [3/8]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index >
void TiledArray::DistArray< Tile, Policy >::set ( const Index &  i,
const element_type value = element_type() 
)
inline

Set a tile and fill it using a value.

Template Parameters
IndexAn index or integral type
InIterAn input iterator
Parameters
iThe index or the ordinal of the tile to be set
valuethe value used to fill the tile

Definition at line 372 of file dist_array.h.

◆ set() [4/8]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Integer >
void TiledArray::DistArray< Tile, Policy >::set ( const std::initializer_list< Integer > &  i,
const element_type value = element_type() 
)
inline

Set a tile and fill it using a value.

Template Parameters
IntegerAn integral type
InIterAn input iterator
Parameters
iThe tile index, as an std::initializer_list<Integer>
valuethe value used to fill the tile

Definition at line 384 of file dist_array.h.

◆ set() [5/8]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index >
void TiledArray::DistArray< Tile, Policy >::set ( const Index &  i,
const Future< value_type > &  f 
)
inline

Set a tile directly using a future.

Template Parameters
IndexAn index or integral type
Parameters
iThe index or the ordinal of the tile to be set
fA future to the tile

Definition at line 395 of file dist_array.h.

◆ set() [6/8]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Integer >
void TiledArray::DistArray< Tile, Policy >::set ( const std::initializer_list< Integer > &  i,
const Future< value_type > &  f 
)
inline

Set a tile directly using a future.

Template Parameters
IntegerAn integral type
Parameters
iThe tile index, as an std::initializer_list<Integer>
fA future to the tile

Definition at line 406 of file dist_array.h.

◆ set() [7/8]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Index >
void TiledArray::DistArray< Tile, Policy >::set ( const Index &  i,
const value_type v 
)
inline

Set a tile using a Tile object.

Template Parameters
IndexAn index or integral type
Parameters
iThe tile index to be set
vThe tile value

Definition at line 417 of file dist_array.h.

◆ set() [8/8]

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
template<typename Integer >
void TiledArray::DistArray< Tile, Policy >::set ( const std::initializer_list< Integer > &  i,
const value_type v 
)
inline

Set a tile using a Tile object.

Template Parameters
IntegerAn integral type
Parameters
iThe tile index, as an std::initializer_list<Integer>
vThe tile value

Definition at line 428 of file dist_array.h.

◆ shape()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
const shape_type& TiledArray::DistArray< Tile, Policy >::shape ( ) const
inline

Shape accessor.

Returns shape object. No communication is required.

Returns
reference to the shape object.
Exceptions
TiledArray::ExceptionWhen the Array is dense.

Definition at line 668 of file dist_array.h.

Here is the caller graph for this function:

◆ size()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
size_type TiledArray::DistArray< Tile, Policy >::size ( ) const
inline

Definition at line 573 of file dist_array.h.

Here is the caller graph for this function:

◆ swap()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::swap ( DistArray_ other)
inline

Swap this array with other.

Parameters
otherThe array to be swapped with this array.

Definition at line 740 of file dist_array.h.

Here is the call graph for this function:

◆ trange()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
const trange_type& TiledArray::DistArray< Tile, Policy >::trange ( ) const
inline

Tiled range accessor.

Returns
A const reference to the tiled range object for the array

Definition at line 547 of file dist_array.h.

Here is the caller graph for this function:

◆ truncate()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
void TiledArray::DistArray< Tile, Policy >::truncate ( )
inline

Update shape data and remove tiles that are below the zero threshold.

Note
This function is a no-op for dense arrays.

Definition at line 767 of file dist_array.h.

Here is the call graph for this function:

◆ wait_for_lazy_cleanup()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
static void TiledArray::DistArray< Tile, Policy >::wait_for_lazy_cleanup ( World &  world,
const double  = 60.0 
)
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.

Parameters
worldThe world that to be used to execute ready tasks.
Exceptions
madness::MadnessExceptionWhen timeout has been exceeded.

Definition at line 256 of file dist_array.h.

Here is the call graph for this function:

◆ world()

template<typename Tile = Tensor<double, Eigen::aligned_allocator<double> >, typename Policy = DensePolicy>
World& TiledArray::DistArray< Tile, Policy >::world ( ) const
inline

World accessor.

Returns
A reference to the world that owns this array.

Definition at line 633 of file dist_array.h.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: