Skip to content

Change ORB to support arbitrary decomposition axes - #560

Open
aliemen wants to merge 16 commits into
masterfrom
559-orb-does-not-allow-arbitrary-decomposition-axis
Open

aliemen wants to merge 16 commits into
masterfrom
559-orb-does-not-allow-arbitrary-decomposition-axis

Conversation

@aliemen

@aliemen aliemen commented Jul 1, 2026 •

Copy link
Copy Markdown
Collaborator

closes #559

This PR generalizes the ORB class to allow decomposing in arbitrary axis. Now you can e.g. pass a std::array<bool, Dim> allowedAxes = {false, false, true}; array to indicate that you only want to decompose in z. The actual algorithm is more or less untouched. The addition is mostly in the helpers like findAxis. Here an example in our SwissFEL-booster-sc input file from the OPALX side with decomposition only in z:

grafik

The decomposition works just fine only in z direction.

Other changes:

  • Add allowed-axis cut selection:
    • findCutAxis(domain, allowedAxes) chooses the longest enabled axis,
    • returns failure if no enabled cut axis exists.
  • Add validation before changing the layout:
    • reject selected cut axes with fewer than 4 cells,
    • clamp weighted median cuts to [1, cutAxisLength - 3],
    • reject one-cell domains,
    • reject boxes outside the global domain,
    • reject cuts along disabled axes,
    • reject overlapping boxes,
    • reject incomplete tiling of the global domain,
    • reject proposals whose domain count does not match the communicator size.
  • Update FieldLayout and ORB weight field only after correct decomposition is found.

@aliemen
aliemen requested a review from aaadelmann July 1, 2026 11:25
@aliemen aliemen self-assigned this Jul 1, 2026
@aliemen aliemen added enhancement New feature or request gitlab-mirror labels Jul 1, 2026
@aliemen aliemen linked an issue Jul 1, 2026 that may be closed by this pull request
@aliemen

aliemen commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

cscs-ci run cscs-ci-gh200

@aliemen

aliemen commented Jul 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Jülich CI passes just fine. I don't know what cscs/cscs-ci-gh200 is doing, it says "no CUDA-capable device is detected" and doesn't re-start... Looks like it worked now

@aaadelmann
aaadelmann requested a review from srikrrish July 1, 2026 19:44
@aaadelmann

Copy link
Copy Markdown
Member

General comment: before this can go into master we need to make sure it works with several k of GPUs. @srikrrish in ALPINE which of the tests are with ORB == ON?

@srikrrish

Copy link
Copy Markdown
Member

General comment: before this can go into master we need to make sure it works with several k of GPUs. @srikrrish in ALPINE which of the tests are with ORB == ON?

Any of the Alpine example with load balancing threshold < 1 may invoke ORB (depending on the threshold). For example the usual value of 0.01 which means load balancing should be triggered when particle load imbalance in any rank exceeds 1% is a good start. I think Penning trap with more than 8 ranks might be the good stress test.

@aliemen yes the initial parallel/serial decomposition should be preserved during ORB also. If not that was a bug and if this PR fixes it that's a good thing I would say.

Comment thread src/Decomposition/OrthogonalRecursiveBisection.h Outdated
Comment thread src/Decomposition/OrthogonalRecursiveBisection.h Outdated
aliemen added a commit that referenced this pull request Sep 27, 2026
@aliemen aliemen linked an issue Sep 27, 2026 that may be closed by this pull request
@aliemen

aliemen commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator Author

Update: Instead of overloads with an allowedAxes mask, binaryRepartition(R, fl, isFirstRepartition, forbiddenAxes = {}) and findCutAxis(dom, forbiddenAxes = {}) take a forbiddenAxes mask, so all false is the default (legacy) behavior.

While running the unit test on 4 ranks I noticed that it only works <4 ranks, because ORB weights in the unit test were zero. Should be fixed now and passes on 1, 2, 4, 8 ranks.

…ranks. Some helpers for previous allowedAxes are now obsolete
@aliemen
aliemen enabled auto-merge October 9, 2026 10:19
@aliemen

aliemen commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

I activated "auto-merge". So once @srikrrish resolves the conversations, it should merge automatically (given that the tests pass)

@aliemen

aliemen commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

cscs-ci run cscs-ci-gh200, cscs-ci-mi300, cscs-ci-openmp

This branch has not been deployed

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

Labels

enhancement New feature or request gitlab-mirror

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ORB does not reject domains with width 0 ORB does not allow arbitrary decomposition axis

3 participants