Test which checks the omp parallel for nowait directive. It fills an array with values and operates on these in the following. omp parallel for nowait 1.0 omp parallel for, omp flush #include #include "omp_testsuite.h" #include "omp_my_sleep.h" int omp_for_nowait (FILE * logFile) { int result; int count; int j; int myarray[LOOPCOUNT]; result = 0; count = 0; #pragma omp parallel { int rank; int i; rank = omp_get_thread_num(); #pragma omp for nowait for (i = 0; i < LOOPCOUNT; i++) { if (i == 0) { fprintf (logFile, "Thread nr %d entering for loop and going to sleep.\n", rank); my_sleep(SLEEPTIME); count = 1; #pragma omp flush(count) fprintf (logFile, "Thread nr %d woke up and set count = 1.\n", rank); } } fprintf (logFile, "Thread nr %d exited first for loop and enters the second.\n", rank); #pragma omp for for (i = 0; i < LOOPCOUNT; i++) { #pragma omp flush(count) if (count == 0) result = 1; } } return result; }