diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-11-04 21:37:48 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2015-11-04 21:37:48 +0000 |
commit | 54127981be94f7f963f0b58970dbe5a19a643f41 (patch) | |
tree | 6a4889c2f131ee677f7b0602992491d5ec70f7ba /openmp/runtime/src/kmp_barrier.cpp | |
parent | d4304d2f9caefe7c684c64cee4c4a0a05f018a17 (diff) | |
download | bcm5719-llvm-54127981be94f7f963f0b58970dbe5a19a643f41.tar.gz bcm5719-llvm-54127981be94f7f963f0b58970dbe5a19a643f41.zip |
Refactor of task_team code.
This is a refactoring of the task_team code that more elegantly handles the two
task_team case. Two task_teams per team are kept in use for the lifetime of the
team. Thus no reference counting is needed.
Differential Revision: http://reviews.llvm.org/D13993
llvm-svn: 252082
Diffstat (limited to 'openmp/runtime/src/kmp_barrier.cpp')
-rw-r--r-- | openmp/runtime/src/kmp_barrier.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/openmp/runtime/src/kmp_barrier.cpp b/openmp/runtime/src/kmp_barrier.cpp index fb7e67ef602..0c67b7f392d 100644 --- a/openmp/runtime/src/kmp_barrier.cpp +++ b/openmp/runtime/src/kmp_barrier.cpp @@ -1153,7 +1153,7 @@ __kmp_barrier(enum barrier_type bt, int gtid, int is_split, size_t reduce_size, if (__kmp_tasking_mode != tskm_immediate_exec) { __kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj) ); - __kmp_task_team_setup(this_thr, team, 0, 0); // use 0,0 to only setup the current team if nthreads > 1 + __kmp_task_team_setup(this_thr, team, 0); // use 0 to only setup the current team if nthreads > 1 } #if USE_DEBUGGER // Let the debugger know: All threads are arrived and starting leaving the barrier. @@ -1261,7 +1261,7 @@ __kmp_barrier(enum barrier_type bt, int gtid, int is_split, size_t reduce_size, KMP_DEBUG_ASSERT(this_thr->th.th_task_team->tt.tt_found_proxy_tasks == TRUE); __kmp_task_team_wait(this_thr, team USE_ITT_BUILD_ARG(itt_sync_obj)); - __kmp_task_team_setup(this_thr, team, 0, 0); + __kmp_task_team_setup(this_thr, team, 0); #if USE_ITT_BUILD if (__itt_sync_create_ptr || KMP_ITT_DEBUG) @@ -1575,7 +1575,7 @@ __kmp_fork_barrier(int gtid, int tid) #endif if (__kmp_tasking_mode != tskm_immediate_exec) { - __kmp_task_team_setup(this_thr, team, 1, 0); // 1,0 indicates setup both task teams if nthreads > 1 + __kmp_task_team_setup(this_thr, team, 0); // 0 indicates setup current task team if nthreads > 1 } /* The master thread may have changed its blocktime between the join barrier and the @@ -1614,14 +1614,7 @@ __kmp_fork_barrier(int gtid, int tid) // Early exit for reaping threads releasing forkjoin barrier if (TCR_4(__kmp_global.g.g_done)) { - if (this_thr->th.th_task_team != NULL) { - if (KMP_MASTER_TID(tid)) { - TCW_PTR(this_thr->th.th_task_team, NULL); - } - else { - __kmp_unref_task_team(this_thr->th.th_task_team, this_thr); - } - } + this_thr->th.th_task_team = NULL; #if USE_ITT_BUILD && USE_ITT_NOTIFY if (__itt_sync_create_ptr || KMP_ITT_DEBUG) { |