Clean up MPI vs. tMPI library context management.
Follow up from #3644 (closed)
Relates to #3650
- Improve RAII semantics for "MpiContext". Either find a way to join the initialization of thread-MPI context with its acquisition or consider alternatives to using such an object in the corresponding tMPI program scope.
SimulationContextinvariant(s). Encode the invariant(s) with strong typing to improve readability across tMPI vs. MPI builds.
libraryCommunicatorfrom the MPI
SimulationContextinto a PhysicalNodeCommunicator. (tMPI can have an unset
std::optionalor similar if such resources cannot be provided through SimulationContext on this code path.)
#3644 (closed) notes that multisim is reasonably a higher-level detail that can be separated into layers, such that
SimultionContext can abstractly present the simulator with a single communicator or abstract communication resources. We should reserve such discussions for separately tracked issues.