summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/z_Linux_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/src/z_Linux_util.c')
-rw-r--r--openmp/runtime/src/z_Linux_util.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/openmp/runtime/src/z_Linux_util.c b/openmp/runtime/src/z_Linux_util.c
index 389f4d543db..4a26d4b65d5 100644
--- a/openmp/runtime/src/z_Linux_util.c
+++ b/openmp/runtime/src/z_Linux_util.c
@@ -866,14 +866,12 @@ __kmp_create_worker( int gtid, kmp_info_t *th, size_t stack_size )
// th->th.th_stats is used to transfer thread specific stats-pointer to __kmp_launch_worker
// So when thread is created (goes into __kmp_launch_worker) it will
// set it's __thread local pointer to th->th.th_stats
- th->th.th_stats = __kmp_stats_list.push_back(gtid);
- if(KMP_UBER_GTID(gtid)) {
- __kmp_stats_start_time = tsc_tick_count::now();
- __kmp_stats_thread_ptr = th->th.th_stats;
- __kmp_stats_init();
- KMP_START_EXPLICIT_TIMER(OMP_worker_thread_life);
- KMP_SET_THREAD_STATE(SERIAL_REGION);
- KMP_INIT_PARTITIONED_TIMERS(OMP_serial);
+ if(!KMP_UBER_GTID(gtid)) {
+ th->th.th_stats = __kmp_stats_list->push_back(gtid);
+ } else {
+ // For root threads, the __kmp_stats_thread_ptr is set in __kmp_register_root(), so
+ // set the th->th.th_stats field to it.
+ th->th.th_stats = __kmp_stats_thread_ptr;
}
__kmp_release_tas_lock(&__kmp_stats_lock, gtid);
@@ -1541,7 +1539,7 @@ __kmp_suspend_uninitialize_thread( kmp_info_t *th )
template <class C>
static inline void __kmp_suspend_template( int th_gtid, C *flag )
{
- KMP_TIME_DEVELOPER_BLOCK(USER_suspend);
+ KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(USER_suspend);
kmp_info_t *th = __kmp_threads[th_gtid];
int status;
typename C::flag_t old_spin;
@@ -1675,7 +1673,7 @@ void __kmp_suspend_oncore(int th_gtid, kmp_flag_oncore *flag) {
template <class C>
static inline void __kmp_resume_template( int target_gtid, C *flag )
{
- KMP_TIME_DEVELOPER_BLOCK(USER_resume);
+ KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(USER_resume);
kmp_info_t *th = __kmp_threads[target_gtid];
int status;
@@ -1750,7 +1748,7 @@ void __kmp_resume_oncore(int target_gtid, kmp_flag_oncore *flag) {
void
__kmp_resume_monitor()
{
- KMP_TIME_DEVELOPER_BLOCK(USER_resume);
+ KMP_TIME_DEVELOPER_PARTITIONED_BLOCK(USER_resume);
int status;
#ifdef KMP_DEBUG
int gtid = TCR_4(__kmp_init_gtid) ? __kmp_get_gtid() : -1;
OpenPOWER on IntegriCloud