[ITTNOTIFY] Remove serialized parallel regions from frame notification

llvm-svn: 266760
This commit is contained in:
Jonathan Peyton 2016-04-19 16:55:17 +00:00
parent be2da82cd8
commit a1202bf594
5 changed files with 10 additions and 65 deletions

View File

@ -2351,7 +2351,6 @@ typedef struct KMP_ALIGN_CACHE kmp_base_info {
kmp_uint64 th_bar_arrive_time; /* arrival to barrier timestamp */
kmp_uint64 th_bar_min_time; /* minimum arrival time at the barrier */
kmp_uint64 th_frame_time; /* frame timestamp */
kmp_uint64 th_frame_time_serialized; /* frame timestamp in serialized parallel */
#endif /* USE_ITT_BUILD */
kmp_local_t th_local;
struct private_common *th_pri_head;

View File

@ -585,36 +585,6 @@ __kmpc_end_serialized_parallel(ident_t *loc, kmp_int32 global_tid)
}
}
#if USE_ITT_BUILD
kmp_uint64 cur_time = 0;
#if USE_ITT_NOTIFY
if ( __itt_get_timestamp_ptr ) {
cur_time = __itt_get_timestamp();
}
#endif /* USE_ITT_NOTIFY */
if ( this_thr->th.th_team->t.t_level == 0
#if OMP_40_ENABLED
&& this_thr->th.th_teams_microtask == NULL
#endif
) {
// Report the barrier
this_thr->th.th_ident = loc;
if ( ( __itt_frame_submit_v3_ptr || KMP_ITT_DEBUG ) &&
( __kmp_forkjoin_frames_mode == 3 || __kmp_forkjoin_frames_mode == 1 ) )
{
__kmp_itt_frame_submit( global_tid, this_thr->th.th_frame_time_serialized,
cur_time, 0, loc, this_thr->th.th_team_nproc, 0 );
if ( __kmp_forkjoin_frames_mode == 3 )
// Since barrier frame for serialized region is equal to the region we use the same begin timestamp as for the barrier.
__kmp_itt_frame_submit( global_tid, serial_team->t.t_region_time,
cur_time, 0, loc, this_thr->th.th_team_nproc, 2 );
} else if ( ( __itt_frame_end_v3_ptr || KMP_ITT_DEBUG ) &&
! __kmp_forkjoin_frames_mode && __kmp_forkjoin_frames )
// Mark the end of the "parallel" region for VTune. Only use one of frame notification scheme at the moment.
__kmp_itt_region_joined( global_tid, 1 );
}
#endif /* USE_ITT_BUILD */
if ( __kmp_env_consistency_check )
__kmp_pop_parallel( global_tid, NULL );
}

View File

@ -53,8 +53,8 @@ void __kmp_itt_destroy();
// __kmp_itt_xxxed() function should be called after action.
// --- Parallel region reporting ---
__kmp_inline void __kmp_itt_region_forking( int gtid, int team_size, int barriers, int serialized = 0 ); // Master only, before forking threads.
__kmp_inline void __kmp_itt_region_joined( int gtid, int serialized = 0 ); // Master only, after joining threads.
__kmp_inline void __kmp_itt_region_forking( int gtid, int team_size, int barriers ); // Master only, before forking threads.
__kmp_inline void __kmp_itt_region_joined( int gtid ); // Master only, after joining threads.
// (*) Note: A thread may execute tasks after this point, though.
// --- Frame reporting ---

View File

@ -89,10 +89,10 @@ static kmp_bootstrap_lock_t metadata_lock = KMP_BOOTSTRAP_LOCK_INITIALIZER( met
// -------------------------------------------------------------------------------------------------
LINKAGE void
__kmp_itt_region_forking( int gtid, int team_size, int barriers, int serialized ) {
__kmp_itt_region_forking( int gtid, int team_size, int barriers ) {
#if USE_ITT_NOTIFY
kmp_team_t * team = __kmp_team_from_gtid( gtid );
if (team->t.t_active_level + serialized > 1)
if (team->t.t_active_level > 1)
{
// The frame notifications are only supported for the outermost teams.
return;
@ -176,8 +176,8 @@ __kmp_itt_region_forking( int gtid, int team_size, int barriers, int serialized
}
}
KMP_ITT_DEBUG_LOCK();
KMP_ITT_DEBUG_PRINT( "[frm beg] gtid=%d, idx=%x, serialized:%d, loc:%p\n",
gtid, loc->reserved_2, serialized, loc );
KMP_ITT_DEBUG_PRINT( "[frm beg] gtid=%d, idx=%x, loc:%p\n",
gtid, loc->reserved_2, loc );
}
#endif
} // __kmp_itt_region_forking
@ -409,10 +409,10 @@ __kmp_itt_region_finished( int gtid ) {
// -------------------------------------------------------------------------------------------------
LINKAGE void
__kmp_itt_region_joined( int gtid, int serialized ) {
__kmp_itt_region_joined( int gtid ) {
#if USE_ITT_NOTIFY
kmp_team_t * team = __kmp_team_from_gtid( gtid );
if (team->t.t_active_level + serialized > 1)
if (team->t.t_active_level > 1)
{
// The frame notifications are only supported for the outermost teams.
return;
@ -424,8 +424,8 @@ __kmp_itt_region_joined( int gtid, int serialized ) {
if(frm < KMP_MAX_FRAME_DOMAINS) {
KMP_ITT_DEBUG_LOCK();
__itt_frame_end_v3(__kmp_itt_region_domains[frm], NULL);
KMP_ITT_DEBUG_PRINT( "[frm end] gtid=%d, idx=%x, serialized:%d, loc:%p\n",
gtid, loc->reserved_2, serialized, loc );
KMP_ITT_DEBUG_PRINT( "[frm end] gtid=%d, idx=%x, loc:%p\n",
gtid, loc->reserved_2, loc );
}
}
#endif

View File

@ -1374,30 +1374,6 @@ __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid)
if ( __kmp_env_consistency_check )
__kmp_push_parallel( global_tid, NULL );
#if USE_ITT_BUILD
// Mark the start of the "parallel" region for VTune. Only use one of frame notification scheme at the moment
if ( serial_team->t.t_level == 1
#if OMP_40_ENABLED
&& this_thr->th.th_teams_microtask == NULL
#endif
) {
#if USE_ITT_NOTIFY
// Save the start of the "parallel" region for VTune. This is the frame begin at the same time.
if ( ( __itt_get_timestamp_ptr || KMP_ITT_DEBUG ) &&
( __kmp_forkjoin_frames_mode == 3 || __kmp_forkjoin_frames_mode == 1 ) )
{
serial_team->t.t_region_time = this_thr->th.th_frame_time_serialized = __itt_get_timestamp();
} else // only one notification scheme (either "submit" or "forking/joined", not both)
#endif
if ( ( __itt_frame_begin_v3_ptr || KMP_ITT_DEBUG ) &&
__kmp_forkjoin_frames && ! __kmp_forkjoin_frames_mode )
{
this_thr->th.th_ident = loc;
// 0 - no barriers; 1 - serialized parallel
__kmp_itt_region_forking( global_tid, this_thr->th.th_team_nproc, 0, 1 );
}
}
#endif /* USE_ITT_BUILD */
}
/* most of the work for a fork */