@@ -26,8 +26,8 @@ namespace
2626// / @param comm MPI communicator.
2727// / @param owners List of ranks that own each ghost index.
2828// / @return (src ranks, destination ranks). Both lists are sorted.
29- std::array<std::vector<int >, 2 > build_src_dest (MPI_Comm comm,
30- std::span<const int > owners)
29+ std::array<std::vector<int >, 2 >
30+ build_src_dest (MPI_Comm comm, std::span<const int > owners, int tag )
3131{
3232 if (dolfinx::MPI::size (comm) == 1 )
3333 {
@@ -40,8 +40,9 @@ std::array<std::vector<int>, 2> build_src_dest(MPI_Comm comm,
4040 auto [unique_end, range_end] = std::ranges::unique (src);
4141 src.erase (unique_end, range_end);
4242 src.shrink_to_fit ();
43- std::vector<int > dest = dolfinx::MPI::compute_graph_edges_nbx (comm, src);
43+ std::vector<int > dest = dolfinx::MPI::compute_graph_edges_nbx (comm, src, tag );
4444 std::ranges::sort (dest);
45+
4546 return {std::move (src), std::move (dest)};
4647}
4748
@@ -57,9 +58,9 @@ std::array<std::vector<int>, 2> build_src_dest(MPI_Comm comm,
5758// / @param[in] dest Destination ranks on `comm`.
5859// / @param[in] ghosts Ghost indices on calling process.
5960// / @param[in] owners Owning rank for each entry in `ghosts`.
60- // / @param[in] include_ghost A list of the same length as `ghosts`, whose
61- // / ith entry must be non-zero (true) to include `ghost[i]`, otherwise
62- // / the ghost will be excluded
61+ // / @param[in] include_ghost A list of the same length as `ghosts`,
62+ // / whose ith entry must be non-zero (true) to include `ghost[i]`,
63+ // / otherwise the ghost will be excluded
6364// / @return 1) The ghost indices packed in a buffer for communication
6465// / 2) The received indices (in receive buffer layout)
6566// / 3) A map relating the position of a ghost in the packed
@@ -879,8 +880,9 @@ IndexMap::IndexMap(MPI_Comm comm, std::int32_t local_size) : _comm(comm, true)
879880// -----------------------------------------------------------------------------
880881IndexMap::IndexMap (MPI_Comm comm, std::int32_t local_size,
881882 std::span<const std::int64_t > ghosts,
882- std::span<const int > owners)
883- : IndexMap(comm, local_size, build_src_dest(comm, owners), ghosts, owners)
883+ std::span<const int > owners, int tag)
884+ : IndexMap(comm, local_size, build_src_dest(comm, owners, tag), ghosts,
885+ owners)
884886{
885887 // Do nothing
886888}
@@ -1002,7 +1004,7 @@ std::vector<std::int64_t> IndexMap::global_indices() const
10021004// -----------------------------------------------------------------------------
10031005MPI_Comm IndexMap::comm () const { return _comm.comm (); }
10041006// ----------------------------------------------------------------------------
1005- graph::AdjacencyList<int > IndexMap::index_to_dest_ranks () const
1007+ graph::AdjacencyList<int > IndexMap::index_to_dest_ranks (int tag ) const
10061008{
10071009 const std::int64_t offset = _local_range[0 ];
10081010
@@ -1011,7 +1013,8 @@ graph::AdjacencyList<int> IndexMap::index_to_dest_ranks() const
10111013 std::ranges::sort (src);
10121014 auto [unique_end, range_end] = std::ranges::unique (src);
10131015 src.erase (unique_end, range_end);
1014- auto dest = dolfinx::MPI::compute_graph_edges_nbx (_comm.comm (), src);
1016+ std::vector<int > dest
1017+ = dolfinx::MPI::compute_graph_edges_nbx (_comm.comm (), src, tag);
10151018 std::ranges::sort (dest);
10161019
10171020 // Array (local idx, ghosting rank) pairs for owned indices
0 commit comments