[Openmp-commits] [PATCH] D35273: Add recursive task scheduling strategy to taskloop implementation

Hal Finkel via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 11 13:47:39 PDT 2017


As I recall, we currently have an issue with taskloop where all tasks 
are put on the primary thread's queue and then all threads steal from 
that thread's queue (thus giving suboptimal scheduling locality). Is 
that (still) true, and if so, does this change affect that in any way?

Thanks again,
Hal

On 07/11/2017 03:38 PM, Jonathan Peyton via Phabricator via 
Openmp-commits wrote:
> jlpeyton created this revision.
>
> Patch by Andrey Churbanov
>
> Taskloop implementation is extended by using recursive task scheduling.
> Envirable `KMP_TASKLOOP_MIN_TASKS` added as a manual threshold for the user to switch from recursive to linear tasks scheduling.
>
> Details:
>
> - The calculations for the loop parameters are moved from `__kmp_taskloop_linear` upper level
> - Initial calculation is done in the `__kmpc_taskloop`, further range splitting is done in the `__kmp_taskloop_recur`.
> - Added threshold to switch from recursive to linear tasks scheduling;
> - One half of split range is scheduled as an internal task which just moves sub-range parameters to the stealing thread that continues recursive scheduling (if number of tasks still enough), the other half is processed recursively;
> - Internal task duplication routine fixed to assign parent task, that was not needed when all tasks were scheduled by same thread, but is needed now.
>
>
> Repository:
>    rL LLVM
>
> https://reviews.llvm.org/D35273
>
> Files:
>    runtime/src/kmp.h
>    runtime/src/kmp_global.cpp
>    runtime/src/kmp_settings.cpp
>    runtime/src/kmp_tasking.cpp
>    runtime/test/tasking/kmp_taskloop.c
>    runtime/test/tasking/omp_taskloop_grainsize.c
>    runtime/test/tasking/omp_taskloop_num_tasks.c
>
>
>
> _______________________________________________
> Openmp-commits mailing list
> Openmp-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-commits

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20170711/2fb426b9/attachment.html>


More information about the Openmp-commits mailing list