Question

i am trying to execute following code , though i know that "syntactically" ordered construct should appear within the for loop, but why the code gets stucked within ordered clause i.e. execution should have given me a straight away "syntax error".

omp_set_num_threads(11);
#pragma omp parallel
{

// 1

 #pragma omp ordered
{
  printf("\n%d ",omp_get_thread_num());//this statement is not getting executed
}//ordered omp pragma

}//parallel omp pragma

the print statement at //1 was successful i even tried to remove ompgetthreadnum() but still no avail.

Était-ce utile?

La solution

#pragma omp ordered may only appear inside #pragma omp for ordered construct.

Source

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top