Ginkgo: gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType > Class Template Reference

| Ginkgo Generated from branch based on main. Ginkgo version 1.11.0 A numerical linear algebra library targeting many-core architectures

Loading...
Searching...
No Matches
gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType > Class Template Reference

This class defines mappings between global and local indices. More...

`#include <ginkgo/core/distributed/index_map.hpp>`

Inheritance diagram for gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType >:
[legend]

## Public Types
using | partition_type = Partition<LocalIndexType, GlobalIndexType>

## Public Member Functions
array< LocalIndexType > | map_to_local (const array< GlobalIndexType > &global_ids, index_space index_space_v) const
| Maps global indices to local indices.
array< GlobalIndexType > | map_to_global (const array< LocalIndexType > &local_idxs, index_space index_space_v) const
| Maps local indices to global indices.
size_type | get_global_size () const
| get size of the global index space
size_type | get_local_size () const
| get size of index_space::local
size_type | get_non_local_size () const
| get size of index_space::non_local
| index_map (std::shared_ptr< const Executor > exec, std::shared_ptr< const partition_type > partition, comm_index_type rank, const array< GlobalIndexType > &recv_connections)
| Creates a new index map.
| index_map (std::shared_ptr< const Executor > exec)
| Creates an empty index map.
const segmented_array< GlobalIndexType > & | get_remote_global_idxs () const
| get the index set for this rank.
const segmented_array< LocalIndexType > & | get_remote_local_idxs () const
| get the index set , but mapped to their respective local index space.
const array< comm_index_type > & | get_remote_target_ids () const
| get the rank ids which contain indices accessed by this rank.
std::shared_ptr< const Executor > | get_executor () const
| get the associated executor.
| index_map (const index_map &other)
| index_map (index_map &&other) noexcept
index_map & | operator= (const index_map &other)
index_map & | operator= (index_map &&other)

## Detailed Description

template<typename LocalIndexType, typename GlobalIndexType = int64>
class gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType >

This class defines mappings between global and local indices.

Given an index space that is partitioned into disjoint subsets , this class defines for each subset an extended global index set . The extended index set contains the global indices owned by part , as well as remote indices , which are also accessed by part , but owned by parts . At the core, this class provides mappings from the global index space into different local index spaces. The combined local index space (index_space::combined) is then defined as . Additionally, the combined index space can be separated into locally owned (index_space::local) and non-locally owned (index_space::non_local). The locally owned indices are defined as , and the non-locally owned as . With these index sets, the following mappings are defined:

- which maps global indices into the combined/full local index space (denoted as index_space::combined),
- which maps global indices into the locally owned index space (denoted as index_space::local),
- which maps global indices into the non-locally owned index space (denoted as index_space::non_local).

The required map can be selected by passing the appropriate type of an index_space.

The index map for has no knowledge about any other index maps for . In particular, any global index passed to the map_to_local map that is not part of the specified index space, will be mapped to an invalid_index.

Template Parameters

  LocalIndexType | type for local indices
  GlobalIndexType | type for global indices

## Constructor & Destructor Documentation

## ◆ index_map()

template<typename LocalIndexType, typename GlobalIndexType = int64>

gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType >::index_map | ( | std::shared_ptr< const Executor > | exec,
|  | std::shared_ptr< const partition_type > | partition,
|  | comm_index_type | rank,
|  | const array< GlobalIndexType > & | recv_connections )

Creates a new index map.

The passed in recv_connections may contain duplicates, which will be filtered out.

Parameters

  exec | the executor
  partition | the partition of the global index set
  rank | the id of the global index space subset
  recv_connections | the global indices that are not owned by this rank, but accessed by it

Referenced by get_executor().

## Member Function Documentation

## ◆ get_remote_global_idxs()

template<typename LocalIndexType, typename GlobalIndexType = int64>

const segmented_array< GlobalIndexType > & gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType >::get_remote_global_idxs | ( |  | ) | const

get the index set for this rank.

The indices are ordered by their owning rank and global index.

## ◆ get_remote_local_idxs()

template<typename LocalIndexType, typename GlobalIndexType = int64>

const segmented_array< LocalIndexType > & gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType >::get_remote_local_idxs | ( |  | ) | const

get the index set , but mapped to their respective local index space.

The indices are grouped by their owning rank and sorted according to their global index within each group.

The set can also be written as the union of the intersection of with other disjoint sets , i.e. . The set can then be mapped by to get the local indices wrt. part . The indices here are mapped by .

## ◆ get_remote_target_ids()

template<typename LocalIndexType, typename GlobalIndexType = int64>

const array< comm_index_type > & gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType >::get_remote_target_ids | ( |  | ) | const

get the rank ids which contain indices accessed by this rank.

The order matches the order of the sets in get_remote_global_idxs and get_remote_local_idxs.

## ◆ map_to_global()

template<typename LocalIndexType, typename GlobalIndexType = int64>

array< GlobalIndexType > gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType >::map_to_global | ( | const array< LocalIndexType > & | local_idxs,
|  | index_space | index_space_v ) const

Maps local indices to global indices.

Parameters

  local_idxs | the local indices to map
  index_space_v | the index space in which the passed-in local indices are defined

Returns
  the mapped global indices. Any local index that is not in the specified index space is mapped to invalid_index

## ◆ map_to_local()

template<typename LocalIndexType, typename GlobalIndexType = int64>

array< LocalIndexType > gko::experimental::distributed::index_map< LocalIndexType, GlobalIndexType >::map_to_local | ( | const array< GlobalIndexType > & | global_ids,
|  | index_space | index_space_v ) const

Maps global indices to local indices.

Parameters

  global_ids | the global indices to map
  index_space_v | the index space in which the returned local indices are defined

Returns
  the mapped local indices. Any global index that is not in the specified index space is mapped to invalid_index.

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

- ginkgo/core/distributed/index_map.hpp