[Openmp-commits] [openmp] r272945 - Reduce perf impact of redundant ittnotify calls
Jonathan Peyton via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jun 16 13:11:51 PDT 2016
Author: jlpeyton
Date: Thu Jun 16 15:11:51 2016
New Revision: 272945
URL: http://llvm.org/viewvc/llvm-project?rev=272945&view=rev
Log:
Reduce perf impact of redundant ittnotify calls
Improved performance of ittnotify calls by request from ittnotify
owner: calls to __itt_string_handle_create made unique (it was
called multiple times).
Patch by Andrey Churbanov
Differential Revision: http://reviews.llvm.org/D21353
Modified:
openmp/trunk/runtime/src/kmp_itt.c
openmp/trunk/runtime/src/kmp_itt.h
openmp/trunk/runtime/src/kmp_itt.inl
Modified: openmp/trunk/runtime/src/kmp_itt.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_itt.c?rev=272945&r1=272944&r2=272945&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_itt.c (original)
+++ openmp/trunk/runtime/src/kmp_itt.c Thu Jun 16 15:11:51 2016
@@ -32,6 +32,9 @@
__itt_domain* __kmp_itt_imbalance_domains[KMP_MAX_FRAME_DOMAINS];
kmp_int32 __kmp_itt_region_team_size[KMP_MAX_FRAME_DOMAINS];
__itt_domain * metadata_domain = NULL;
+ __itt_string_handle * string_handle_imbl = NULL;
+ __itt_string_handle * string_handle_loop = NULL;
+ __itt_string_handle * string_handle_sngl = NULL;
#include "kmp_version.h"
#include "kmp_i18n.h"
Modified: openmp/trunk/runtime/src/kmp_itt.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_itt.h?rev=272945&r1=272944&r2=272945&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_itt.h (original)
+++ openmp/trunk/runtime/src/kmp_itt.h Thu Jun 16 15:11:51 2016
@@ -264,6 +264,9 @@ __kmp_inline void __kmp_itt_stack_callee
extern __itt_domain* __kmp_itt_imbalance_domains[KMP_MAX_FRAME_DOMAINS];
extern kmp_int32 __kmp_itt_region_team_size[KMP_MAX_FRAME_DOMAINS];
extern __itt_domain * metadata_domain;
+ extern __itt_string_handle * string_handle_imbl;
+ extern __itt_string_handle * string_handle_loop;
+ extern __itt_string_handle * string_handle_sngl;
#else
Modified: openmp/trunk/runtime/src/kmp_itt.inl
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_itt.inl?rev=272945&r1=272944&r2=272945&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_itt.inl (original)
+++ openmp/trunk/runtime/src/kmp_itt.inl Thu Jun 16 15:11:51 2016
@@ -315,20 +315,21 @@ __kmp_itt_metadata_imbalance( int gtid,
if( metadata_domain == NULL) {
__itt_suppress_push(__itt_suppress_memory_errors);
metadata_domain = __itt_domain_create( "OMP Metadata" );
+ string_handle_imbl = __itt_string_handle_create( "omp_metadata_imbalance");
+ string_handle_loop = __itt_string_handle_create( "omp_metadata_loop");
+ string_handle_sngl = __itt_string_handle_create( "omp_metadata_single");
__itt_suppress_pop();
}
__kmp_release_bootstrap_lock( & metadata_lock );
}
- __itt_string_handle * string_handle = __itt_string_handle_create( "omp_metadata_imbalance");
-
kmp_uint64 imbalance_data[ 4 ];
imbalance_data[ 0 ] = begin;
imbalance_data[ 1 ] = end;
imbalance_data[ 2 ] = imbalance;
imbalance_data[ 3 ] = reduction;
- __itt_metadata_add(metadata_domain, __itt_null, string_handle, __itt_metadata_u64, 4, imbalance_data);
+ __itt_metadata_add(metadata_domain, __itt_null, string_handle_imbl, __itt_metadata_u64, 4, imbalance_data);
#endif
} // __kmp_itt_metadata_imbalance
@@ -342,13 +343,14 @@ __kmp_itt_metadata_loop( ident_t * loc,
if( metadata_domain == NULL) {
__itt_suppress_push(__itt_suppress_memory_errors);
metadata_domain = __itt_domain_create( "OMP Metadata" );
+ string_handle_imbl = __itt_string_handle_create( "omp_metadata_imbalance");
+ string_handle_loop = __itt_string_handle_create( "omp_metadata_loop");
+ string_handle_sngl = __itt_string_handle_create( "omp_metadata_single");
__itt_suppress_pop();
}
__kmp_release_bootstrap_lock( & metadata_lock );
}
- __itt_string_handle * string_handle = __itt_string_handle_create( "omp_metadata_loop");
-
// Parse line and column from psource string: ";file;func;line;col;;"
char * s_line;
char * s_col;
@@ -373,7 +375,7 @@ __kmp_itt_metadata_loop( ident_t * loc,
loop_data[ 3 ] = iterations;
loop_data[ 4 ] = chunk;
- __itt_metadata_add(metadata_domain, __itt_null, string_handle, __itt_metadata_u64, 5, loop_data);
+ __itt_metadata_add(metadata_domain, __itt_null, string_handle_loop, __itt_metadata_u64, 5, loop_data);
#endif
} // __kmp_itt_metadata_loop
@@ -387,12 +389,14 @@ __kmp_itt_metadata_single( ident_t * loc
if( metadata_domain == NULL) {
__itt_suppress_push(__itt_suppress_memory_errors);
metadata_domain = __itt_domain_create( "OMP Metadata" );
+ string_handle_imbl = __itt_string_handle_create( "omp_metadata_imbalance");
+ string_handle_loop = __itt_string_handle_create( "omp_metadata_loop");
+ string_handle_sngl = __itt_string_handle_create( "omp_metadata_single");
__itt_suppress_pop();
}
__kmp_release_bootstrap_lock( & metadata_lock );
}
- __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;
@@ -400,7 +404,7 @@ __kmp_itt_metadata_single( ident_t * loc
__kmp_str_loc_free( &str_loc );
- __itt_metadata_add(metadata_domain, __itt_null, string_handle, __itt_metadata_u64, 2, single_data);
+ __itt_metadata_add(metadata_domain, __itt_null, string_handle_sngl, __itt_metadata_u64, 2, single_data);
#endif
} // __kmp_itt_metadata_single
More information about the Openmp-commits
mailing list