Page MenuHomePhabricator

Add strict mode in num_tasks and grainsize

Authored by Nawrin on Nov 30 2020, 4:05 PM.



This patch adds new API __kmpc_taskloop_5 to incorporate strict modifier in num_tasks and grainsize clause. In num_tasks with strict, the logical iterations are partitioned in balanced manner and is assigned in order to a generated task. In grainsize with strict, the number of logical iterations assigned to each task is equal to the value of grainsize, except for the task that contains the last iteration, which may have fewer iterations.

For example -

#pragma omp taskloop grainsize(strict:4)
for (i = 0; i < 22; i++)

This will create 6 tasks (4, 4, 4, 4, 4, 2)

#pragma omp taskloop num_tasks(strict:5)
for (i = 0; i < 22; i++)

This will create 5 tasks (5, 5, 4, 4, 4)

Diff Detail

Event Timeline

Nawrin created this revision.Nov 30 2020, 4:05 PM
Nawrin requested review of this revision.Nov 30 2020, 4:05 PM
This revision is now accepted and ready to land.Dec 9 2020, 6:49 AM
This revision was landed with ongoing or failed builds.Dec 9 2020, 2:47 PM
This revision was automatically updated to reflect the committed changes.