Questions about the IndexMap

Hello, I want to ask a question about the IndexMap.

I’m a little bit confused about this function:

I can understand that “ghosts” stores the global index of all ghost nodes, and “src” stores the process rank that each ghost nodes belong to. But for “dest” and “owner”, I’m not sure I understand it in the right way.

Does “dest” corresponds to the local index of ghost nodes in their own process. And what does “Owner” contain? Sorry I don’t really get it.

Thanks very much!

If you know a-priory the communication pattern (what process needs to communicate with another) you can supply it to the index map.

Note that the function above: dolfinx/cpp/dolfinx/common/IndexMap.h at 25db9a743ef95a78f686f05e38607aa18281b0d6 · FEniCS/dolfinx · GitHub
contains the version where you only need to know:

  /// @param[in] comm The MPI communicator
  /// @param[in] local_size Local size of the index map, i.e. the number
  /// of owned entries
  /// @param[in] ghosts The global indices of ghost entries
  /// @param[in] owners Owner rank (on global communicator) of each
  /// entry in `ghosts`

The MPI communicator, how many entries you own, what global indices from other processes you need, and who owns each of the ghosts indices.

This function will then compute the source and dest ranks (the source ranks is the unique set of indices in owners: dolfinx/cpp/dolfinx/common/IndexMap.cpp at 25db9a743ef95a78f686f05e38607aa18281b0d6 · FEniCS/dolfinx · GitHub)
while the dest ranks are computed with NBX: dolfinx/cpp/dolfinx/common/IndexMap.cpp at 25db9a743ef95a78f686f05e38607aa18281b0d6 · FEniCS/dolfinx · GitHub

1 Like