Changeset View
Changeset View
Standalone View
Standalone View
runtime/src/kmp_barrier.cpp
Show First 20 Lines • Show All 1,692 Lines • ▼ Show 20 Lines | #endif /* USE_ITT_BUILD */ | ||||
/* From this point on, the team data structure may be deallocated at any time | /* From this point on, the team data structure may be deallocated at any time | ||||
by the master thread - it is unsafe to reference it in any of the worker | by the master thread - it is unsafe to reference it in any of the worker | ||||
threads. Any per-team data items that need to be referenced before the | threads. Any per-team data items that need to be referenced before the | ||||
end of the barrier should be moved to the kmp_task_team_t structs. */ | end of the barrier should be moved to the kmp_task_team_t structs. */ | ||||
if (KMP_MASTER_TID(tid)) { | if (KMP_MASTER_TID(tid)) { | ||||
if (__kmp_tasking_mode != tskm_immediate_exec) { | if (__kmp_tasking_mode != tskm_immediate_exec) { | ||||
__kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj)); | __kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj)); | ||||
} | } | ||||
#if OMP_50_ENABLED | |||||
if (__kmp_display_affinity) { | |||||
KMP_CHECK_UPDATE(team->t.t_display_affinity, 0); | |||||
} | |||||
#endif | |||||
#if KMP_STATS_ENABLED | #if KMP_STATS_ENABLED | ||||
// Have master thread flag the workers to indicate they are now waiting for | // Have master thread flag the workers to indicate they are now waiting for | ||||
// next parallel region, Also wake them up so they switch their timers to | // next parallel region, Also wake them up so they switch their timers to | ||||
// idle. | // idle. | ||||
for (int i = 0; i < team->t.t_nproc; ++i) { | for (int i = 0; i < team->t.t_nproc; ++i) { | ||||
kmp_info_t *team_thread = team->t.t_threads[i]; | kmp_info_t *team_thread = team->t.t_threads[i]; | ||||
if (team_thread == this_thr) | if (team_thread == this_thr) | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | if (this_thr->th.th_new_place == this_thr->th.th_current_place) { | ||||
__kmp_gtid_from_thread(this_thr), | __kmp_gtid_from_thread(this_thr), | ||||
this_thr->th.th_current_place)); | this_thr->th.th_current_place)); | ||||
} else { | } else { | ||||
__kmp_affinity_set_place(gtid); | __kmp_affinity_set_place(gtid); | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
#if OMP_50_ENABLED | #if OMP_50_ENABLED | ||||
// Perform the display affinity functionality | |||||
if (__kmp_display_affinity) { | |||||
if (team->t.t_display_affinity | |||||
#if KMP_AFFINITY_SUPPORTED | |||||
|| (__kmp_affinity_type == affinity_balanced && team->t.t_size_changed) | |||||
#endif | |||||
) { | |||||
// NULL means use the affinity-format-var ICV | |||||
__kmp_aux_display_affinity(gtid, NULL); | |||||
this_thr->th.th_prev_num_threads = team->t.t_nproc; | |||||
this_thr->th.th_prev_level = team->t.t_level; | |||||
} | |||||
} | |||||
if (!KMP_MASTER_TID(tid)) | if (!KMP_MASTER_TID(tid)) | ||||
KMP_CHECK_UPDATE(this_thr->th.th_def_allocator, team->t.t_def_allocator); | KMP_CHECK_UPDATE(this_thr->th.th_def_allocator, team->t.t_def_allocator); | ||||
#endif | #endif | ||||
#if USE_ITT_BUILD && USE_ITT_NOTIFY | #if USE_ITT_BUILD && USE_ITT_NOTIFY | ||||
if (__itt_sync_create_ptr || KMP_ITT_DEBUG) { | if (__itt_sync_create_ptr || KMP_ITT_DEBUG) { | ||||
if (!KMP_MASTER_TID(tid)) { | if (!KMP_MASTER_TID(tid)) { | ||||
// Get correct barrier object | // Get correct barrier object | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |