Index: runtime/src/kmp_runtime.c =================================================================== --- runtime/src/kmp_runtime.c +++ runtime/src/kmp_runtime.c @@ -5059,8 +5059,13 @@ int old_state = team->t.t_threads[0]->th.th_task_state; for (f=0; f < team->t.t_nproc; ++f) { __kmp_initialize_info( team->t.t_threads[ f ], team, f, __kmp_gtid_from_tid( f, team ) ); - team->t.t_threads[f]->th.th_task_state = old_state; } + // Old threads (except for master) and new threads need task_state and task_team reinitialized. + // Master thread will make a memo of old task_state later, then it will update task_state and task_team + for( f = 1 ; f < new_nproc ; f++ ) { + team->t.t_threads[f]->th.th_task_state = old_state; + team->t.t_threads[f]->th.th_task_team = team->t.t_task_team[team->t.t_threads[f]->th.th_task_state]; + } } #ifdef KMP_DEBUG