Changeset View
Changeset View
Standalone View
Standalone View
openmp/trunk/runtime/src/kmp_wait_release.h
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | static inline void __kmp_wait_template(kmp_info_t *this_thr, C *flag, int final_spin | ||||
if (flag->done_check()) { | if (flag->done_check()) { | ||||
KMP_FSYNC_SPIN_ACQUIRED(spin); | KMP_FSYNC_SPIN_ACQUIRED(spin); | ||||
return; | return; | ||||
} | } | ||||
th_gtid = this_thr->th.th_info.ds.ds_gtid; | th_gtid = this_thr->th.th_info.ds.ds_gtid; | ||||
KA_TRACE(20, ("__kmp_wait_sleep: T#%d waiting for flag(%p)\n", th_gtid, flag)); | KA_TRACE(20, ("__kmp_wait_sleep: T#%d waiting for flag(%p)\n", th_gtid, flag)); | ||||
#if OMPT_SUPPORT && OMPT_BLAME | #if OMPT_SUPPORT && OMPT_BLAME | ||||
if (ompt_status == ompt_status_track_callback) { | ompt_state_t ompt_state = this_thr->th.ompt_thread_info.state; | ||||
if (this_thr->th.ompt_thread_info.state == ompt_state_idle){ | if (ompt_status == ompt_status_track_callback && | ||||
ompt_state != ompt_state_undefined) { | |||||
if (ompt_state == ompt_state_idle) { | |||||
if (ompt_callbacks.ompt_callback(ompt_event_idle_begin)) { | if (ompt_callbacks.ompt_callback(ompt_event_idle_begin)) { | ||||
ompt_callbacks.ompt_callback(ompt_event_idle_begin)(th_gtid + 1); | ompt_callbacks.ompt_callback(ompt_event_idle_begin)(th_gtid + 1); | ||||
} | } | ||||
} else if (ompt_callbacks.ompt_callback(ompt_event_wait_barrier_begin)) { | } else if (ompt_callbacks.ompt_callback(ompt_event_wait_barrier_begin)) { | ||||
KMP_DEBUG_ASSERT(this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier || | KMP_DEBUG_ASSERT(ompt_state == ompt_state_wait_barrier || | ||||
this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_implicit || | ompt_state == ompt_state_wait_barrier_implicit || | ||||
this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_explicit); | ompt_state == ompt_state_wait_barrier_explicit); | ||||
ompt_lw_taskteam_t* team = this_thr->th.th_team->t.ompt_serialized_team_info; | ompt_lw_taskteam_t* team = this_thr->th.th_team->t.ompt_serialized_team_info; | ||||
ompt_parallel_id_t pId; | ompt_parallel_id_t pId; | ||||
ompt_task_id_t tId; | ompt_task_id_t tId; | ||||
if (team){ | if (team){ | ||||
pId = team->ompt_team_info.parallel_id; | pId = team->ompt_team_info.parallel_id; | ||||
tId = team->ompt_task_info.task_id; | tId = team->ompt_task_info.task_id; | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | while (flag->notdone_check()) { | ||||
if (__kmp_global.g.g_abort) | if (__kmp_global.g.g_abort) | ||||
__kmp_abort_thread(); | __kmp_abort_thread(); | ||||
break; | break; | ||||
} | } | ||||
// TODO: If thread is done with work and times out, disband/free | // TODO: If thread is done with work and times out, disband/free | ||||
} | } | ||||
#if OMPT_SUPPORT && OMPT_BLAME | #if OMPT_SUPPORT && OMPT_BLAME | ||||
if (ompt_status == ompt_status_track_callback) { | if (ompt_status == ompt_status_track_callback && | ||||
if (this_thr->th.ompt_thread_info.state == ompt_state_idle){ | ompt_state != ompt_state_undefined) { | ||||
if (ompt_state == ompt_state_idle) { | |||||
if (ompt_callbacks.ompt_callback(ompt_event_idle_end)) { | if (ompt_callbacks.ompt_callback(ompt_event_idle_end)) { | ||||
ompt_callbacks.ompt_callback(ompt_event_idle_end)(th_gtid + 1); | ompt_callbacks.ompt_callback(ompt_event_idle_end)(th_gtid + 1); | ||||
} | } | ||||
} else if (ompt_callbacks.ompt_callback(ompt_event_wait_barrier_end)) { | } else if (ompt_callbacks.ompt_callback(ompt_event_wait_barrier_end)) { | ||||
KMP_DEBUG_ASSERT(this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier || | KMP_DEBUG_ASSERT(ompt_state == ompt_state_wait_barrier || | ||||
this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_implicit || | ompt_state == ompt_state_wait_barrier_implicit || | ||||
this_thr->th.ompt_thread_info.state == ompt_state_wait_barrier_explicit); | ompt_state == ompt_state_wait_barrier_explicit); | ||||
ompt_lw_taskteam_t* team = this_thr->th.th_team->t.ompt_serialized_team_info; | ompt_lw_taskteam_t* team = this_thr->th.th_team->t.ompt_serialized_team_info; | ||||
ompt_parallel_id_t pId; | ompt_parallel_id_t pId; | ||||
ompt_task_id_t tId; | ompt_task_id_t tId; | ||||
if (team){ | if (team){ | ||||
pId = team->ompt_team_info.parallel_id; | pId = team->ompt_team_info.parallel_id; | ||||
tId = team->ompt_task_info.task_id; | tId = team->ompt_task_info.task_id; | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines |