diff --git a/openmp/runtime/test/barrier/omp_barrier.c b/openmp/runtime/test/barrier/omp_barrier.c --- a/openmp/runtime/test/barrier/omp_barrier.c +++ b/openmp/runtime/test/barrier/omp_barrier.c @@ -1,9 +1,16 @@ +// default is hyper barrier // RUN: %libomp-compile-and-run // RUN: %libomp-compile && env KMP_BLOCKTIME=infinite %libomp-run -// RUN: %libomp-compile && env KMP_PLAIN_BARRIER_PATTERN='hierarchical,hierarchical' KMP_FORKJOIN_BARRIER_PATTERN='hierarchical,hierarchical' %libomp-run -// RUN: %libomp-compile && env KMP_BLOCKTIME=infinite KMP_PLAIN_BARRIER_PATTERN='hierarchical,hierarchical' KMP_FORKJOIN_BARRIER_PATTERN='hierarchical,hierarchical' %libomp-run -// RUN: %libomp-compile && env KMP_PLAIN_BARRIER_PATTERN='dist,dist' KMP_FORKJOIN_BARRIER_PATTERN='dist,dist' KMP_REDUCTION_BARRIER_PATTERN='dist,dist' %libomp-run -// 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 +// +// check other barriers +// RUN: %libomp-compile && env %linear-barrier %libomp-run +// RUN: %libomp-compile && env %linear-barrier KMP_BLOCKTIME=infinite %libomp-run +// RUN: %libomp-compile && env %tree-barrier %libomp-run +// RUN: %libomp-compile && env %tree-barrier KMP_BLOCKTIME=infinite %libomp-run +// RUN: %libomp-compile && env %hier-barrier %libomp-run +// RUN: %libomp-compile && env %hier-barrier KMP_BLOCKTIME=infinite %libomp-run +// RUN: %libomp-compile && env %dist-barrier %libomp-run +// RUN: %libomp-compile && env %dist-barrier KMP_BLOCKTIME=infinite %libomp-run #include #include "omp_testsuite.h" #include "omp_my_sleep.h" diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg --- a/openmp/runtime/test/lit.cfg +++ b/openmp/runtime/test/lit.cfg @@ -157,6 +157,24 @@ config.substitutions.append(("%python", '"%s"' % (sys.executable))) config.substitutions.append(("%not", config.test_not)) +# shortcut for barrier enviroments +config.substitutions.append(("%linear-barrier", + "KMP_PLAIN_BARRIER_PATTERN=linear,linear \ + KMP_FORKJOIN_BARRIER_PATTERN=linear,linear \ + KMP_REDUCTION_BARRIER_PATTERN=linear,linear")) +config.substitutions.append(("%tree-barrier", + "KMP_PLAIN_BARRIER_PATTERN=tre,tree \ + KMP_FORKJOIN_BARRIER_PATTERN=tree,tree \ + KMP_REDUCTION_BARRIER_PATTERN=tree,tree")) +config.substitutions.append(("%hier-barrier", + "KMP_PLAIN_BARRIER_PATTERN=hier,hier \ + KMP_FORKJOIN_BARRIER_PATTERN=hier,hier \ + KMP_REDUCTION_BARRIER_PATTERN=hier,hier")) +config.substitutions.append(("%dist-barrier", + "KMP_PLAIN_BARRIER_PATTERN=dist,dist \ + KMP_FORKJOIN_BARRIER_PATTERN=dist,dist \ + KMP_REDUCTION_BARRIER_PATTERN=dist,dist")) + if config.has_ompt: config.substitutions.append(("FileCheck", "tee %%t.out | %s" % config.test_filecheck)) config.substitutions.append(("%sort-threads", "sort -n -s")) diff --git a/openmp/runtime/test/ompt/synchronization/reduction/empty_reduce.c b/openmp/runtime/test/ompt/synchronization/reduction/empty_reduce.c --- a/openmp/runtime/test/ompt/synchronization/reduction/empty_reduce.c +++ b/openmp/runtime/test/ompt/synchronization/reduction/empty_reduce.c @@ -1,5 +1,15 @@ // RUN: %libomp-compile-and-run | FileCheck %s // RUN: %libomp-compile -DNOWAIT && %libomp-run | FileCheck %s +// +// RUN: %libomp-compile && env %linear-barrier %libomp-run | FileCheck %s +// RUN: %libomp-compile -DNOWAIT && env %linear-barrier %libomp-run | FileCheck %s +// RUN: %libomp-compile && env %tree-barrier %libomp-run | FileCheck %s +// RUN: %libomp-compile -DNOWAIT && env %tree-barrier %libomp-run | FileCheck %s +// RUN: %libomp-compile && env %hier-barrier %libomp-run | FileCheck %s +// RUN: %libomp-compile -DNOWAIT && env %hier-barrier %libomp-run | FileCheck %s +// RUN: %libomp-compile && env %dist-barrier %libomp-run | FileCheck %s +// RUN: %libomp-compile -DNOWAIT && env %dist-barrier %libomp-run | FileCheck %s +// // REQUIRES: ompt // UNSUPPORTED: gcc #include "callback.h" diff --git a/openmp/runtime/test/ompt/synchronization/reduction/tree_reduce.c b/openmp/runtime/test/ompt/synchronization/reduction/tree_reduce.c --- a/openmp/runtime/test/ompt/synchronization/reduction/tree_reduce.c +++ b/openmp/runtime/test/ompt/synchronization/reduction/tree_reduce.c @@ -1,5 +1,16 @@ -// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s -// RUN: %libomp-compile -DNOWAIT && %libomp-run | %sort-threads | FileCheck %s +// RUN: %libomp-compile-and-run | %sort-threads | FileCheck --check-prefixes=CHECK,MULTIPLE %s +// RUN: %libomp-compile -DNOWAIT && env %libomp-run | %sort-threads | FileCheck --check-prefixes=CHECK,MULTIPLE %s +// +// RUN: %libomp-compile && env %linear-barrier %libomp-run | %sort-threads | FileCheck --check-prefixes=CHECK,MULTIPLE %s +// RUN: %libomp-compile -DNOWAIT && env %linear-barrier %libomp-run | %sort-threads | FileCheck --check-prefixes=CHECK,MULTIPLE %s +// RUN: %libomp-compile && env %tree-barrier %libomp-run | %sort-threads | FileCheck --check-prefixes=CHECK,MULTIPLE %s +// RUN: %libomp-compile -DNOWAIT && env %tree-barrier %libomp-run | %sort-threads | FileCheck --check-prefixes=CHECK,MULTIPLE %s +// RUN: %libomp-compile && env %hier-barrier %libomp-run | %sort-threads | FileCheck --check-prefixes=CHECK,MULTIPLE %s +// RUN: %libomp-compile -DNOWAIT && env %hier-barrier %libomp-run | %sort-threads | FileCheck --check-prefixes=CHECK,MULTIPLE %s +// As dist barrier calls 1 pair of callbacks for several reductions. only match to CHECK +// RUN: %libomp-compile && env %dist-barrier %libomp-run | %sort-threads | FileCheck --check-prefixes=CHECK %s +// RUN: %libomp-compile -DNOWAIT && env %dist-barrier %libomp-run | %sort-threads | FileCheck --check-prefixes=CHECK %s +// // REQUIRES: ompt // UNSUPPORTED: gcc #include "callback.h" @@ -35,18 +46,21 @@ // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} // CHECK: {{^}}{{[0-f]+}}: ompt_event_reduction_end: // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} - // CHECK: {{^}}{{[0-f]+}}: ompt_event_reduction_begin: - // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} - // CHECK: {{^}}{{[0-f]+}}: ompt_event_reduction_end: - // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} - // CHECK: {{^}}{{[0-f]+}}: ompt_event_reduction_begin: - // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} - // CHECK: {{^}}{{[0-f]+}}: ompt_event_reduction_end: - // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} - // CHECK: {{^}}{{[0-f]+}}: ompt_event_reduction_begin: - // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} - // CHECK: {{^}}{{[0-f]+}}: ompt_event_reduction_end: - // CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} + // + // spec says there needs at least 1 pair of callbacks. + // therefore, following matches are optional + // MULTIPLE: {{^}}{{[0-f]+}}: ompt_event_reduction_begin: + // MULTIPLE-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} + // MULTIPLE: {{^}}{{[0-f]+}}: ompt_event_reduction_end: + // MULTIPLE-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} + // MULTIPLE: {{^}}{{[0-f]+}}: ompt_event_reduction_begin: + // MULTIPLE-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} + // MULTIPLE: {{^}}{{[0-f]+}}: ompt_event_reduction_end: + // MULTIPLE-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} + // MULTIPLE: {{^}}{{[0-f]+}}: ompt_event_reduction_begin: + // MULTIPLE-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} + // MULTIPLE: {{^}}{{[0-f]+}}: ompt_event_reduction_end: + // MULTIPLE-SAME: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}} return 0; } diff --git a/openmp/runtime/test/parallel/omp_parallel_reduction.c b/openmp/runtime/test/parallel/omp_parallel_reduction.c --- a/openmp/runtime/test/parallel/omp_parallel_reduction.c +++ b/openmp/runtime/test/parallel/omp_parallel_reduction.c @@ -1,4 +1,8 @@ // RUN: %libomp-compile-and-run +// RUN: %libomp-compile && env %linear-barrier %libomp-run +// RUN: %libomp-compile && env %tree-barrier %libomp-run +// RUN: %libomp-compile && env %hier-barrier %libomp-run +// RUN: %libomp-compile && env %dist-barrier %libomp-run #include #include #include "omp_testsuite.h"