45 lines · c
1// clang-format off2// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s3// REQUIRES: ompt4// clang-format on5#include "callback.h"6#include <omp.h>7 8int main() {9 10 int condition = 0;11 int x = 0;12 omp_set_nested(1);13#pragma omp parallel num_threads(2)14 {15#pragma omp parallel num_threads(2)16 {17 OMPT_SIGNAL(condition);18 OMPT_WAIT(condition, 4);19 }20 }21 22 // clang-format off23 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]24 25 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_thread_begin:26 // CHECK-SAME: thread_type=ompt_thread_initial=1, thread_id=[[MASTER_ID]]27 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_thread_end:28 // CHECK-SAME: thread_id=[[MASTER_ID]]29 // CHECK: {{^}}[[WORKER_ID1:[0-9]+]]: ompt_event_thread_begin:30 // CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID1]]31 // CHECK: {{^}}[[WORKER_ID1]]: ompt_event_thread_end:32 // CHECK-SAME: thread_id=[[WORKER_ID1]]33 // CHECK: {{^}}[[WORKER_ID2:[0-9]+]]: ompt_event_thread_begin:34 // CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID2]]35 // CHECK: {{^}}[[WORKER_ID2]]: ompt_event_thread_end:36 // CHECK-SAME: thread_id=[[WORKER_ID2]]37 // CHECK: {{^}}[[WORKER_ID3:[0-9]+]]: ompt_event_thread_begin:38 // CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID3]]39 // CHECK: {{^}}[[WORKER_ID3]]: ompt_event_thread_end:40 // CHECK-SAME: thread_id=[[WORKER_ID3]]41 // clang-format on42 43 return 0;44}45