diff options
author | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-01-16 15:58:03 +0000 |
---|---|---|
committer | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-01-16 15:58:03 +0000 |
commit | f6451d90d64992a8f0272af0fc1fa70209b1ca4d (patch) | |
tree | d9c2f864183d32d8623d7eae146abba44867eb4d /openmp/runtime/src | |
parent | d1f1fa26367d48570e92f36d8dfe96a9fdb35080 (diff) | |
download | bcm5719-llvm-f6451d90d64992a8f0272af0fc1fa70209b1ca4d.tar.gz bcm5719-llvm-f6451d90d64992a8f0272af0fc1fa70209b1ca4d.zip |
few fixes for ittnotify iterface (used by Intel(R) VTune Amplifier)
llvm-svn: 226283
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r-- | openmp/runtime/src/kmp_itt.h | 2 | ||||
-rw-r--r-- | openmp/runtime/src/kmp_itt.inl | 10 | ||||
-rw-r--r-- | openmp/runtime/src/kmp_runtime.c | 35 |
3 files changed, 29 insertions, 18 deletions
diff --git a/openmp/runtime/src/kmp_itt.h b/openmp/runtime/src/kmp_itt.h index c5ddbc645c2..145f753fbb6 100644 --- a/openmp/runtime/src/kmp_itt.h +++ b/openmp/runtime/src/kmp_itt.h @@ -68,7 +68,7 @@ __kmp_inline void __kmp_itt_frame_submit( int gtid, __itt_timestamp begin, __itt __kmp_inline void __kmp_itt_metadata_imbalance( int gtid, kmp_uint64 begin, kmp_uint64 end, kmp_uint64 imbalance, kmp_uint64 reduction ); // sched_type: 0 - static, 1 - dynamic, 2 - guided, 3 - custom (all others); iterations - loop trip count, chunk - chunk size __kmp_inline void __kmp_itt_metadata_loop( ident_t * loc, kmp_uint64 sched_type, kmp_uint64 iterations, kmp_uint64 chunk ); -__kmp_inline void __kmp_itt_metadata_single(); +__kmp_inline void __kmp_itt_metadata_single( ident_t * loc ); // --- Barrier reporting --- __kmp_inline void * __kmp_itt_barrier_object( int gtid, int bt, int set_name = 0, int delta = 0 ); diff --git a/openmp/runtime/src/kmp_itt.inl b/openmp/runtime/src/kmp_itt.inl index 70aafcce7d1..b3af0b8fb87 100644 --- a/openmp/runtime/src/kmp_itt.inl +++ b/openmp/runtime/src/kmp_itt.inl @@ -368,7 +368,7 @@ __kmp_itt_metadata_loop( ident_t * loc, kmp_uint64 sched_type, kmp_uint64 iterat // ------------------------------------------------------------------------------------------------- LINKAGE void -__kmp_itt_metadata_single( ) { +__kmp_itt_metadata_single( ident_t * loc ) { #if USE_ITT_NOTIFY if( metadata_domain == NULL) { __kmp_acquire_bootstrap_lock( & metadata_lock ); @@ -381,8 +381,14 @@ __kmp_itt_metadata_single( ) { } __itt_string_handle * string_handle = __itt_string_handle_create( "omp_metadata_single"); + kmp_str_loc_t str_loc = __kmp_str_loc_init( loc->psource, 1 ); + kmp_uint64 single_data[ 2 ]; + single_data[ 0 ] = str_loc.line; + single_data[ 1 ] = str_loc.col; + + __kmp_str_loc_free( &str_loc ); - __itt_metadata_add(metadata_domain, __itt_null, string_handle, __itt_metadata_u64, 0, NULL); + __itt_metadata_add(metadata_domain, __itt_null, string_handle, __itt_metadata_u64, 2, single_data); #endif } // __kmp_itt_metadata_single diff --git a/openmp/runtime/src/kmp_runtime.c b/openmp/runtime/src/kmp_runtime.c index e7106aa7aca..7d8554ed2e3 100644 --- a/openmp/runtime/src/kmp_runtime.c +++ b/openmp/runtime/src/kmp_runtime.c @@ -810,8 +810,8 @@ __kmp_enter_single( int gtid, ident_t *id_ref, int push_ws ) if ( status ) { __kmp_itt_single_start( gtid ); } - if( __itt_metadata_add_ptr && __kmp_forkjoin_frames_mode == 3 ) { - __kmp_itt_metadata_single(); + if( __itt_metadata_add_ptr && __kmp_forkjoin_frames_mode == 3 && KMP_MASTER_GTID(gtid)) { + __kmp_itt_metadata_single( id_ref ); } #endif /* USE_ITT_BUILD */ @@ -1850,7 +1850,7 @@ __kmp_fork_call( #if USE_ITT_BUILD // Mark start of "parallel" region for VTune. Only use one of frame notification scheme at the moment. - if ((__itt_frame_begin_v3_ptr && __kmp_forkjoin_frames && !__kmp_forkjoin_frames_mode) || KMP_ITT_DEBUG) + if ((__itt_frame_begin_v3_ptr && __kmp_forkjoin_frames && !__kmp_forkjoin_frames_mode) || KMP_ITT_DEBUG) { # if OMP_40_ENABLED if (!master_th->th.th_teams_microtask || microtask == (microtask_t)__kmp_teams_master) // Either not in teams or the outer fork of the teams construct @@ -1858,24 +1858,27 @@ __kmp_fork_call( { __kmp_itt_region_forking(gtid, team->t.t_nproc, 0); } - kmp_uint64 tmp_time = 0; + } #if USE_ITT_NOTIFY - if ( __itt_get_timestamp_ptr ) - tmp_time = __itt_get_timestamp(); -#endif - if ((__itt_frame_submit_v3_ptr && __kmp_forkjoin_frames_mode==3)|| KMP_ITT_DEBUG) + kmp_uint64 tmp_time = 0; + if (((__kmp_forkjoin_frames_mode == 1 || __kmp_forkjoin_frames_mode == 3) && __itt_frame_submit_v3_ptr) || KMP_ITT_DEBUG) { + if (!(team->t.t_active_level > 1)) { # if OMP_40_ENABLED - if (!master_th->th.th_teams_microtask || microtask == (microtask_t)__kmp_teams_master) + if (!master_th->th.th_teams_microtask || microtask == (microtask_t)__kmp_teams_master) { // Either not in teams or the outer fork of the teams construct # endif /* OMP_40_ENABLED */ - team->t.t_region_time = tmp_time; - + if ( __itt_get_timestamp_ptr ) + tmp_time = __itt_get_timestamp(); // Internal fork - report frame begin - if ((__kmp_forkjoin_frames_mode == 1 || __kmp_forkjoin_frames_mode == 3) && __itt_frame_submit_v3_ptr ) { - if (!(team->t.t_active_level > 1)) { master_th->th.th_frame_time = tmp_time; + if ( __kmp_forkjoin_frames_mode==3 ) + team->t.t_region_time = tmp_time; +# if OMP_40_ENABLED + } +# endif /* OMP_40_ENABLED */ } } +#endif /* USE_ITT_NOTIFY */ #endif /* USE_ITT_BUILD */ /* now go on and do the work */ @@ -1998,7 +2001,7 @@ __kmp_join_call(ident_t *loc, int gtid } // Mark end of "parallel" region for VTune. Only use one of frame notification scheme at the moment. - if ( ( __itt_frame_end_v3_ptr && __kmp_forkjoin_frames && ! __kmp_forkjoin_frames_mode ) || KMP_ITT_DEBUG ) + if ( ( __itt_frame_end_v3_ptr && __kmp_forkjoin_frames && ! __kmp_forkjoin_frames_mode ) || KMP_ITT_DEBUG ) { # if OMP_40_ENABLED if ( !master_th->th.th_teams_microtask /* not in teams */ || ( !exit_teams && team->t.t_level == master_th->th.th_teams_level ) ) @@ -2009,7 +2012,8 @@ __kmp_join_call(ident_t *loc, int gtid master_th->th.th_ident = loc; __kmp_itt_region_joined( gtid ); } - if ( ( __itt_frame_submit_v3_ptr && __kmp_forkjoin_frames_mode == 3 ) || KMP_ITT_DEBUG ) + } + if ( ( __itt_frame_submit_v3_ptr && __kmp_forkjoin_frames_mode == 3 ) || KMP_ITT_DEBUG ) { # if OMP_40_ENABLED if ( !master_th->th.th_teams_microtask /* not in teams */ || ( !exit_teams && team->t.t_level == master_th->th.th_teams_level ) ) @@ -2020,6 +2024,7 @@ __kmp_join_call(ident_t *loc, int gtid master_th->th.th_ident = loc; __kmp_itt_frame_submit( gtid, team->t.t_region_time, master_th->th.th_frame_time, 0, loc, master_th->th.th_team_nproc, 1 ); } + } #endif /* USE_ITT_BUILD */ #if OMP_40_ENABLED |