dolfinx icon indicating copy to clipboard operation
dolfinx copied to clipboard

Associate a `common::Scatterer` with `fem::FunctionSpace`

Open garth-wells opened this issue 1 year ago • 2 comments

At present, each la::Vector has it's own common::Scatterer. This allows overlapping non-blocking communication for la::Vectors because each scatter has its own buffers. A potential problem is that a code that creates a a lot of Functions can create a lot of (neighbourhood) communicators, and exhaust the available communicators.

A possibility is to:

  1. Associate a Scatterer with each FunctionSpace.
  2. Copy the Scatterer for Function vectors that need their own Scatterer.
  3. For Function vectors that don't need their own Scatterer, let them share the FunctionSpace Scatterer`.

In any case, it's probably a good thing for a FunctionSpace to hold the necessary data to create a suitable Scatterer cheaply so the scatter details are not re-computed for every Function created on a space.\

See #3061.

@IgorBaratta , @chrisrichardson?

garth-wells avatar Feb 24 '24 16:02 garth-wells

Seems fine. We still would want to be able to create a Vector just from an IndexMap too.

chrisrichardson avatar Feb 25 '24 20:02 chrisrichardson

@garth-wells and @chrisrichardson :

Thank you for the discussion. I want to take the lead if no one is already working on this yet.

uvilla avatar Mar 07 '24 16:03 uvilla