lue_framework_partitioned_array#

template<typename Element, Rank rank>
class PartitionedArray#

Class for representing partitioned arrays.

The array is partitioned. Partitions can be located in multiple processes.

Template Parameters:
  • Element – Type for representing element values

  • rank – Array rank

Public Functions

PartitionedArray()#

Default-construct an instance with an empty shape.

The array will have zero elements.

PartitionedArray(Shape const &shape, Localities<rank> &&localities, Partitions &&partitions)#

Construct an instance.

The shape of the partitions together must equal the shape passed in

Parameters:
  • shape – Shape of the array

  • localities – Localities where the partitions are located

  • partitions – Collection of array partitions

PartitionedArray(Shape const &shape, Localities<rank> const &localities, Partitions &&partitions)#

Construct an instance.

The shape of the partitions together must equal the shape passed in

Parameters:
  • shape – Shape of the array

  • localities – Localities where the partitions are located

  • partitions – Collection of array partitions

Count nr_elements() const#

Return the number of elements.

Shape const &shape() const#

Return the shape.

Localities<rank> const &localities() const#

Return the localities.

Count nr_partitions() const#

Return the number of partitions.

Partitions &partitions()#

Return the partitions.

Partitions const &partitions() const#

Return the partitions.

ConstIterator begin() const#

Return an iterator to the first partition.

Iterator begin()#

Return an iterator to the first partition.

ConstIterator end() const#

Return an iterator to the one-past-the-last partition.

Iterator end()#

Return an iterator to the one-past-the-last partition.

template<typename Element, Rank rank>
class ArrayPartition : public hpx::components::client_base<ArrayPartition<Element, rank>, server::ArrayPartition<Element, rank>>#

Class for array partition component client instances.

Each instance is associated with a single array partition component server instance. Multiple instances can be associated with a single server instance.

A partition has an offset, which represents the location of the partition within the array. An offset contains an index along each dimension of the array. For example, the first partition in a 2D array is located at offset [0, 0].

Template Parameters:
  • Element – Type for representing element values

  • rank – Array rank

Public Functions

ArrayPartition()#

Default-construct an instance.

explicit ArrayPartition(hpx::id_type const &component_id)#

Construct a client instance based on an existing and possibly remote component server instance with ID component_id.

When calling hpx::new_<Client>(…), this constructor is called by the underlying code once the component server has been constructed.

This instance will take ownership of the ID.

Parameters:

component_id – ID of component server instance

explicit ArrayPartition(hpx::future<hpx::id_type> &&component_id)#

Construct a component client instance based on an existing and possibly remote component server instance with ID component_id.

When calling hpx::new_<Client>(…), this constructor is called by the underlying code once the component server has been constructed.

A non-shared future is a unique future. No two unique futures can refer to the same data. Here, an r-value reference to a unique future is passed in. This instance will take over ownership of the ID.

Parameters:

component_id – ID of component server instance

ArrayPartition(hpx::future<ArrayPartition> &&partition)#

Construct an instance based on a future to an instance.

A partition already holds a future to the ID of the referenced object. This means that the object passed in is a future to a future to the ID. Unwrapping accesses this inner future. This constructor acts like an ‘unwrapping move constructor’.

A non-shared future is a unique future. No two unique futures can refer to the same data. Here, an r-value reference to a unique future is passed in. This instance will take over ownership of the partition.

Parameters:

partition – A future to an instance

ArrayPartition(hpx::id_type locality_id, Offset const &offset, Shape const &shape)#

Construct a server instance on locality locality_id.

Parameters:
  • locality_id – ID of locality to create instance on

  • offset – Offset of partition within the array

  • shape – Shape of partition to create

ArrayPartition(hpx::id_type locality_id, Offset const &offset, Shape const &shape, Element value)#

Construct a server instance on locality locality_id.

Parameters:
  • locality_id – ID of locality to create instance on

  • offset – Offset of partition within the array

  • shape – Shape of partition to create

  • value – Initial value used to fill the partition

ArrayPartition(hpx::id_type locality_id, Offset const &offset, Data &&data)#

Construct a server instance on locality locality_id.

The @data passed in is moved from.

Parameters:
  • locality_id – ID of locality to create instance on

  • offset – Offset of partition within the array

  • data – Initial data

auto data() const -> hpx::future<Data>#

Return a future to the underlying data.

Return this partition’s data.

auto slice(Slices const &slices) const -> hpx::future<Data>#

Return a future to a subset of the underlying data.

auto fill(Element value) -> hpx::future<void>#

Asynchronously fill the partition with value.

Returns:

A future that will become ready once the partition is filled

auto set_data(Data const &data) -> hpx::future<void>#

Asynchronously assign data to the partition.

Returns:

A future that will become ready once the data is assigned

auto offset() const -> hpx::future<Offset>#

Return a future to the offset.

auto shape() const -> hpx::future<Shape>#

Return a future to the shape.

auto nr_elements() const -> hpx::future<Count>#

Return a future to the number of elements.