[Openmp-commits] [openmp] [OpenMP] Corrects the setting of the Static_Steal schedule with `omp_set_schedule` (PR #227236)

Samuel Newcome via Openmp-commits openmp-commits at lists.llvm.org
Thu Oct 1 00:50:43 PDT 2026


================
@@ -265,6 +265,13 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
       // Use the scheduling specified by OMP_SCHEDULE (or __kmp_sch_default if
       // not specified)
       schedule = team->t.t_sched.r_sched_type;
+#if KMP_STATIC_STEAL_ENABLED
----------------
SamNewcome wrote:

Doing this here means we only modify the local copy. This means when we `omp_get_schedule`, we get 102/static_steal. Otherwise, the getter will return dynamic without the monotonic bit set. But this is a bit ambiguous as this could be achieved simply with `omp_set_schedule(omp_sched_dynamic)`, which would run dynamic. 

There is a monotonic bit which can be added to `omp_sched_dynamic`, and we could instead assume that the absence of this bit implies non-monotonic dynamic i.e. static_steal in the getter, but I don't like this option because I think it is unclear to users that `omp_set_schedule(omp_sched_dynamic)` would result in static-steal being run and that `omp_get_schedule()` would return static_steal.

https://github.com/llvm/llvm-project/pull/227236


More information about the Openmp-commits mailing list