[Openmp-commits] [openmp] [OpenMP][OMPT] Indicate loop schedule for worksharing-loop events (PR #97429)

via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 2 08:47:59 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 54f040fff301a629f2ed032863408ed119789b0e 7f3c21946278b5483928c3c031a1c99fc4c8ce73 -- openmp/runtime/src/kmp_csupport.cpp openmp/runtime/src/kmp_dispatch.cpp openmp/runtime/src/kmp_sched.cpp openmp/runtime/src/ompt-specific.h openmp/runtime/test/ompt/callback.h openmp/runtime/test/ompt/synchronization/ordered_dependences.c openmp/runtime/test/ompt/tasks/taskloop.c openmp/runtime/test/ompt/tasks/taskloop_dispatch.c openmp/runtime/test/ompt/teams/distribute_dispatch.c openmp/runtime/test/ompt/worksharing/for/auto.c openmp/runtime/test/ompt/worksharing/for/auto_serialized.c openmp/runtime/test/ompt/worksharing/for/auto_split.c openmp/runtime/test/ompt/worksharing/for/base.h openmp/runtime/test/ompt/worksharing/for/base_serialized.h openmp/runtime/test/ompt/worksharing/for/base_split.h openmp/runtime/test/ompt/worksharing/for/guided_serialized.c openmp/runtime/test/ompt/worksharing/for/loop_dispatch.c openmp/runtime/test/ompt/worksharing/for/runtime.c openmp/runtime/test/ompt/worksharing/for/runtime_serialized.c openmp/runtime/test/ompt/worksharing/for/runtime_split.c openmp/runtime/test/ompt/worksharing/sections.c openmp/runtime/test/ompt/worksharing/sections_dispatch.c openmp/runtime/test/ompt/worksharing/single.c
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/openmp/runtime/src/kmp_dispatch.cpp b/openmp/runtime/src/kmp_dispatch.cpp
index b538afc791..3b4a1f34df 100644
--- a/openmp/runtime/src/kmp_dispatch.cpp
+++ b/openmp/runtime/src/kmp_dispatch.cpp
@@ -1164,8 +1164,9 @@ __kmp_dispatch_init(ident_t *loc, int gtid, enum sched_type schedule, T lb,
     ompt_team_info_t *team_info = __ompt_get_teaminfo(0, NULL);
     ompt_task_info_t *task_info = __ompt_get_task_info_object(0);
     ompt_callbacks.ompt_callback(ompt_callback_work)(
-        ompt_get_work_schedule(pr->schedule), ompt_scope_begin, &(team_info->parallel_data),
-        &(task_info->task_data), pr->u.p.tc, OMPT_LOAD_RETURN_ADDRESS(gtid));
+        ompt_get_work_schedule(pr->schedule), ompt_scope_begin,
+        &(team_info->parallel_data), &(task_info->task_data), pr->u.p.tc,
+        OMPT_LOAD_RETURN_ADDRESS(gtid));
   }
 #endif
   KMP_PUSH_PARTITIONED_TIMER(OMP_loop_dynamic);
@@ -2121,8 +2122,8 @@ int __kmp_dispatch_next_algorithm(int gtid,
       ompt_team_info_t *team_info = __ompt_get_teaminfo(0, NULL);              \
       ompt_task_info_t *task_info = __ompt_get_task_info_object(0);            \
       ompt_callbacks.ompt_callback(ompt_callback_work)(                        \
-          ompt_get_work_schedule(pr->schedule), ompt_scope_end, &(team_info->parallel_data),         \
-          &(task_info->task_data), 0, codeptr);                                \
+          ompt_get_work_schedule(pr->schedule), ompt_scope_end,                \
+          &(team_info->parallel_data), &(task_info->task_data), 0, codeptr);   \
     }                                                                          \
   }
 #define OMPT_LOOP_DISPATCH(lb, ub, st, status)                                 \
diff --git a/openmp/runtime/src/ompt-specific.h b/openmp/runtime/src/ompt-specific.h
index 84e84e5327..93e4ffe910 100644
--- a/openmp/runtime/src/ompt-specific.h
+++ b/openmp/runtime/src/ompt-specific.h
@@ -130,7 +130,7 @@ inline const char *ompt_get_runtime_version() {
   return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN];
 }
 
-inline ompt_work_t ompt_get_work_schedule(enum sched_type schedule){
+inline ompt_work_t ompt_get_work_schedule(enum sched_type schedule) {
   printf("Schedule val: %i\n", schedule);
   switch (SCHEDULE_WITHOUT_MODIFIERS(schedule)) {
   case kmp_sch_static_chunked:
@@ -150,8 +150,6 @@ inline ompt_work_t ompt_get_work_schedule(enum sched_type schedule){
   }
 }
 
-
-
 class OmptReturnAddressGuard {
 private:
   bool SetAddress{false};
diff --git a/openmp/runtime/test/ompt/callback.h b/openmp/runtime/test/ompt/callback.h
index 64e7d448f0..c1093141e9 100644
--- a/openmp/runtime/test/ompt/callback.h
+++ b/openmp/runtime/test/ompt/callback.h
@@ -47,39 +47,35 @@ static const char* ompt_cancel_flag_t_values[] = {
   "ompt_cancel_discarded_task"
 };
 
-static const char* ompt_work_t_values[] = {
-  "undefined",
-  "ompt_work_loop",
-  "ompt_work_sections",
-  "ompt_work_single_executor",
-  "ompt_work_single_other",
-  "ompt_work_workshare",
-  "ompt_work_distribute",
-  "ompt_work_taskloop",
-  "ompt_work_scope",
-  "ompt_work_workdistribute",
-  "ompt_work_loop_static",
-  "ompt_work_loop_dynamic",
-  "ompt_work_loop_guided",
-  "ompt_work_loop_other"
-};
+static const char *ompt_work_t_values[] = {"undefined",
+                                           "ompt_work_loop",
+                                           "ompt_work_sections",
+                                           "ompt_work_single_executor",
+                                           "ompt_work_single_other",
+                                           "ompt_work_workshare",
+                                           "ompt_work_distribute",
+                                           "ompt_work_taskloop",
+                                           "ompt_work_scope",
+                                           "ompt_work_workdistribute",
+                                           "ompt_work_loop_static",
+                                           "ompt_work_loop_dynamic",
+                                           "ompt_work_loop_guided",
+                                           "ompt_work_loop_other"};
 
-static const char* ompt_work_events_t_values[] = {
-  "undefined",
-  "ompt_event_loop",
-  "ompt_event_sections",
-  "ompt_event_single_in_block",
-  "ompt_event_single_others",
-  "ompt_event_workshare",
-  "ompt_event_distribute",
-  "ompt_event_taskloop",
-  "ompt_event_scope",
-  "ompt_event_workdistribute",
-  "ompt_event_loop_static",
-  "ompt_event_loop_dynamic",
-  "ompt_event_loop_guided",
-  "ompt_event_loop_other"
-};
+static const char *ompt_work_events_t_values[] = {"undefined",
+                                                  "ompt_event_loop",
+                                                  "ompt_event_sections",
+                                                  "ompt_event_single_in_block",
+                                                  "ompt_event_single_others",
+                                                  "ompt_event_workshare",
+                                                  "ompt_event_distribute",
+                                                  "ompt_event_taskloop",
+                                                  "ompt_event_scope",
+                                                  "ompt_event_workdistribute",
+                                                  "ompt_event_loop_static",
+                                                  "ompt_event_loop_dynamic",
+                                                  "ompt_event_loop_guided",
+                                                  "ompt_event_loop_other"};
 
 static const char *ompt_dependence_type_t_values[36] = {
     "ompt_dependence_type_UNDEFINED",
@@ -886,24 +882,21 @@ on_ompt_callback_work(
 {
   switch(endpoint)
   {
-    case ompt_scope_begin:
-          printf("%" PRIu64 ":" _TOOL_PREFIX
-                 " %s_begin: parallel_id=%" PRIu64
-                 ", task_id=%" PRIu64 ", codeptr_ra=%p, count=%" PRIu64
-                 "\n",
-                 ompt_get_thread_data()->value, ompt_work_events_t_values[wstype], parallel_data->value,
-                 task_data->value, codeptr_ra, count);
+  case ompt_scope_begin:
+    printf("%" PRIu64 ":" _TOOL_PREFIX " %s_begin: parallel_id=%" PRIu64
+           ", task_id=%" PRIu64 ", codeptr_ra=%p, count=%" PRIu64 "\n",
+           ompt_get_thread_data()->value, ompt_work_events_t_values[wstype],
+           parallel_data->value, task_data->value, codeptr_ra, count);
     break;
-    case ompt_scope_end:
-    printf("%" PRIu64 ":" _TOOL_PREFIX
-            " %s_end: parallel_id=%" PRIu64
-            ", task_id=%" PRIu64 ", codeptr_ra=%p, count=%" PRIu64 "\n",
-            ompt_get_thread_data()->value, ompt_work_events_t_values[wstype], parallel_data->value,
-            task_data->value, codeptr_ra, count);
+  case ompt_scope_end:
+    printf("%" PRIu64 ":" _TOOL_PREFIX " %s_end: parallel_id=%" PRIu64
+           ", task_id=%" PRIu64 ", codeptr_ra=%p, count=%" PRIu64 "\n",
+           ompt_get_thread_data()->value, ompt_work_events_t_values[wstype],
+           parallel_data->value, task_data->value, codeptr_ra, count);
     break;
-    case ompt_scope_beginend:
-      printf("ompt_scope_beginend should never be passed to %s\n", __func__);
-      exit(-1);
+  case ompt_scope_beginend:
+    printf("ompt_scope_beginend should never be passed to %s\n", __func__);
+    exit(-1);
   }
 }
 
diff --git a/openmp/runtime/test/ompt/worksharing/for/auto.c b/openmp/runtime/test/ompt/worksharing/for/auto.c
index ff5bbfc379..3ce66d511a 100644
--- a/openmp/runtime/test/ompt/worksharing/for/auto.c
+++ b/openmp/runtime/test/ompt/worksharing/for/auto.c
@@ -4,7 +4,7 @@
 // XFAIL: gcc
 
 #define SCHEDULE auto
-// The runtime uses guided schedule for auto, 
+// The runtime uses guided schedule for auto,
 // which is a reason choice
 #define SCHED_OUTPUT "guided"
 #include "base.h"
diff --git a/openmp/runtime/test/ompt/worksharing/for/auto_serialized.c b/openmp/runtime/test/ompt/worksharing/for/auto_serialized.c
index 8fe7551d23..400fcc8f3a 100644
--- a/openmp/runtime/test/ompt/worksharing/for/auto_serialized.c
+++ b/openmp/runtime/test/ompt/worksharing/for/auto_serialized.c
@@ -4,7 +4,7 @@
 // XFAIL: gcc
 
 #define SCHEDULE auto
-// The runtime uses static schedule for serialized loop, 
+// The runtime uses static schedule for serialized loop,
 // which is a reason choice
 #define SCHED_OUTPUT "static"
 #include "base_serialized.h"
diff --git a/openmp/runtime/test/ompt/worksharing/for/auto_split.c b/openmp/runtime/test/ompt/worksharing/for/auto_split.c
index 96b975b579..c7b07d7407 100644
--- a/openmp/runtime/test/ompt/worksharing/for/auto_split.c
+++ b/openmp/runtime/test/ompt/worksharing/for/auto_split.c
@@ -5,7 +5,7 @@
 // XFAIL: gcc
 
 #define SCHEDULE auto
-// The runtime uses guided schedule for auto, 
+// The runtime uses guided schedule for auto,
 // which is a reason choice
 #define SCHED_OUTPUT "guided"
 #include "base_split.h"
diff --git a/openmp/runtime/test/ompt/worksharing/for/base.h b/openmp/runtime/test/ompt/worksharing/for/base.h
index 6429cad038..d18673c0f8 100644
--- a/openmp/runtime/test/ompt/worksharing/for/base.h
+++ b/openmp/runtime/test/ompt/worksharing/for/base.h
@@ -13,7 +13,7 @@ int main()
   unsigned int i;
   printf("0: Schedule: " SCHED_OUTPUT "\n");
 
-  #pragma omp parallel for num_threads(4) schedule(SCHEDULE)
+#pragma omp parallel for num_threads(4) schedule(SCHEDULE)
   for (i = 0; i < 100; i++) {
   }
 
@@ -25,27 +25,46 @@ int main()
 
   // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
   // CHECK: 0: Schedule: [[SCHED:[a-z]+]]
-  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin: parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[NULL]], parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]], requested_team_size=4, codeptr_ra=0x{{[0-f]+}}, invoker={{[0-9]+}}
-
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]]
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]]
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}}, task_id=[[IMPLICIT_TASK_ID]]
-
-  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]]
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]]
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}}, task_id=[[IMPLICIT_TASK_ID]]
-
-  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]]
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]]
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}}, task_id=[[IMPLICIT_TASK_ID]]
-
-  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]]
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]]
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}}, task_id=[[IMPLICIT_TASK_ID]]
+  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
+  // parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[NULL]],
+  // parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]],
+  // requested_team_size=4, codeptr_ra=0x{{[0-f]+}}, invoker={{[0-9]+}}
+
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]] CHECK:
+  // {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_end:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]] CHECK:
+  // {{^}}[[MASTER_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}},
+  // task_id=[[IMPLICIT_TASK_ID]]
+
+  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]] CHECK:
+  // {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=
+  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]] CHECK:
+  // {{^}}[[THREAD_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}},
+  // task_id=[[IMPLICIT_TASK_ID]]
+
+  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]] CHECK:
+  // {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=
+  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]] CHECK:
+  // {{^}}[[THREAD_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}},
+  // task_id=[[IMPLICIT_TASK_ID]]
+
+  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]] CHECK:
+  // {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=
+  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]] CHECK:
+  // {{^}}[[THREAD_ID]]: ompt_event_implicit_task_end: parallel_id={{[0-9]+}},
+  // task_id=[[IMPLICIT_TASK_ID]]
 
   return 0;
 }
diff --git a/openmp/runtime/test/ompt/worksharing/for/base_serialized.h b/openmp/runtime/test/ompt/worksharing/for/base_serialized.h
index bd47dcc045..1daed835a3 100644
--- a/openmp/runtime/test/ompt/worksharing/for/base_serialized.h
+++ b/openmp/runtime/test/ompt/worksharing/for/base_serialized.h
@@ -13,25 +13,32 @@ int main()
   unsigned int i;
   printf("0: Schedule: " SCHED_OUTPUT "\n");
 
-  #pragma omp parallel for num_threads(1) schedule(SCHEDULE)
+#pragma omp parallel for num_threads(1) schedule(SCHEDULE)
   for (i = 0; i < 100; i++) {
   }
-  
+
   // Check if libomp supports the callbacks for this test.
   // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_begin'
   // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_end'
   // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task'
   // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_work'
 
-
   // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
   // CHECK: 0: Schedule: [[SCHED:[a-z]+]]
-  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin: parent_task_id=[[PARENT_TASK_ID:[0-9]+]], parent_task_frame.exit=[[NULL]], parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]], requested_team_size=1, codeptr_ra=0x{{[0-f]+}}, invoker={{[0-9]+}}
+  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
+  // parent_task_id=[[PARENT_TASK_ID:[0-9]+]], parent_task_frame.exit=[[NULL]],
+  // parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]],
+  // requested_team_size=1, codeptr_ra=0x{{[0-f]+}}, invoker={{[0-9]+}}
 
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]]
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]], codeptr_ra=0x{{[0-f]+}}
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]]
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_end: parallel_id={{[PARALLEL_ID,0]}}, task_id=[[IMPLICIT_TASK_ID]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin:
+  // parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[IMPLICIT_TASK_ID:[0-9]+]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[IMPLICIT_TASK_ID]],
+  // codeptr_ra=0x{{[0-f]+}} CHECK: {{^}}[[MASTER_ID]]:
+  // ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]],
+  // task_id=[[IMPLICIT_TASK_ID]] CHECK: {{^}}[[MASTER_ID]]:
+  // ompt_event_implicit_task_end: parallel_id={{[PARALLEL_ID,0]}},
+  // task_id=[[IMPLICIT_TASK_ID]]
 
   return 0;
 }
diff --git a/openmp/runtime/test/ompt/worksharing/for/base_split.h b/openmp/runtime/test/ompt/worksharing/for/base_split.h
index d73c99c983..2ba8fea415 100644
--- a/openmp/runtime/test/ompt/worksharing/for/base_split.h
+++ b/openmp/runtime/test/ompt/worksharing/for/base_split.h
@@ -19,7 +19,7 @@ int main()
   unsigned int i;
   printf("0: Schedule: " SCHED_OUTPUT "\n");
 
-  #pragma omp parallel num_threads(4) 
+#pragma omp parallel num_threads(4) 
   {
     print_current_address(0);
     #pragma omp for schedule(SCHEDULE) nowait
@@ -36,41 +36,63 @@ int main()
   // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task'
   // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_work'
 
-
   // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
   // CHECK: 0: Schedule: [[SCHED:[a-z]+]]
-  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin: parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[NULL]], parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]], requested_team_size=4, codeptr_ra=[[PARALLEL_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}, invoker={{[0-9]+}}
+  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
+  // parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[NULL]],
+  // parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]],
+  // requested_team_size=4,
+  // codeptr_ra=[[PARALLEL_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}},
+  // invoker={{[0-9]+}}
 
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_BEGIN_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}
-  // CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]]
+  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
+  // codeptr_ra=[[LOOP_BEGIN_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} CHECK:
+  // {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_end:
+  // parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
+  // codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} CHECK:
+  // {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]]
 
   // CHECK: {{^}}[[MASTER_ID]]: ompt_event_parallel_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, invoker={{[0-9]+}}, codeptr_ra=[[PARALLEL_RETURN_ADDRESS]]
   // CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[PARALLEL_RETURN_ADDRESS]]
-  
-  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=0x{{[0-f]+}}
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}
-  // CHECK: {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]]
 
-  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=0x{{[0-f]+}}
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}
-  // CHECK: {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]]
+  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=0x{{[0-f]+}}
+  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end:
+  // parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
+  // codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} CHECK:
+  // {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]]
 
-  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=0x{{[0-f]+}}
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}
-  // CHECK: {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]]
+  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=0x{{[0-f]+}}
+  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end:
+  // parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
+  // codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} CHECK:
+  // {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]]
 
+  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=0x{{[0-f]+}}
+  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_loop_[[SCHED]]_end:
+  // parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
+  // codeptr_ra=[[LOOP_END_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} CHECK:
+  // {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[LOOP_END_RETURN_ADDRESS]]
 
   // CHECK-LOOP: 0: NULL_POINTER=[[NULL:.*$]]
   // CHECK-LOOP: 0: Schedule: [[SCHED:[a-z]+]]
   // CHECK-LOOP: 0: ompt_event_runtime_shutdown
-  // CHECK-LOOP: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin: parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[NULL]], parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]], requested_team_size=4, codeptr_ra={{0x[0-f]+}}, invoker={{[0-9]+}}
-  // CHECK-LOOP: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_begin: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[LOOP_BEGIN_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}
-  // CHECK-LOOP: {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]]
-  // CHECK-LOOP: {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]]
-  // CHECK-LOOP: {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]]
-  // CHECK-LOOP: {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]]
-
+  // CHECK-LOOP: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
+  // parent_task_id={{[0-9]+}}, parent_task_frame.exit=[[NULL]],
+  // parent_task_frame.reenter={{0x[0-f]+}}, parallel_id=[[PARALLEL_ID:[0-9]+]],
+  // requested_team_size=4, codeptr_ra={{0x[0-f]+}}, invoker={{[0-9]+}}
+  // CHECK-LOOP: {{^}}[[MASTER_ID]]: ompt_event_loop_[[SCHED]]_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
+  // codeptr_ra=[[LOOP_BEGIN_RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}} CHECK-LOOP:
+  // {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]]
+  // CHECK-LOOP: {{^}}{{[0-9]+}}:
+  // fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]] CHECK-LOOP:
+  // {{^}}{{[0-9]+}}: fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]]
+  // CHECK-LOOP: {{^}}{{[0-9]+}}:
+  // fuzzy_address={{.*}}[[LOOP_BEGIN_RETURN_ADDRESS]]
 
   return 0;
 }
diff --git a/openmp/runtime/test/ompt/worksharing/for/guided_serialized.c b/openmp/runtime/test/ompt/worksharing/for/guided_serialized.c
index c0d2f4ee8d..a1e239e081 100644
--- a/openmp/runtime/test/ompt/worksharing/for/guided_serialized.c
+++ b/openmp/runtime/test/ompt/worksharing/for/guided_serialized.c
@@ -2,7 +2,7 @@
 // REQUIRES: ompt
 
 #define SCHEDULE guided
-// The runtime uses static schedule for serialized loop, 
+// The runtime uses static schedule for serialized loop,
 // which is a reason choice
 #define SCHED_OUTPUT "static"
 #include "base_serialized.h"
diff --git a/openmp/runtime/test/ompt/worksharing/sections.c b/openmp/runtime/test/ompt/worksharing/sections.c
index 4a9696debf..ae21fd6801 100644
--- a/openmp/runtime/test/ompt/worksharing/sections.c
+++ b/openmp/runtime/test/ompt/worksharing/sections.c
@@ -26,11 +26,17 @@ int main()
 
   // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
 
-  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_sections_begin: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]], codeptr_ra=[[SECT_BEGIN:0x[0-f]+]], count=2
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_sections_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[SECT_END:0x[0-f]+]]
+  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_sections_begin:
+  // parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]],
+  // codeptr_ra=[[SECT_BEGIN:0x[0-f]+]], count=2 CHECK: {{^}}[[MASTER_ID]]:
+  // ompt_event_sections_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
+  // codeptr_ra=[[SECT_END:0x[0-f]+]]
 
-  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_sections_begin: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID:[0-9]+]], codeptr_ra=[[SECT_BEGIN]], count=2
-  // CHECK: {{^}}[[THREAD_ID]]: ompt_event_sections_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}}, codeptr_ra=[[SECT_END]]
+  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_sections_begin:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID:[0-9]+]],
+  // codeptr_ra=[[SECT_BEGIN]], count=2 CHECK: {{^}}[[THREAD_ID]]:
+  // ompt_event_sections_end: parallel_id=[[PARALLEL_ID]], task_id={{[0-9]+}},
+  // codeptr_ra=[[SECT_END]]
 
   return 0;
 }
diff --git a/openmp/runtime/test/ompt/worksharing/single.c b/openmp/runtime/test/ompt/worksharing/single.c
index 49db57769b..03b1abd4e2 100644
--- a/openmp/runtime/test/ompt/worksharing/single.c
+++ b/openmp/runtime/test/ompt/worksharing/single.c
@@ -25,9 +25,12 @@ int main()
 
   // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
 
-  // CHECK-DAG: {{^}}[[THREAD_ID_1:[0-9]+]]: ompt_event_single_in_block_begin: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]], codeptr_ra={{0x[0-f]+}}, count=1
-  // CHECK-DAG: {{^}}[[THREAD_ID_1]]: in single
-  // CHECK-DAG: {{^}}[[THREAD_ID_1]]: ompt_event_single_in_block_end: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]], codeptr_ra={{0x[0-f]+}}, count=1
+  // CHECK-DAG: {{^}}[[THREAD_ID_1:[0-9]+]]: ompt_event_single_in_block_begin:
+  // parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]],
+  // codeptr_ra={{0x[0-f]+}}, count=1 CHECK-DAG: {{^}}[[THREAD_ID_1]]: in single
+  // CHECK-DAG: {{^}}[[THREAD_ID_1]]: ompt_event_single_in_block_end:
+  // parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]], codeptr_ra={{0x[0-f]+}},
+  // count=1
 
   // CHECK-DAG: {{^}}[[THREAD_ID_2:[0-9]+]]: ompt_event_single_others_begin: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]], codeptr_ra={{0x[0-f]+}}, count=1
   // CHECK-DAG: {{^}}[[THREAD_ID_2]]: ompt_event_single_others_end: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]], codeptr_ra={{0x[0-f]+}}, count=1

``````````

</details>


https://github.com/llvm/llvm-project/pull/97429


More information about the Openmp-commits mailing list