Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encapsulate multi-process communication (part 2) #1817

Merged
merged 34 commits into from
Oct 15, 2019

Conversation

bradking
Copy link
Collaborator

@bradking bradking commented Oct 8, 2019

Continue work started in #1691 to encapsulate multi-process communication behind a helper::Comm API:

  • Encapsulate remaining MPI types and constants inside helper::Comm and offer equivalents publicly.
  • Convert more code from direct MPI use over to helper::Comm. Add APIs to the latter as needed. * Abstract the helper::Comm implementation internally to work with either MPI or a dummy backend.
  • Replace MPI with helper::Comm in core ADIOS, IO, and Stream interfaces.
  • Minimize direct inclusion of ADIOSMPI.h to only places that still use MPI directly.

Use value `0` for consistency with `MPI_DATATYPE_NULL` and increment
the index of other "op" constants.
Create a dedicated header to hold functions to convert between the Comm
encapsulation and MPI_Comm.  In the future the main Comm header will not
need to include raw MPI interfaces at all.
Move the MPI-backed implementation into a separate file.  Use an
abstraction layer with runtime dispatch so that the main Comm does not
need MPI.  Note that we still use a few MPI types and constants in the
Comm interface, but those can be refactored later.
It was used only inside our own implementation in one place, and its
implementation was just a thin wrapper around our `Allgather` interface,
so simply use that directly.
With our general `Gatherv` interface we no longer need a per-type
specialization of `GathervArrays`.
With our general `Gather` interface we no longer need a per-type
specialization of `GatherArrays`.
With our general `Reduce` interface we no longer need a per-type
specialization of `ReduceValues`.
With our general `Bcast` interface we no longer need a per-type
specialization of `BroadcastValue`.
With our general `Bcast` interface we no longer need a per-type
specialization of `BroadcastVector`.
Avoid explicitly passing `sizeof(T)` to `Bcast`.
Create a Comm implementation for serial programs.  Use implementations
inspired by `source/adios2/helper/mpidummy.cpp`.
If `CommFromMPI()` is given `MPI_COMM_NULL`, fall back to `CommDummy()`
instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants