mercredi 28 juillet 2021

How to override the OpenMp runtime scheduling policy using OMP_SCHEDULE environment variable?

I have an openMP parallel for loop of the form

#pragma omp for schedule(dynamic)
for(std::size_t i = 0 ; i < myArray.size() ; i++)
{
  //some code here
}

In other words by default this loop uses dynamic scheduling. However if the user specifies the OMP_SCHEDULE environment variable I want to be able to override the dynamic policy with whatever policy is specified in OMP_SCHEDULE. How can this be done? In other words if OMP_SCHEDULE is not specified I want to use a dynamic schedule by default. It is my understanding that in the above code, because I have specified schedule(dynamic) it is going to ignore any policy specified in OMP_SCHEDULE, is this correct? Thanks

Aucun commentaire:

Enregistrer un commentaire