Skip to content

[Scheduler] omp parallelize LB#1723

Merged
tdavidcl merged 2 commits intoShamrock-code:mainfrom
tdavidcl:patch-2026-03-21-18-23
Mar 21, 2026
Merged

[Scheduler] omp parallelize LB#1723
tdavidcl merged 2 commits intoShamrock-code:mainfrom
tdavidcl:patch-2026-03-21-18-23

Conversation

@tdavidcl
Copy link
Member

No description provided.

@github-actions
Copy link
Contributor

Thanks @tdavidcl for opening this PR!

You can do multiple things directly here:
1 - Comment pre-commit.ci run to run pre-commit checks.
2 - Comment pre-commit.ci autofix to apply fixes.
3 - Add label autofix.ci to fix authorship & pre-commit for every commit made.
4 - Add label light-ci to only trigger a reduced & faster version of the CI (need the full one before merge).
5 - Add label trigger-ci to create an empty commit to trigger the CI.

Once the workflow completes a message will appear displaying informations related to the run.

Also the PR gets automatically reviewed by gemini, you can:
1 - Comment /gemini review to trigger a review
2 - Comment /gemini summary for a summary
3 - Tag it using @gemini-code-assist either in the PR or in review comments on files

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving the performance of the load balancing logic by parallelizing key sections of the code using OpenMP. It also reduces logging verbosity by adding a log level check before printing debug messages. The changes primarily affect LoadBalanceStrategy.hpp and HilbertLoadBalance.cpp.

Highlights

  • Parallelization: The load balancing logic in LoadBalanceStrategy.hpp and HilbertLoadBalance.cpp was parallelized using OpenMP to improve performance.
  • Patch Packing: The apply_node_patch_packing function in HilbertLoadBalance.cpp was modified to use OpenMP for parallel execution, replacing the previous SYCL implementation.
  • Logging: Added a check for log level before printing debug messages in HilbertLoadBalance.cpp and LoadBalanceStrategy.hpp to reduce verbosity.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to improve performance by parallelizing load balancing logic using OpenMP. The changes are generally well-implemented, converting sequential loops to parallel ones and optimizing related code structures. However, a critical data race was identified in one of the newly parallelized loops in HilbertLoadBalance.cpp, which could lead to non-deterministic behavior. The review includes a specific comment with a suggested fix for this issue.

@github-actions
Copy link
Contributor

Workflow report

workflow report corresponding to commit a4110ed
Commiter email is timothee.davidcleris@proton.me
GitHub page artifact URL GitHub page artifact link (can expire)

Pre-commit check report

Pre-commit check: ✅

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check for merge conflicts................................................Passed
check that executables have shebangs.....................................Passed
check that scripts with shebangs are executable..........................Passed
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check for broken symlinks................................................Passed
check yaml...............................................................Passed
detect private key.......................................................Passed
No-tabs checker..........................................................Passed
Tabs remover.............................................................Passed
Validate GitHub Workflows................................................Passed
clang-format.............................................................Passed
ruff check...............................................................Passed
ruff format..............................................................Passed
Check doxygen headers....................................................Passed
Check license headers....................................................Passed
Check #pragma once.......................................................Passed
Check SYCL #include......................................................Passed
No ssh in git submodules remote..........................................Passed
No UTF-8 in files (except for authors)...................................Passed

Test pipeline can run.

Clang-tidy diff report

No relevant changes found.
Well done!

You should now go back to your normal life and enjoy a hopefully sunny day while waiting for the review.

Doxygen diff with main

Removed warnings : 7
New warnings : 7
Warnings count : 8366 → 8366 (0.0%)

Detailed changes :
- src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:194: warning: Compound shamrock::scheduler::details::LBMetric is not documented.
- src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:195: warning: Member min (variable) of struct shamrock::scheduler::details::LBMetric is not documented.
- src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:196: warning: Member max (variable) of struct shamrock::scheduler::details::LBMetric is not documented.
- src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:197: warning: Member mean (variable) of struct shamrock::scheduler::details::LBMetric is not documented.
- src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:198: warning: Member stddev (variable) of struct shamrock::scheduler::details::LBMetric is not documented.
+ src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:204: warning: Compound shamrock::scheduler::details::LBMetric is not documented.
+ src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:205: warning: Member min (variable) of struct shamrock::scheduler::details::LBMetric is not documented.
+ src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:206: warning: Member max (variable) of struct shamrock::scheduler::details::LBMetric is not documented.
+ src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:207: warning: Member mean (variable) of struct shamrock::scheduler::details::LBMetric is not documented.
+ src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:208: warning: Member stddev (variable) of struct shamrock::scheduler::details::LBMetric is not documented.
- src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:253: warning: The following parameter of shamrock::scheduler::load_balance(std::vector< TileWithLoad< Torder, Tweight > > &&lb_vector, i32 world_size=shamcomm::world_size()) is not documented:
+ src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:263: warning: The following parameter of shamrock::scheduler::load_balance(std::vector< TileWithLoad< Torder, Tweight > > &&lb_vector, i32 world_size=shamcomm::world_size()) is not documented:
- src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:44: warning: Member LoadBalancedTile(TileWithLoad< Torder, Tweight > in, u64 inindex) (function) of struct shamrock::scheduler::details::LoadBalancedTile is not documented.
+ src/shamrock/include/shamrock/scheduler/loadbalance/LoadBalanceStrategy.hpp:46: warning: Member LoadBalancedTile(TileWithLoad< Torder, Tweight > in, u64 inindex) (function) of struct shamrock::scheduler::details::LoadBalancedTile is not documented.

@tdavidcl tdavidcl merged commit f006bd8 into Shamrock-code:main Mar 21, 2026
76 checks passed
@tdavidcl tdavidcl deleted the patch-2026-03-21-18-23 branch March 21, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant