enable environment variable KMP_PLACE_THREADS also for non-MIC architectures

llvm-svn: 227467
This commit is contained in:
Andrey Churbanov 2015-01-29 17:14:58 +00:00
parent a1849af4a9
commit 5cd50e3c0a
5 changed files with 4 additions and 21 deletions

View File

@ -782,11 +782,9 @@ typedef enum kmp_cancel_kind_t {
} kmp_cancel_kind_t;
#endif // OMP_40_ENABLED
#if KMP_MIC
extern unsigned int __kmp_place_num_cores;
extern unsigned int __kmp_place_num_threads_per_core;
extern unsigned int __kmp_place_core_offset;
#endif
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
@ -2578,7 +2576,7 @@ extern int __kmp_bt_intervals; /* number of monitor timestamp intervals
extern int __kmp_zero_bt; /* whether blocktime has been forced to zero */
#endif /* KMP_ADJUST_BLOCKTIME */
#ifdef KMP_DFLT_NTH_CORES
extern int __kmp_ncores; /* Number of physical procs in HT machine */
extern int __kmp_ncores; /* Total number of cores for threads placement */
#endif
extern int __kmp_abort_delay; /* Number of millisecs to delay on abort for VTune */

View File

@ -3327,9 +3327,6 @@ __kmp_affinity_process_placelist(kmp_affin_mask_t **out_masks,
#undef ADD_MASK
#undef ADD_MASK_OSID
# if KMP_MIC
static void
__kmp_apply_thread_places(AddrUnsPair **pAddr, int depth)
{
@ -3350,7 +3347,7 @@ __kmp_apply_thread_places(AddrUnsPair **pAddr, int depth)
if ( __kmp_place_num_threads_per_core == 0 ) {
__kmp_place_num_threads_per_core = __kmp_nThreadsPerCore; // use all HW contexts
}
if ( __kmp_place_core_offset + __kmp_place_num_cores > nCoresPerPkg ) {
if ( __kmp_place_core_offset + __kmp_place_num_cores > (unsigned int)nCoresPerPkg ) {
KMP_WARNING( AffThrPlaceManyCores );
return;
}
@ -3360,11 +3357,11 @@ __kmp_apply_thread_places(AddrUnsPair **pAddr, int depth)
int i, j, k, n_old = 0, n_new = 0;
for ( i = 0; i < nPackages; ++i ) {
for ( j = 0; j < nCoresPerPkg; ++j ) {
if ( j < __kmp_place_core_offset || j >= __kmp_place_core_offset + __kmp_place_num_cores ) {
if ( (unsigned int)j < __kmp_place_core_offset || (unsigned int)j >= __kmp_place_core_offset + __kmp_place_num_cores ) {
n_old += __kmp_nThreadsPerCore; // skip not-requested core
} else {
for ( k = 0; k < __kmp_nThreadsPerCore; ++k ) {
if ( k < __kmp_place_num_threads_per_core ) {
if ( (unsigned int)k < __kmp_place_num_threads_per_core ) {
newAddr[n_new] = (*pAddr)[n_old]; // copy requested core' data to new location
n_new++;
}
@ -3382,8 +3379,6 @@ __kmp_apply_thread_places(AddrUnsPair **pAddr, int depth)
*pAddr = newAddr; // replace old topology with new one
}
# endif /* KMP_MIC */
static AddrUnsPair *address2os = NULL;
static int * procarr = NULL;
@ -3705,9 +3700,7 @@ __kmp_aux_affinity_initialize(void)
return;
}
# if KMP_MIC
__kmp_apply_thread_places(&address2os, depth);
# endif
//
// Create the table of masks, indexed by thread Id.

View File

@ -2157,14 +2157,12 @@ __kmpc_get_parent_taskid() {
void __kmpc_place_threads(int nC, int nT, int nO)
{
#if KMP_MIC
if ( ! __kmp_init_serial ) {
__kmp_serial_initialize();
}
__kmp_place_num_cores = nC;
__kmp_place_num_threads_per_core = nT;
__kmp_place_core_offset = nO;
#endif
}
// end of file //

View File

@ -249,11 +249,9 @@ kmp_nested_proc_bind_t __kmp_nested_proc_bind = { NULL, 0, 0 };
int __kmp_affinity_num_places = 0;
#endif
#if KMP_MIC
unsigned int __kmp_place_num_cores = 0;
unsigned int __kmp_place_num_threads_per_core = 0;
unsigned int __kmp_place_core_offset = 0;
#endif
kmp_tasking_mode_t __kmp_tasking_mode = tskm_task_teams;

View File

@ -4205,7 +4205,6 @@ __kmp_stg_print_speculative_statsfile( kmp_str_buf_t * buffer, char const * name
#endif // KMP_USE_ADAPTIVE_LOCKS
#if KMP_MIC
// -------------------------------------------------------------------------------------------------
// KMP_PLACE_THREADS
// -------------------------------------------------------------------------------------------------
@ -4343,7 +4342,6 @@ __kmp_stg_print_place_threads( kmp_str_buf_t * buffer, char const * name, void *
*/
}
}
#endif
#if USE_ITT_BUILD
// -------------------------------------------------------------------------------------------------
@ -4561,9 +4559,7 @@ static kmp_setting_t __kmp_stg_table[] = {
{ "KMP_SPECULATIVE_STATSFILE", __kmp_stg_parse_speculative_statsfile,__kmp_stg_print_speculative_statsfile, NULL, 0, 0 },
#endif
#endif // KMP_USE_ADAPTIVE_LOCKS
#if KMP_MIC
{ "KMP_PLACE_THREADS", __kmp_stg_parse_place_threads, __kmp_stg_print_place_threads, NULL, 0, 0 },
#endif
#if USE_ITT_BUILD
{ "KMP_FORKJOIN_FRAMES", __kmp_stg_parse_forkjoin_frames, __kmp_stg_print_forkjoin_frames, NULL, 0, 0 },
{ "KMP_FORKJOIN_FRAMES_MODE", __kmp_stg_parse_forkjoin_frames_mode,__kmp_stg_print_forkjoin_frames_mode, NULL, 0, 0 },