Changeset View
Changeset View
Standalone View
Standalone View
runtime/src/kmp_runtime.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 3,816 Lines • ▼ Show 20 Lines | __kmp_reset_root(int gtid, kmp_root_t *root) | ||||
KMP_DEBUG_ASSERT( ! root->r.r_active ); | KMP_DEBUG_ASSERT( ! root->r.r_active ); | ||||
root->r.r_root_team = NULL; | root->r.r_root_team = NULL; | ||||
root->r.r_hot_team = NULL; | root->r.r_hot_team = NULL; | ||||
// __kmp_free_team() does not free hot teams, so we have to clear r_hot_team before call | // __kmp_free_team() does not free hot teams, so we have to clear r_hot_team before call | ||||
// to __kmp_free_team(). | // to __kmp_free_team(). | ||||
__kmp_free_team( root, root_team USE_NESTED_HOT_ARG(NULL) ); | __kmp_free_team( root, root_team USE_NESTED_HOT_ARG(NULL) ); | ||||
#if KMP_NESTED_HOT_TEAMS | #if KMP_NESTED_HOT_TEAMS | ||||
if( __kmp_hot_teams_max_level > 1 ) { // need to free nested hot teams and their threads if any | if( __kmp_hot_teams_max_level > 0 ) { // need to free nested hot teams and their threads if any | ||||
for( i = 0; i < hot_team->t.t_nproc; ++i ) { | for( i = 0; i < hot_team->t.t_nproc; ++i ) { | ||||
kmp_info_t *th = hot_team->t.t_threads[i]; | kmp_info_t *th = hot_team->t.t_threads[i]; | ||||
if( __kmp_hot_teams_max_level > 1 ) { | |||||
n += __kmp_free_hot_teams( root, th, 1, __kmp_hot_teams_max_level ); | n += __kmp_free_hot_teams( root, th, 1, __kmp_hot_teams_max_level ); | ||||
} | |||||
if( th->th.th_hot_teams ) { | if( th->th.th_hot_teams ) { | ||||
__kmp_free( th->th.th_hot_teams ); | __kmp_free( th->th.th_hot_teams ); | ||||
th->th.th_hot_teams = NULL; | th->th.th_hot_teams = NULL; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
__kmp_free_team( root, hot_team USE_NESTED_HOT_ARG(NULL) ); | __kmp_free_team( root, hot_team USE_NESTED_HOT_ARG(NULL) ); | ||||
▲ Show 20 Lines • Show All 3,780 Lines • Show Last 20 Lines |