Skip to content

Adding AdiosGlobalComm for global data exchange#54

Open
hgangwar wants to merge 16 commits into
SCOREC:mainfrom
hgangwar:separate_comm
Open

Adding AdiosGlobalComm for global data exchange#54
hgangwar wants to merge 16 commits into
SCOREC:mainfrom
hgangwar:separate_comm

Conversation

@hgangwar

@hgangwar hgangwar commented Nov 13, 2025

Copy link
Copy Markdown

This PR introduces a Global ADIOS communicator

Key Changes

  • Added a new AdiosGlobalComm::Communicator class. This global communicator is intended for exchanging global data and metadata between coupled applications.
  • Updated AdiosChannel::CreateComm to route communicator creation through the CommType enum which defines the Ptn and Global communication modes..
  • Usage example: This creates a bidirectional communicator associated with the channel.
    auto channel =
        rdv.CreateAdiosChannel(name, params, redev::TransportType::BP4);
    auto commPair =
        channel.CreateComm<redev::Real>(name, comm, redev::CommType::Global);
  • The existing API remains unchanged. If CommType is not provided, channel.CreateComm defaults to CommType::Ptn and behaves as before.

  • Added a virtual (non-pure) function redev::Communicator::SetCommParams to specify the active variable's name and size.

    • The existing redev::Communicator::send() operated on a raw pointer, which prevented communicating the message size without deducing it from the in/out layout.
    • A single channel using a Global communicator can now read and write multiple variables.
  • A testcase to test AdiosGlobalComm.

@cwsmith

cwsmith commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

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.

Comment thread redev_types.h Outdated
Comment thread redev_comm.h Outdated
Comment thread redev_channel.h Outdated
return CommV{impl_.template CreateComm<
CommunicatorTypeMap<CommunicatorDataType::INT8>::type>(
std::move(name), comm)};
std::move(name), comm, std::move(ctype))};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to move ctype since it's an enum move will have no impact.

Comment thread redev_comm.h Outdated
@jacobmerson jacobmerson marked this pull request as ready for review December 9, 2025 16:39
@jacobmerson jacobmerson marked this pull request as draft December 9, 2025 16:39
@jacobmerson

Copy link
Copy Markdown
Collaborator

@hgangwar is this ready for review? If so, can you make it non draft.

@hgangwar

hgangwar commented May 1, 2026

Copy link
Copy Markdown
Author

@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.

@hgangwar hgangwar marked this pull request as ready for review July 12, 2026 17:13
@jacobmerson

Copy link
Copy Markdown
Collaborator

@cwsmith we need this to finalize some of Harsh's timestepping stuff. Any issues with merging?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::SetCommParams and wires it through BidirectionalComm to support selecting variable name/size dynamically.
  • Implements AdiosGlobalComm and 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.

Comment thread redev_comm.h
Comment thread redev_comm.h
Comment thread redev_comm.h
Comment on lines +142 to +144
virtual void SetCommParams(std::string VarName, size_t msgSize ) {
throw std::logic_error("Communicator::SetCommParams() called — must be overridden in the derived Comm class");
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, we should fix this. Is there a reason that SetCommParams cannot just be pure virtual like the other methods?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread redev_bidirectional_comm.h
Comment thread CMakeLists.txt
Comment thread test_global_comm.cpp
Comment thread test_global_comm.cpp Outdated
Comment thread test_global_comm.cpp Outdated
Comment thread redev_comm.h
Comment thread redev_types.h Outdated

@cwsmith cwsmith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'.

Comment thread redev_comm.h
* across all ranks and partitions.
*
* It is primarily used for transferring global data and metadata
* relevant to coupled applications.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe an example of what is considered 'global data/metadata' would be helpful here.

@jacobmerson

Copy link
Copy Markdown
Collaborator

@hgangwar not sure why my other comments didn't go through, but last two things...

  1. move the variable name from SetCommParams to the constructor. This is consistent with the PartitionedComm
  2. Rename SetCommParams to SetOutSize. This will also be more consistent with naming of the PartitionedComm

Let me know if this also seems sensible to you.

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.

4 participants