سؤال

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.

هل كانت مفيدة؟

المحلول

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

Source

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top