Skip to content

feat(cuqdyn-c): split the leave-one-out points across any process count - #17

Open
ZocoLini wants to merge 1 commit into
mainfrom
feat/mpi-any-process-count
Open

feat(cuqdyn-c): split the leave-one-out points across any process count#17
ZocoLini wants to merge 1 commit into
mainfrom
feat/mpi-any-process-count

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Sep 8, 2026

Copy link
Copy Markdown
Owner

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.

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
ZocoLini force-pushed the feat/mpi-any-process-count branch from cd0378c to dd9e838 Compare September 8, 2026 16:18
@ZocoLini
ZocoLini marked this pull request as ready for review September 8, 2026 16:27
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.

1 participant