-
-
Notifications
You must be signed in to change notification settings - Fork 850
Replace omp_set_nested (deprecated) with omp_set_max_active_levels #1887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -141,7 +141,7 @@ void createVerticesWithVisibilities(const StaticVector<int>& cams, | |||||||
| for (auto& lock : locks) | ||||||||
| omp_init_lock(&lock); | ||||||||
|
|
||||||||
| omp_set_nested(1); | ||||||||
| omp_set_max_active_levels(2); | ||||||||
|
||||||||
| omp_set_max_active_levels(2); | |
| constexpr int kMaxOmpActiveLevels = 2; // Maximum number of nested parallel regions allowed by OpenMP. | |
| omp_set_max_active_levels(kMaxOmpActiveLevels); |
Copilot uses AI. Check for mistakes.
Copilot
AI
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Similarly, you may want to define 1 as a constant (e.g. kSingleOmpLevel) to clarify that this disables nested parallelism and maintain consistency.
| omp_set_max_active_levels(1); | |
| omp_set_max_active_levels(kSingleOmpLevel); |
Copilot uses AI. Check for mistakes.
Copilot
AI
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This duplicated literal could also be replaced by a shared constant or inline comment, so readers understand it matches the upper-level parallel region's configuration.
| omp_set_max_active_levels(2); | |
| omp_set_max_active_levels(MAX_OMP_ACTIVE_LEVELS); |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Again, consider using a named constant or comment for
2to make its intent clear in this context of nested parallel extraction.Copilot uses AI. Check for mistakes.