52 lines · c
1// clang-format off2// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s3// REQUIRES: ompt4// clang-format on5 6#include "callback.h"7#include <omp.h>8 9int main() {10#pragma omp parallel sections num_threads(1)11 {12#pragma omp section13 {14 // implicit task info15 print_ids(0);16 // initial task info17 print_ids(1);18 }19 }20 21 // clang-format off22 // Check if libomp supports the callbacks for this test.23 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_create'24 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task'25 26 27 // CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]28 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_initial_task_begin: parallel_id=[[INITIAL_PARALLEL_ID:[0-f]+]], task_id=[[INITIAL_TASK_ID:[0-f]+]], actual_parallelism=1, index=1, flags=129 30 // region 031 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin32 // CHECK-SAME: parent_task_frame.exit=[[NULL]], parent_task_frame.reenter=[[INITIAL_TASK_FRAME_ENTER:(0x)?[0-f]+]],33 // CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-f]+]]34 35 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID:[0-f]+]]36 37 // information about implicit task (exit frame should be set, while enter should be NULL)38 // CHECK: {{^}}[[MASTER_ID]]: task level 0: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]]39 // CHECK-SAME: exit_frame={{(0x)?[0-f]+}}40 // CHECK-SAME: reenter_frame=[[NULL]]41 // CHECK-SAME: task_type=ompt_task_implicit42 43 // information about initial task (exit frame should be NULL, while enter frame shoule be set)44 // CHECK: {{^}}[[MASTER_ID]]: task level 1: parallel_id=[[INITIAL_PARALLEL_ID]], task_id=[[INITIAL_TASK_ID]]45 // CHECK-SAME: exit_frame=[[NULL]]46 // CHECK-SAME: reenter_frame=[[INITIAL_TASK_FRAME_ENTER]]47 // CHECK-SAME: task_type=ompt_task_initial48 // clang-format on49 50 return 0;51}52