-
Looking at the packages/muelu/doc/Tutorial/src/laplace2d.cpp, there are several comm->barrier() commands sprinkled throughout. And at lines 383, 384, 385, 3 of them in a row. Wouldn't one call be sufficient? And what is a good rule of thumb to know when to call a barrier? Thanks in advance for any guidance and clarification. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
One barrier is sufficient, and adding more isn't useful. At one time long ago, maybe that wasn't the case. Barriers are useful if you want to synchronize all MPI ranks in a communicator. In MueLu examples, we do that to ensure all ranks have finished a section of code that's being timed. |
Beta Was this translation helpful? Give feedback.
One barrier is sufficient, and adding more isn't useful. At one time long ago, maybe that wasn't the case.
Barriers are useful if you want to synchronize all MPI ranks in a communicator. In MueLu examples, we do that to ensure all ranks have finished a section of code that's being timed.