Skip to content

A simple try assisted with GPT : nonblocking gather/scatter exchanges#7396

Open
mystic-qaq wants to merge 2 commits into
deepmodeling:developfrom
mystic-qaq:feat/unblock
Open

A simple try assisted with GPT : nonblocking gather/scatter exchanges#7396
mystic-qaq wants to merge 2 commits into
deepmodeling:developfrom
mystic-qaq:feat/unblock

Conversation

@mystic-qaq
Copy link
Copy Markdown

@mohanchen mohanchen added Refactor Refactor ABACUS codes Tests/Examples Issues/PR related to unit tests and integrate tests labels May 29, 2026
@Cstandardlib Cstandardlib requested a review from Copilot May 29, 2026 14:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors PW_Basis::gatherp_scatters and PW_Basis::gathers_scatterp from blocking MPI_Alltoallv to non-blocking MPI_Irecv/MPI_Isend exchanges with overlapping pack/unpack work, adds a per-instance reusable communication workspace, and introduces a round-trip unit test.

Changes:

  • Replace MPI_Alltoallv with non-blocking sends/receives plus MPI_Waitsome-driven unpack overlap in both gather/scatter directions, separating send/receive into distinct workspace slices.
  • Add acquire_comm_workbuf<T>() returning per-instance mutable std::vector storage (float and double specializations) and add fine-grained timer regions.
  • Add test_comm_roundtrip.cpp (round-trip equality and a zero-plane "stress" layout sweep) and register it in the test CMakeLists.txt.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
source/source_basis/module_pw/pw_gatherscatter.h Rewrites both routines to use Irecv/Isend with manual self-copy, dedicated send/recv workspace, and overlapped unpack via MPI_Waitsome.
source/source_basis/module_pw/pw_basis.h Declares acquire_comm_workbuf plus mutable per-instance buffers; adds <vector> include.
source/source_basis/module_pw/test/test_comm_roundtrip.cpp New round-trip tests using a friend accessor subclass to call the protected gather/scatter methods.
source/source_basis/module_pw/test/CMakeLists.txt Registers the new test source file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes Tests/Examples Issues/PR related to unit tests and integrate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants