55std::vector<std::int32_t>
72std::tuple<std::int64_t, std::vector<std::int32_t>,
73 std::vector<std::vector<std::int64_t>>,
74 std::vector<std::vector<int>>>
76 const std::vector<std::pair<std::reference_wrapper<const IndexMap>,
int>>&
99std::vector<std::int32_t>
127std::tuple<IndexMap, std::vector<std::int32_t>,
bool>
129 std::span<const std::int32_t> indices,
181std::tuple<std::vector<int>, std::vector<int>, std::vector<std::int32_t>>
255 std::span<const std::int64_t>
ghosts, std::span<const int>
owners,
256 int tag =
static_cast<int>(dolfinx::MPI::tag::consensus_nbx));
300 const std::array<std::vector<int>, 2>& src_dest,
301 std::span<const std::int64_t>
ghosts, std::span<const int>
owners);
319 std::array<std::int64_t, 2>
local_range() const noexcept;
331 std::span<const std::int64_t>
ghosts() const noexcept;
335 MPI_Comm
comm() const;
347 std::span<std::int64_t> global) const;
356 std::span<std::int32_t> local) const;
364 std::span<const
int>
owners() const noexcept {
return _owners; }
376 std::pair<std::vector<int>, std::vector<std::int32_t>>
387 std::span<const int>
src() const noexcept;
391 std::span<const
int>
dest() const noexcept;
428 std::array<std::vector<
int>, 2>
rank_type(
int split_type) const;
432 std::array<std::int64_t, 2> _local_range;
435 std::int64_t _size_global;
441 std::vector<std::int64_t> _ghosts;
444 std::vector<
int> _owners;
447 std::vector<
int> _src;
450 std::vector<
int> _dest;
Distribution of a global index range [0, N) across MPI ranks.
Definition IndexMap.h:191
std::vector< std::int32_t > weights_dest() const
Count the caller's owned entries ghosted by each destination rank.
Definition IndexMap.cpp:1398
~IndexMap()=default
Destructor.
std::int32_t num_ghosts() const noexcept
Return the number of ghost indices.
Definition IndexMap.cpp:1076
std::span< const int > dest() const noexcept
Return sorted unique ranks that ghost entries owned by the caller.
Definition IndexMap.cpp:1381
std::vector< std::int32_t > weights_src() const
Count the caller's ghosts owned by each source rank.
Definition IndexMap.cpp:1383
std::array< std::int64_t, 2 > local_range() const noexcept
Return the global range of owned indices.
Definition IndexMap.cpp:1071
std::span< const int > owners() const noexcept
Return ranks that own ghost entries.
Definition IndexMap.h:364
std::int32_t size_local() const noexcept
Return the number of owned indices.
Definition IndexMap.cpp:1081
std::int64_t size_global() const noexcept
Return the total number of indices across the communicator.
Definition IndexMap.cpp:1086
IndexMap(IndexMap &&map)=default
Move constructor.
IndexMap & operator=(IndexMap &&map)=default
Move assignment.
std::span< const int > src() const noexcept
Return sorted unique ranks that own the caller's ghosts.
Definition IndexMap.cpp:1379
void local_to_global(std::span< const std::int32_t > local, std::span< std::int64_t > global) const
Compute global indices for local indices.
Definition IndexMap.cpp:1093
void global_to_local(std::span< const std::int64_t > global, std::span< std::int32_t > local) const
Compute local indices for global indices.
Definition IndexMap.cpp:1121
IndexMap(MPI_Comm comm, std::int32_t local_size)
Create a non-overlapping index map.
Definition IndexMap.cpp:1010
std::span< const std::int64_t > ghosts() const noexcept
Return global indices of ghosts in local ghost-index order.
Definition IndexMap.cpp:1088
std::vector< std::int32_t > shared_indices() const
Return owned indices ghosted by another rank.
Definition IndexMap.cpp:1305
MPI_Comm comm() const
Return the communicator that the map is defined on.
Definition IndexMap.cpp:1170
std::pair< std::vector< int >, std::vector< std::int32_t > > index_to_dest_ranks() const
Compute sharing ranks for each local index.
Definition IndexMap.cpp:1173
std::vector< std::int64_t > global_indices() const
Return global indices for all local entries, including ghosts.
Definition IndexMap.cpp:1158
std::array< std::vector< int >, 2 > rank_type(int split_type) const
Return neighbours in the caller's MPI split-type group.
Definition IndexMap.cpp:1422
MPI support functionality.
Definition MPI.h:36
Miscellaneous classes, functions and types.
Definition dolfinx_common.h:8
std::vector< std::int32_t > compute_owned_indices(std::span< const std::int32_t > indices, const IndexMap &map)
Return selected indices owned by the calling rank.
Definition IndexMap.cpp:718
IndexMapOrder
Control ghost-index ordering in sub-index maps.
Definition IndexMap.h:27
@ any
Allow arbitrary ghost-index ordering.
Definition IndexMap.h:29
@ preserve
Preserve the ordering of ghost indices.
Definition IndexMap.h:28
std::vector< std::int32_t > num_sharing_ranks(const IndexMap &map, std::span< const std::int32_t > indices, int bs)
Number of ranks that share each of the given local indices.
Definition IndexMap.cpp:933
std::tuple< std::vector< int >, std::vector< int >, std::vector< std::int32_t > > compute_sharing_neighbourhood(const IndexMap &imap)
Compute the symmetric neighbourhood of ranks that share an owned or ghost index with the caller.
Definition IndexMap.cpp:984
std::tuple< IndexMap, std::vector< std::int32_t >, bool > create_sub_index_map(const IndexMap &imap, std::span< const std::int32_t > indices, IndexMapOrder order=IndexMapOrder::any)
Create an index map from a subset of an existing map.
Definition IndexMap.cpp:941
std::tuple< std::int64_t, std::vector< std::int32_t >, std::vector< std::vector< std::int64_t > >, std::vector< std::vector< int > > > stack_index_maps(const std::vector< std::pair< std::reference_wrapper< const IndexMap >, int > > &maps)
Compute layout data for a concatenated index map.
Definition IndexMap.cpp:767
Top-level namespace.
Definition defines.h:12