tags:

views:

75

answers:

1

Hi,

I have a piece of code (which is part of an application) which I'm trying to optimize using OpenMP, am trying out various scheduling policies. In my case, I noticed that the schedule(RUNTIME) clause has an edge over others (I am not specifying a chunk_size). I've two questions:

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

  2. How does OpenMP determine the default implementation specific scheduling that is stored in the OMP_SCHEDULE variable?

I learned that if no scheduling scheme is specified, then by default schedule(STATIC) is used. So if I don't modify the OMP_SCHEDULE variable, and use schedule(RUNTIME) in my program, would the scheduling scheme be schedule(STATIC) all the times OR OpenMP has some intelligent way to dynamically devise the schedule strategy and change it from time to time?

Thanks,
Sayan

+1  A: 
  1. Yes, if you do not specify a chunk size then DYNAMIC will make the size of all chunks 1. But GUIDED will make the minimum chunk size 1 but other chunk sizes will be implementation dependent. Perhaps you could figure out your situation by running some experiments or reading the documentation.

  2. As I understand the situation: if the environment variable OMP_SCHEDULE is not set then the runtime schedule is implementation dependent. I think it would be very odd if the same schedule was not chosen for each execution of the program. I do not believe that OpenMP, which is a set of compile-time directives, has any way to understand the run-time performance of your program and to choose a schedule based on such information.

High Performance Mark
Thanks Mark. In my tests, DYNAMIC was some points above GUIDED, and RUNTIME was the winner all the times.
Sayan
Sayan