feat(cuqdyn-c): split the leave-one-out points across any process count - #17
Open
ZocoLini wants to merge 1 commit into
Open
feat(cuqdyn-c): split the leave-one-out points across any process count#17ZocoLini wants to merge 1 commit into
ZocoLini wants to merge 1 commit into
Conversation
The m - 1 points were handed out in equal blocks, so a process count that did not divide them was refused outright: rank 0 printed the error and every rank returned NULL, because carrying on would have left them blocking on sends nobody receives. They now go out as a block distribution, the first (m - 1) % nproc ranks taking one point more than the rest. Rank 0 is among them, so it stays in the loop at least as long as anybody else and can still collect from every rank; on the cycles where the ranks that drew fewer points have already left, it skips their MPI_Recv rather than waiting on a send that never comes. Asking for more processes than there are points leaves the surplus ranks idle. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HYfR3Uw7zZhBk9oNQT45oh
ZocoLini
force-pushed
the
feat/mpi-any-process-count
branch
from
September 8, 2026 16:18
cd0378c to
dd9e838
Compare
ZocoLini
marked this pull request as ready for review
September 8, 2026 16:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The m - 1 points were handed out in equal blocks, so a process count that did not divide them was refused outright: rank 0 printed the error and every rank returned NULL, because carrying on would have left them blocking on sends nobody receives.
They now go out as a block distribution. The first (m - 1) % nproc ranks take one point more than the rest, which costs those ranks one extra cycle instead of costing the run. Rank 0 is among them, so it stays in the loop at least as long as anybody else and can still collect from every rank. On the cycles where the ranks that drew fewer points have already left, rank 0 skips their MPI_Recv: each share follows from m - 1, nproc and the rank, so it knows without being told.
Asking for more processes than there are points leaves the surplus ranks idle.