| 1 |
// clang-format off |
| 2 |
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s |
| 3 |
// REQUIRES: ompt |
| 4 |
|
| 5 |
/// GCC lowering of distribute results in calls to |
| 6 |
/// omp_get_num_teams/omp_get_team_num rather than region calls |
| 7 |
// UNSUPPORTED: gcc |
| 8 |
// clang-format on |
| 9 |
#include "callback.h" |
| 10 |
|
| 11 |
#define WORK_SIZE 64 |
| 12 |
|
| 13 |
int main() { |
| 14 |
int i; |
| 15 |
#pragma omp teams num_teams(4) thread_limit(1) |
| 16 |
#pragma omp distribute dist_schedule(static, WORK_SIZE / 4) |
| 17 |
for (i = 0; i < WORK_SIZE; i++) { |
| 18 |
} |
| 19 |
|
| 20 |
return 0; |
| 21 |
} |
| 22 |
|
| 23 |
// clang-format off |
| 24 |
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_work' |
| 25 |
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_dispatch' |
| 26 |
|
| 27 |
// CHECK: 0: NULL_POINTER=[[NULL:.*$]] |
| 28 |
|
| 29 |
// CHECK: {{^}}[[THREAD_ID0:[0-9]+]]: ompt_event_distribute_begin: |
| 30 |
// CHECK-SAME: parallel_id=[[PARALLEL_ID0:[0-9]+]] |
| 31 |
// CHECK-SAME: task_id=[[TASK_ID0:[0-9]+]] |
| 32 |
// CHECK: {{^}}[[THREAD_ID0]]: ompt_event_distribute_chunk_begin: |
| 33 |
// CHECK-SAME: parallel_id=[[PARALLEL_ID0]], task_id=[[TASK_ID0]] |
| 34 |
// CHECK-SAME: chunk_start={{[0-9]+}}, chunk_iterations=16 |
| 35 |
|
| 36 |
// CHECK: {{^}}[[THREAD_ID1:[0-9]+]]: ompt_event_distribute_begin: |
| 37 |
// CHECK-SAME: parallel_id=[[PARALLEL_ID1:[0-9]+]] |
| 38 |
// CHECK-SAME: task_id=[[TASK_ID1:[0-9]+]] |
| 39 |
// CHECK: {{^}}[[THREAD_ID1]]: ompt_event_distribute_chunk_begin: |
| 40 |
// CHECK-SAME: parallel_id=[[PARALLEL_ID1]], task_id=[[TASK_ID1]] |
| 41 |
// CHECK-SAME: chunk_start={{[0-9]+}}, chunk_iterations=16 |
| 42 |
|
| 43 |
// CHECK: {{^}}[[THREAD_ID2:[0-9]+]]: ompt_event_distribute_begin: |
| 44 |
// CHECK-SAME: parallel_id=[[PARALLEL_ID2:[0-9]+]] |
| 45 |
// CHECK-SAME: task_id=[[TASK_ID2:[0-9]+]] |
| 46 |
// CHECK: {{^}}[[THREAD_ID2]]: ompt_event_distribute_chunk_begin: |
| 47 |
// CHECK-SAME: parallel_id=[[PARALLEL_ID2]], task_id=[[TASK_ID2]] |
| 48 |
// CHECK-SAME: chunk_start={{[0-9]+}}, chunk_iterations=16 |
| 49 |
|
| 50 |
// CHECK: {{^}}[[THREAD_ID3:[0-9]+]]: ompt_event_distribute_begin: |
| 51 |
// CHECK-SAME: parallel_id=[[PARALLEL_ID3:[0-9]+]] |
| 52 |
// CHECK-SAME: task_id=[[TASK_ID3:[0-9]+]] |
| 53 |
// CHECK: {{^}}[[THREAD_ID3]]: ompt_event_distribute_chunk_begin: |
| 54 |
// CHECK-SAME: parallel_id=[[PARALLEL_ID3]], task_id=[[TASK_ID3]] |
| 55 |
// CHECK-SAME: chunk_start={{[0-9]+}}, chunk_iterations=16 |
| 56 |
// clang-format on |