12 #include <dolfinx/common/MPI.h>
31 std::tuple<std::int64_t, std::vector<std::int32_t>,
32 std::vector<std::vector<std::int64_t>>,
33 std::vector<std::vector<int>>>
35 const std::vector<std::reference_wrapper<const common::IndexMap>>& maps);
86 IndexMap(MPI_Comm mpi_comm, std::int32_t local_size,
87 const std::vector<int>& dest_ranks,
88 const std::vector<std::int64_t>&
ghosts,
89 const std::vector<int>& src_ranks,
int block_size);
104 MPI_Comm mpi_comm, std::int32_t local_size,
105 const std::vector<int>& dest_ranks,
106 const Eigen::Ref<
const Eigen::Array<std::int64_t, Eigen::Dynamic, 1>>&
108 const std::vector<int>& src_ranks,
int block_size);
120 std::array<std::int64_t, 2>
local_range() const noexcept;
136 const Eigen::Array<std::int64_t, Eigen::Dynamic, 1>&
ghosts() const;
152 const Eigen::Ref<const Eigen::Array<std::int32_t, Eigen::Dynamic, 1>>&
154 bool blocked = true) const;
165 std::vector<std::int64_t>
167 bool blocked = true) const;
175 std::vector<std::int32_t>
177 bool blocked = true) const;
186 const Eigen::Ref<const Eigen::Array<std::int64_t, Eigen::Dynamic, 1>>&
188 bool blocked = true) const;
193 std::vector<std::int64_t>
global_indices(
bool blocked = true) const;
206 Eigen::Array<std::int64_t, Eigen::Dynamic, 1>
207 indices(
bool unroll_block) const;
227 void scatter_fwd(const std::vector<std::int64_t>& local_data,
228 std::vector<std::int64_t>& remote_data,
int n) const;
240 void scatter_fwd(const std::vector<std::int32_t>& local_data,
241 std::vector<std::int32_t>& remote_data,
int n) const;
253 std::vector<std::int64_t>
254 scatter_fwd(const std::vector<std::int64_t>& local_data,
int n) const;
265 std::vector<std::int32_t>
266 scatter_fwd(const std::vector<std::int32_t>& local_data,
int n) const;
277 void scatter_rev(std::vector<std::int64_t>& local_data,
278 const std::vector<std::int64_t>& remote_data,
int n,
290 void scatter_rev(std::vector<std::int32_t>& local_data,
291 const std::vector<std::int32_t>& remote_data,
int n,
298 std::array<std::int64_t, 2> _local_range;
301 std::int64_t _size_global;
310 dolfinx::
MPI::Comm _comm_owner_to_ghost;
317 dolfinx::
MPI::Comm _comm_ghost_to_owner;
320 dolfinx::
MPI::Comm _comm_symmetric;
323 Eigen::Array<std::int64_t, Eigen::Dynamic, 1> _ghosts;
327 Eigen::Array<std::int32_t, Eigen::Dynamic, 1> _ghost_owners;
339 std::vector<std::int32_t> _shared_indices;
345 std::vector<std::int32_t> _shared_disp;
347 template <typename T>
348 void scatter_fwd_impl(const std::vector<T>& local_data,
349 std::vector<T>& remote_data,
int n) const;
350 template <typename T>
351 void scatter_rev_impl(std::vector<T>& local_data,
352 const std::vector<T>& remote_data,
int n,