From b68a85d1f68203ce2d51c83bc43657a1cd21491a Mon Sep 17 00:00:00 2001 From: Jonathan Peyton Date: Mon, 21 Sep 2015 18:11:22 +0000 Subject: [OMPT] Simplify control variable logic for OMPT Prior to this change, OMPT had a status flag ompt_status, which could take several values. This was due to an earlier OMPT design that had several levels of enablement (ready, disabled, tracking state, tracking callbacks). The current OMPT design has OMPT support either on or off. This revision replaces ompt_status with a boolean flag ompt_enabled, which simplifies the runtime logic for OMPT. Patch by John Mellor-Crummey Differential Revision: http://reviews.llvm.org/D12999 llvm-svn: 248189 --- openmp/runtime/src/kmp_lock.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'openmp/runtime/src/kmp_lock.cpp') diff --git a/openmp/runtime/src/kmp_lock.cpp b/openmp/runtime/src/kmp_lock.cpp index 21c87e63c1c..77e25aa176f 100644 --- a/openmp/runtime/src/kmp_lock.cpp +++ b/openmp/runtime/src/kmp_lock.cpp @@ -1315,8 +1315,7 @@ __kmp_acquire_queuing_lock_timed_template( kmp_queuing_lock_t *lck, #endif #if OMPT_SUPPORT - if ((ompt_status & ompt_status_track) && - prev_state != ompt_state_undefined) { + if (ompt_enabled && prev_state != ompt_state_undefined) { /* change the state before clearing wait_id */ this_thr->th.ompt_thread_info.state = prev_state; this_thr->th.ompt_thread_info.wait_id = 0; @@ -1332,8 +1331,7 @@ __kmp_acquire_queuing_lock_timed_template( kmp_queuing_lock_t *lck, } #if OMPT_SUPPORT - if ((ompt_status & ompt_status_track) && - prev_state == ompt_state_undefined) { + if (ompt_enabled && prev_state == ompt_state_undefined) { /* this thread will spin; set wait_id before entering wait state */ prev_state = this_thr->th.ompt_thread_info.state; this_thr->th.ompt_thread_info.wait_id = (uint64_t) lck; -- cgit v1.2.3