Test which checks the omp_nested function.
2.0
omp_nested
omp critical
/*
* Test if the compiler supports nested parallelism
* By Chunhua Liao, University of Houston
* Oct. 2005
*/
#include
#include "omp_testsuite.h"
int omp_nested(FILE * logFile)
{
int counter = 0;
#ifdef _OPENMP
omp_set_nested(1);
omp_set_nested(0);
#endif
#pragma omp parallel shared(counter)
{
#pragma omp critical
counter ++;
#pragma omp parallel
{
#pragma omp critical
counter --;
}
}
return (counter != 0);
}