On 2/19/21 2:38 PM, Timo Heister wrote:
I see additional problems with separate communicators per object:
1. For me it is unclear how operations that involve more than one
object should communicate. For example, a mat-vec has 2 vectors (src,
dst) and a matrix and as such 3 communicators. Of course you can make
an arbitrary choice here, but this doesn't seem clean to me.

That's true, but the point is to avoid different objects communicating on the same communicator. Which of the three you mention here is, in the end, not important -- in fact, we don't care: Let PETSc or Trilinos do what they need to do.


2. MPI_comm_dup can involve communication and as such can be slow for
large processor counts. Not sure you want to always pay the price for
that. I remember at least one MPI implementation that does an
allreduce (or something worse than that).

That is true too, though one would assume that whatever one ends up doing on these communicators is going to be more expensive than the duplication.


3. The number of communicators can be quite limited, see [1]

[1] 
seehttps://nam01.safelinks.protection.outlook.com/?url=https:%2F%2Fwww.mcs.anl.gov%2F~thakur%2Fpapers%2Fmpi-million.pdf&data=04%7C01%7CWolfgang.Bangerth%40colostate.edu%7Ce6d86978f5e643fc78ed08d8d51ed3e0%7Cafb58802ff7a4bb1ab21367ff2ecfc8b%7C0%7C1%7C637493675698569373%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=GwLC%2BU8uHkSXwpa%2F7gyJ9eMM0wl2T%2Bq8qvwYard69TU%3D&reserved=0

I think I read that a couple of years ago. I should probably do that again.

It may not be an important issue. Would a compromise be to duplicate communicators in the constructors of all main classes in the tutorial, as a recommendation of best practices. (This is what ASPECT does, for reference.) This doesn't address the issue of what can go wrong when using multiple threads from within the main class, but it would at least address the issue if someone wanted to run multiple instances of the main class in parallel, and may bring the issue to people's mind.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6adc2f88-7327-9051-9c8c-8c9510720233%40colostate.edu.

Reply via email to