What's the difference between “static” and “dynamic” schedule in OpenMP?

后端 未结 3 1705
既然无缘
既然无缘 2020-11-27 11:21

I started working with OpenMP using C++.

I have two questions:

  1. What is #pragma omp for schedule?
  2. What is the difference between
3条回答
  •  广开言路
    2020-11-27 12:02

    The loop partitioning scheme is different. The static scheduler would divide a loop over N elements into M subsets, and each subset would then contain strictly N/M elements.

    The dynamic approach calculates the size of the subsets on the fly, which can be useful if the subsets' computation times vary.

    The static approach should be used if computation times vary not much.

提交回复
热议问题