[Openmp-commits] [openmp] f311922 - [OpenMP][libomp] Fix stats-gathering for new MSVC sections API

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 18 10:02:13 PST 2023


Author: Jonathan Peyton
Date: 2023-01-18T11:59:12-06:00
New Revision: f31192253541ef7325a2d90319031a52a638ea78

URL: https://github.com/llvm/llvm-project/commit/f31192253541ef7325a2d90319031a52a638ea78
DIFF: https://github.com/llvm/llvm-project/commit/f31192253541ef7325a2d90319031a52a638ea78.diff

LOG: [OpenMP][libomp] Fix stats-gathering for new MSVC sections API

Differential Revision: https://reviews.llvm.org/D139867

Added: 
    

Modified: 
    openmp/runtime/src/kmp_dispatch.cpp
    openmp/runtime/src/kmp_stats.h

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_dispatch.cpp b/openmp/runtime/src/kmp_dispatch.cpp
index b9dec59b8e694..a6ee844e59886 100644
--- a/openmp/runtime/src/kmp_dispatch.cpp
+++ b/openmp/runtime/src/kmp_dispatch.cpp
@@ -2387,7 +2387,7 @@ thread
 kmp_int32 __kmpc_next_section(ident_t *loc, kmp_int32 gtid,
                               kmp_int32 numberOfSections) {
 
-  KMP_TIME_PARTITIONED_BLOCK(OMP_sections);
+  KMP_TIME_PARTITIONED_BLOCK(OMP_sections_overhead);
 
   kmp_info_t *th = __kmp_threads[gtid];
 #ifdef KMP_DEBUG
@@ -2460,7 +2460,6 @@ kmp_int32 __kmpc_next_section(ident_t *loc, kmp_int32 gtid,
           ompt_dispatch_section, instance);
     }
 #endif
-    KMP_POP_PARTITIONED_TIMER();
   }
 
   return sectionIndex;
@@ -2492,9 +2491,9 @@ void __kmpc_end_sections(ident_t *loc, kmp_int32 gtid) {
           &(task_info->task_data), 0, OMPT_GET_RETURN_ADDRESS(0));
     }
 #endif
-    KMP_POP_PARTITIONED_TIMER();
   }
 
+  KMP_POP_PARTITIONED_TIMER();
   KD_TRACE(100, ("__kmpc_end_sections: T#%d returned\n", gtid));
 }
 

diff  --git a/openmp/runtime/src/kmp_stats.h b/openmp/runtime/src/kmp_stats.h
index 113221c066a33..f7f8f5f92d968 100644
--- a/openmp/runtime/src/kmp_stats.h
+++ b/openmp/runtime/src/kmp_stats.h
@@ -102,6 +102,7 @@ enum stats_state_e {
   macro(OMP_BARRIER, 0, arg)                                                   \
   macro(OMP_CRITICAL, 0, arg)                                                  \
   macro(OMP_SINGLE, 0, arg)                                                    \
+  macro(OMP_SECTIONS, 0, arg)                                                  \
   macro(OMP_MASTER, 0, arg)                                                    \
   macro(OMP_MASKED, 0, arg)                                                    \
   macro(OMP_TEAMS, 0, arg)                                                     \
@@ -150,6 +151,8 @@ enum stats_state_e {
   macro (OMP_critical, 0, arg)                                                 \
   macro (OMP_critical_wait, 0, arg)                                            \
   macro (OMP_single, 0, arg)                                                   \
+  macro (OMP_sections, 0, arg)                                                 \
+  macro (OMP_sections_overhead, 0, arg)                                        \
   macro (OMP_master, 0, arg)                                                   \
   macro (OMP_masked, 0, arg)                                                   \
   macro (OMP_task_immediate, 0, arg)                                           \


        


More information about the Openmp-commits mailing list