1 // RUN: %libomp-compile-and-run
2 // RUN: %libomp-compile && env KMP_BLOCKTIME=infinite %libomp-run
3 // RUN: %libomp-compile && env KMP_PLAIN_BARRIER_PATTERN='hierarchical,hierarchical' KMP_FORKJOIN_BARRIER_PATTERN='hierarchical,hierarchical' %libomp-run
4 // RUN: %libomp-compile && env KMP_BLOCKTIME=infinite KMP_PLAIN_BARRIER_PATTERN='hierarchical,hierarchical' KMP_FORKJOIN_BARRIER_PATTERN='hierarchical,hierarchical' %libomp-run
5 // RUN: %libomp-compile && env KMP_PLAIN_BARRIER_PATTERN='dist,dist' KMP_FORKJOIN_BARRIER_PATTERN='dist,dist' KMP_REDUCTION_BARRIER_PATTERN='dist,dist' %libomp-run
6 // RUN: %libomp-compile && env KMP_BLOCKTIME=infinite KMP_PLAIN_BARRIER_PATTERN='dist,dist' KMP_FORKJOIN_BARRIER_PATTERN='dist,dist' KMP_REDUCTION_BARRIER_PATTERN='dist,dist' %libomp-run
8 #include "omp_testsuite.h"
9 #include "omp_my_sleep.h"
11 int test_omp_barrier()
21 rank
= omp_get_thread_num ();
23 my_sleep(((double)SLEEPTIME
)/REPETITIONS
); // give 1 sec to whole test
31 return (result1
== 3);
40 omp_set_dynamic(0); // prevent runtime to change number of threads
41 omp_set_num_threads(4); // the test expects at least 3 threads
42 for(i
= 0; i
< REPETITIONS
; i
++) {
43 if(!test_omp_barrier()) {