Adding AdiosGlobalComm for global data exchange#54
Conversation
|
Please explain a bit more in the PR description or ideally, in code comments, what 'global' means and an example of how this is used. Please also undo all the whitespace changes. It looks like redev_comm.h has many lines of just reformatting. |
| return CommV{impl_.template CreateComm< | ||
| CommunicatorTypeMap<CommunicatorDataType::INT8>::type>( | ||
| std::move(name), comm)}; | ||
| std::move(name), comm, std::move(ctype))}; |
There was a problem hiding this comment.
No need to move ctype since it's an enum move will have no impact.
|
@hgangwar is this ready for review? If so, can you make it non draft. |
I would like to test it with the updated PCMS before merging. |
|
@cwsmith we need this to finalize some of Harsh's timestepping stuff. Any issues with merging? |
There was a problem hiding this comment.
Pull request overview
This PR adds a new “global” ADIOS2 communicator mode to enable exchanging global data/metadata across coupled applications, while preserving the existing partitioned communicator behavior as the default.
Changes:
- Introduces
CommType(Partitioned vs Global) and routes channel communicator creation through it. - Adds
Communicator::SetCommParamsand wires it throughBidirectionalCommto support selecting variable name/size dynamically. - Implements
AdiosGlobalCommand adds a new MPI test (test_global_comm) plus CMake wiring.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| test_global_comm.cpp | Adds a new integration test exercising the global communicator send/recv path. |
| redev_types.h | Adds CommType enum to select communicator mode. |
| redev_comm.h | Renames partitioned comm class and adds AdiosGlobalComm + SetCommParams API. |
| redev_channel.h | Threads CommType through the type-erased Channel communicator factory. |
| redev_bidirectional_comm.h | Adds a SetCommParams helper on the bidirectional communicator wrapper. |
| redev_adios_channel.h | Creates either partitioned or global communicator implementations based on CommType. |
| CMakeLists.txt | Builds and registers the new test_global_comm MPI test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| virtual void SetCommParams(std::string VarName, size_t msgSize ) { | ||
| throw std::logic_error("Communicator::SetCommParams() called — must be overridden in the derived Comm class"); | ||
| } |
There was a problem hiding this comment.
This is correct, we should fix this. Is there a reason that SetCommParams cannot just be pure virtual like the other methods?
There was a problem hiding this comment.
Looked more in depth. This should definitely be made pure virtual. Also, I think it would make more sense if you put the varName into the constructor which would be consistent with the PartitionedComm. Lastly, consider naming this SetOutSize, or something that is consistent with the partitioned comm.
There was a problem hiding this comment.
I can make Communicator::SetCommParams() purely virtual. It provides the flexibility of reusing the bidirectional comm of multiple varibles of different size. That's why I kept VarName separate from comm name used in the constructor, and called it SetCommParams.
cwsmith
left a comment
There was a problem hiding this comment.
I didn't see anything obviously concerning.
If this hasn't been tested on a machine like Frontier across a couple nodes that may be a good thing to do while the code is still 'fresh'.
| * across all ranks and partitions. | ||
| * | ||
| * It is primarily used for transferring global data and metadata | ||
| * relevant to coupled applications. |
There was a problem hiding this comment.
Maybe an example of what is considered 'global data/metadata' would be helpful here.
|
@hgangwar not sure why my other comments didn't go through, but last two things...
Let me know if this also seems sensible to you. |
This PR introduces a Global ADIOS communicator
Key Changes
AdiosGlobalComm::Communicatorclass. This global communicator is intended for exchanging global data and metadata between coupled applications.AdiosChannel::CreateCommto route communicator creation through theCommTypeenum which defines the Ptn and Global communication modes..The existing API remains unchanged. If
CommTypeis not provided,channel.CreateCommdefaults toCommType::Ptnand behaves as before.Added a virtual (non-pure) function
redev::Communicator::SetCommParamsto specify the active variable's name and size.redev::Communicator::send()operated on a raw pointer, which prevented communicating the message size without deducing it from the in/out layout.A testcase to test
AdiosGlobalComm.