Schedule Assignment in OpenMP

I have a piece of code (which is part of the application) that I am trying to optimize using OpenMP, I am trying to use various scheduling policies. In my case, I noticed that the schedule(RUNTIME) takes precedence over others (I don't specify chunk_size). I have two questions:

  • When I do not specify chunk_size, is there a difference between schedule(DYNAMIC) and schedule(GUIDED) ?

  • How does OpenMP define the standardized default scheduling that is stored in the OMP_SCHEDULE variable?

I found out that if no scheduling scheme is specified, then schedule(STATIC) used by default. Therefore, if I do not change the OMP_SCHEDULE variable and use schedule(RUNTIME) in my program, will there be a schedule(STATIC) scheduling scheme schedule(STATIC) all the time or does OpenMP have a reasonable way to dynamically develop a schedule strategy and change it from time to time?

+7
openmp
source share
1 answer
  • Yes, if you do not specify a block size, then DYNAMIC will make the size of all pieces 1. But GUIDED will make the minimum size of piece 1, but other block sizes will be implementation dependent. Perhaps you could clarify your situation by doing some experimentation or reading the documentation.

  • As I understand the situation: if the environment variable OMP_SCHEDULE is not set, the execution schedule depends on the implementation. I think it would be very strange if there weren’t the same schedule for each program execution. I do not believe that OpenMP, which is a compilation of compile-time directives, has any way to understand the performance at runtime of your program and choose a schedule based on such information.

+5
source share

All Articles