DOLFINx
0.1.0
DOLFINx C++ interface
|
11 #include <dolfinx/common/MPI.h>
12 #include <dolfinx/graph/AdjacencyList.h>
18 #include <xtl/xspan.hpp>
34 std::tuple<std::int64_t, std::vector<std::int32_t>,
35 std::vector<std::vector<std::int64_t>>,
36 std::vector<std::vector<int>>>
39 std::pair<std::reference_wrapper<const common::IndexMap>,
int>>& maps);
87 IndexMap(MPI_Comm mpi_comm, std::int32_t local_size,
88 const std::vector<int>& dest_ranks,
89 const std::vector<std::int64_t>&
ghosts,
90 const std::vector<int>& src_ranks);
108 std::array<std::int64_t, 2>
local_range() const noexcept;
121 const std::vector<std::int64_t>&
ghosts() const noexcept;
134 const xtl::span<std::int64_t>& global) const;
141 const xtl::span<std::int32_t>& local) const;
154 const graph::AdjacencyList<std::int32_t>&
shared_indices() const noexcept;
177 template <typename T>
178 void scatter_fwd(xtl::span<const T> local_data, xtl::span<T> remote_data,
190 template <typename T>
191 void scatter_rev(xtl::span<T> local_data, xtl::span<const T> remote_data,
196 std::array<std::int64_t, 2> _local_range;
199 std::int64_t _size_global;
208 dolfinx::
MPI::Comm _comm_owner_to_ghost;
215 dolfinx::
MPI::Comm _comm_ghost_to_owner;
218 dolfinx::
MPI::Comm _comm_symmetric;
221 std::vector<std::int64_t> _ghosts;
225 std::vector<std::int32_t> _ghost_owners;
230 std::unique_ptr<graph::AdjacencyList<std::int32_t>> _shared_indices;
void local_to_global(const xtl::span< const std::int32_t > &local, const xtl::span< std::int64_t > &global) const
Compute global indices for array of local indices.
Definition: IndexMap.cpp:452
void scatter_fwd(xtl::span< const T > local_data, xtl::span< T > remote_data, int n) const
Send n values for each index that is owned to processes that have the index as a ghost....
Definition: IndexMap.cpp:659
~IndexMap()=default
Destructor.
This class represents the distribution index arrays across processes. An index array is a contiguous ...
Definition: IndexMap.h:48
std::array< std::int64_t, 2 > local_range() const noexcept
Range of indices (global) owned by this process.
Definition: IndexMap.cpp:433
std::vector< std::int64_t > global_indices() const
Global indices.
Definition: IndexMap.cpp:495
This class provides utility functions for easy communication with MPI and handles cases when DOLFINx ...
Definition: MPI.h:30
std::vector< int > ghost_owner_rank() const
Owner rank (on global communicator) of each ghost entry.
Definition: IndexMap.cpp:514
Direction
Edge directions of neighborhood communicator.
Definition: IndexMap.h:59
MPI_Comm comm(Direction dir=Direction::symmetric) const
Return a MPI communicator with attached distributed graph topology information.
Definition: IndexMap.cpp:531
IndexMap(MPI_Comm comm, std::int32_t local_size)
Create an non-overlapping index map with local_size owned on this process.
Definition: IndexMap.cpp:307
std::map< std::int32_t, std::set< int > > compute_shared_indices() const
Definition: IndexMap.cpp:546
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 common::IndexMap >, int >> &maps)
Compute layout data and ghost indices for a stacked (concatenated) index map, i.e....
Definition: IndexMap.cpp:190
Miscellaneous classes, functions and types.
void scatter_rev(xtl::span< T > local_data, xtl::span< const T > remote_data, int n, IndexMap::Mode op) const
Send n values for each ghost index to owning to the process.
Definition: IndexMap.cpp:742
std::int32_t num_ghosts() const noexcept
Number of ghost indices on this process.
Definition: IndexMap.cpp:438
const std::vector< std::int64_t > & ghosts() const noexcept
Local-to-global map for ghosts (local indexing beyond end of local range)
Definition: IndexMap.cpp:447
std::int64_t size_global() const noexcept
Number indices across communicator.
Definition: IndexMap.cpp:445
void global_to_local(const xtl::span< const std::int64_t > &global, const xtl::span< std::int32_t > &local) const
Compute local indices for array of global indices.
Definition: IndexMap.cpp:469
const graph::AdjacencyList< std::int32_t > & shared_indices() const noexcept
Definition: IndexMap.cpp:509
IndexMap & operator=(IndexMap &&map)=default
Move assignment.
Mode
Mode for reverse scatter operation.
Definition: IndexMap.h:52
std::int32_t size_local() const noexcept
Number of indices owned by on this process.
Definition: IndexMap.cpp:440