Skip to content

Improvement: Use sc_MPI_Sendrecv in vector handler - #2369

Open
tokito-99 wants to merge 5 commits into
DLR-AMR:mainfrom
tokito-99:use-sc-mpi-sendrecv
Open

Improvement: Use sc_MPI_Sendrecv in vector handler#2369
tokito-99 wants to merge 5 commits into
DLR-AMR:mainfrom
tokito-99:use-sc-mpi-sendrecv

Conversation

@tokito-99

Copy link
Copy Markdown

Describe your changes here:

Closes #2332

This PR replaces the two direct calls to MPI_Sendrecv in t8_vector_handler::sendrecv with the corresponding sc_MPI_Sendrecv wrapper.

The first call exchanges the sizes of the packed messages, while the second call exchanges the packed message data. No communication logic, message parameters, or buffer handling is changed.

The pinned libsc revision is updated to include the sc_MPI_Sendrecv implementation introduced by cburstedde/libsc#237.

Testing performed locally:

cmake --build build -j 4
ctest --test-dir build -R t8_gtest_data_pack_parallel --output-on-failure

Result:

t8_gtest_data_pack_parallel ... Passed
100% tests passed, 0 tests failed out of 1

The existing t8_gtest_data_pack_parallel test exercises the modified send-receive implementation.

My BSD authorization statement is already present.

All these boxes must be checked by the AUTHOR before requesting review:

  • The PR is small enough to be reviewed easily. If not, consider splitting up the changes in multiple PRs.
  • The title starts with one of the following prefixes: Documentation:, Bugfix:, Feature:, Improvement: or Other:.
  • If the PR is related to an issue, make sure to link it.
  • The author made sure that, as a reviewer, he/she would check all boxes below.

All these boxes must be checked by the REVIEWERS before merging the pull request:

As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.

General

  • The reviewer executed the new code features at least once and checked the results manually.
  • The code follows the t8code coding guidelines.
  • New source/header files are properly added to the CMake files.
  • The code is well documented. In particular, all function declarations, structs/classes and their members have a proper doxygen documentation. Make sure to add a file documentation for each file!
  • README.md files are updated if necessary.
  • All new algorithms and data structures are sufficiently optimal in terms of memory and runtime (If this should be merged, but there is still potential for optimization, create a new issue).

Tests

  • The code is covered in an existing or new test case using Google Test.
  • The code coverage of the project (reported in the CI) should not decrease. If coverage is decreased, make sure that this is reasonable and acceptable.
  • Valgrind doesn't find any bugs in the new code. This script can be used to check for errors; see also this wiki article.

If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):

  • Should this use case be added to the github action?
  • If not, does the specific use case compile and all tests pass (check manually).

Scripts and Wiki

  • If a new directory with source files is added, it must be covered by the scripts/internal/find_all_source_files.sh to check the indentation of these files.
  • If this PR introduces a new feature, it must be covered in an example or tutorial and a Wiki article.

License

  • The author added a BSD statement to doc/ (or already has one).

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.28%. Comparing base (56c9b8d) to head (a9248d3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2369   +/-   ##
=======================================
  Coverage   82.28%   82.28%           
=======================================
  Files         125      125           
  Lines       20701    20701           
=======================================
  Hits        17033    17033           
  Misses       3668     3668           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sandro-elsweijer sandro-elsweijer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @tokito-99,

thank you again for your contribution!
Is there a specific reason why you deactivated the shallow clone of libsc?
Apart from that everything looks good

Comment thread cmake/thirdparty.json Outdated
Co-authored-by: Sandro Elsweijer <49643115+sandro-elsweijer@users.noreply.github.com>

@spenke91 spenke91 left a comment

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.

Thanks a lot @tokito-99 for your contribution to t8code! 🙂

Regarding the failing CI, my guess is that we should use the latest commit of the SC library, or at least not one from a "sub-tree" 🤔 I'd say it's definitely worth a shot 🤞

Comment thread cmake/thirdparty.json Outdated
@spenke91 spenke91 removed their assignment Jul 30, 2026
Co-authored-by: spenke91 <thomas.spenke@dlr.de>
@tokito-99

Copy link
Copy Markdown
Author

@spenke91 Thanks for the suggestion :) We are green here 💯

@spenke91 spenke91 left a comment

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.

Looks good, thanks again! 🥳

@spenke91
spenke91 enabled auto-merge July 31, 2026 06:07
@spenke91
spenke91 requested review from sandro-elsweijer and removed request for sandro-elsweijer July 31, 2026 06:07
@spenke91
spenke91 disabled auto-merge July 31, 2026 08:13
@spenke91
spenke91 requested review from sandro-elsweijer and removed request for sandro-elsweijer July 31, 2026 08:16
@spenke91
spenke91 enabled auto-merge July 31, 2026 08:18
@spenke91

Copy link
Copy Markdown
Collaborator

@tokito-99 I think we are ready to merge, but @sandro-elsweijer has click "approve" once because he requested changes earlier. He will do so on Monday as he is on vacation today.

@spenke91

spenke91 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

@tokito-99 In the meantime, let me use the opportunity to ask you: What are your plans and goals you are you using t8code for? 🙂
Also, I would like to invite you to our t8code Matrix space. It's the easiest way to get into / stay in touch with other users and developers of t8code, ask questions etc.

Here's an excerpt from the inviation info:

If you have for example a HIFIS- or Academic-Cloud-Matrix account, you should be able to directly join the t8code-Space via: t8code - Community
If not, you could create an Academic-Cloud-Account (either via your institution or as a guest with only an e-mail address) which allows you to join the Matrix-instance via the home server https://chat.academiccloud.de/ afterwards you should be able to join the public space "Open - t8code": https://matrix.to/#/#open---t8code:dlr.de (There are some instructions about the First Steps - Matrix which can be followed and a FAQ about joining Matrix via Academic Cloud; if you created a Matrix-Account this way, it is highly recommended to set up and store a Recovery Key)
Once you joined the "Open - t8code"-Space you are able to join the different t8code-related channels.

If you happen to already have a Matrix account, you can also use that one.

P.S.: We only switched to Matrix very recently, so please excuse some possible "technical friction" :-)

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.

Use sc_MPI_Sendrecv instead of MPI_Sendrecv

3 participants