[Openmp-commits] [openmp] r227201 - Removes some unused variables (__kmp_ht_*) and changes__kmp_ncores and __kmp_nThreadsPerCore to static globals within kmp_affinity.cpp.

Andrey Churbanov Andrey.Churbanov at intel.com
Tue Jan 27 08:55:43 PST 2015


Author: achurbanov
Date: Tue Jan 27 10:55:43 2015
New Revision: 227201

URL: http://llvm.org/viewvc/llvm-project?rev=227201&view=rev
Log:
Removes some unused variables (__kmp_ht_*) and changes__kmp_ncores and __kmp_nThreadsPerCore to static globals within kmp_affinity.cpp.

Modified:
    openmp/trunk/runtime/src/kmp.h
    openmp/trunk/runtime/src/kmp_affinity.cpp
    openmp/trunk/runtime/src/kmp_global.c
    openmp/trunk/runtime/src/kmp_utility.c

Modified: openmp/trunk/runtime/src/kmp.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp.h?rev=227201&r1=227200&r2=227201&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp.h (original)
+++ openmp/trunk/runtime/src/kmp.h Tue Jan 27 10:55:43 2015
@@ -2579,11 +2579,9 @@ extern int        __kmp_bt_intervals;
 #ifdef KMP_ADJUST_BLOCKTIME
 extern int        __kmp_zero_bt;        /* whether blocktime has been forced to zero */
 #endif /* KMP_ADJUST_BLOCKTIME */
-extern int        __kmp_ht_capable;     /* whether CPUs support Intel(R) Hyper-Threading Technology */
-extern int        __kmp_ht_enabled;     /* whether Intel(R) Hyper-Threading Technology is enabled in OS */
+#ifdef KMP_DFLT_NTH_CORES
 extern int        __kmp_ncores;         /* Number of physical procs in HT machine */
-extern int        __kmp_ht_log_per_phy; /* Maximum possible number of logical processors per package */
-extern int        __kmp_nThreadsPerCore;/* Number of hyperthreads per core in HT machine. */
+#endif
 extern int        __kmp_abort_delay;    /* Number of millisecs to delay on abort for VTune */
 
 extern int        __kmp_need_register_atfork_specified;

Modified: openmp/trunk/runtime/src/kmp_affinity.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_affinity.cpp?rev=227201&r1=227200&r2=227201&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_affinity.cpp (original)
+++ openmp/trunk/runtime/src/kmp_affinity.cpp Tue Jan 27 10:55:43 2015
@@ -485,7 +485,10 @@ __kmp_affinity_get_fullMask() { return f
 
 
 static int nCoresPerPkg, nPackages;
-int __kmp_nThreadsPerCore;
+static int __kmp_nThreadsPerCore;
+#ifndef KMP_DFLT_NTH_CORES
+static int __kmp_ncores;
+#endif
 
 //
 // __kmp_affinity_uniform_topology() doesn't work when called from
@@ -556,14 +559,13 @@ __kmp_affinity_create_flat_map(AddrUnsPa
 
     //
     // Even if __kmp_affinity_type == affinity_none, this routine might still
-    // called to set __kmp_ht_enabled, & __kmp_ncores, as well as
+    // called to set __kmp_ncores, as well as
     // __kmp_nThreadsPerCore, nCoresPerPkg, & nPackages.
     //
     if (! KMP_AFFINITY_CAPABLE()) {
         KMP_ASSERT(__kmp_affinity_type == affinity_none);
         __kmp_ncores = nPackages = __kmp_xproc;
         __kmp_nThreadsPerCore = nCoresPerPkg = 1;
-        __kmp_ht_enabled = FALSE;
         if (__kmp_affinity_verbose) {
             KMP_INFORM(AffFlatTopology, "KMP_AFFINITY");
             KMP_INFORM(AvailableOSProc, "KMP_AFFINITY", __kmp_avail_proc);
@@ -576,13 +578,12 @@ __kmp_affinity_create_flat_map(AddrUnsPa
 
     //
     // When affinity is off, this routine will still be called to set
-    // __kmp_ht_enabled, & __kmp_ncores, as well as __kmp_nThreadsPerCore,
+    // __kmp_ncores, as well as __kmp_nThreadsPerCore,
     // nCoresPerPkg, & nPackages.  Make sure all these vars are set
     //  correctly, and return now if affinity is not enabled.
     //
     __kmp_ncores = nPackages = __kmp_avail_proc;
     __kmp_nThreadsPerCore = nCoresPerPkg = 1;
-    __kmp_ht_enabled = FALSE;
     if (__kmp_affinity_verbose) {
         char buf[KMP_AFFIN_MASK_PRINT_LEN];
         __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN, fullMask);
@@ -878,7 +879,6 @@ __kmp_affinity_create_apicid_map(AddrUns
         __kmp_ncores = __kmp_xproc;
         nPackages = (__kmp_xproc + nCoresPerPkg - 1) / nCoresPerPkg;
         __kmp_nThreadsPerCore = 1;
-        __kmp_ht_enabled = FALSE;
         if (__kmp_affinity_verbose) {
             KMP_INFORM(AffNotCapableUseLocCpuid, "KMP_AFFINITY");
             KMP_INFORM(AvailableOSProc, "KMP_AFFINITY", __kmp_avail_proc);
@@ -1045,7 +1045,6 @@ __kmp_affinity_create_apicid_map(AddrUns
     if (nApics == 1) {
         __kmp_ncores = nPackages = 1;
         __kmp_nThreadsPerCore = nCoresPerPkg = 1;
-        __kmp_ht_enabled = FALSE;
         if (__kmp_affinity_verbose) {
             char buf[KMP_AFFIN_MASK_PRINT_LEN];
             __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN, oldMask);
@@ -1182,11 +1181,10 @@ __kmp_affinity_create_apicid_map(AddrUns
 
     //
     // When affinity is off, this routine will still be called to set
-    // __kmp_ht_enabled, & __kmp_ncores, as well as __kmp_nThreadsPerCore,
+    // __kmp_ncores, as well as __kmp_nThreadsPerCore,
     // nCoresPerPkg, & nPackages.  Make sure all these vars are set
     // correctly, and return now if affinity is not enabled.
     //
-    __kmp_ht_enabled = (__kmp_nThreadsPerCore > 1);
     __kmp_ncores = nCores;
     if (__kmp_affinity_verbose) {
         char buf[KMP_AFFIN_MASK_PRINT_LEN];
@@ -1417,7 +1415,6 @@ __kmp_affinity_create_x2apicid_map(AddrU
 
         __kmp_ncores = __kmp_xproc / __kmp_nThreadsPerCore;
         nPackages = (__kmp_xproc + nCoresPerPkg - 1) / nCoresPerPkg;
-        __kmp_ht_enabled = (__kmp_nThreadsPerCore > 1);
         if (__kmp_affinity_verbose) {
             KMP_INFORM(AffNotCapableUseLocCpuidL11, "KMP_AFFINITY");
             KMP_INFORM(AvailableOSProc, "KMP_AFFINITY", __kmp_avail_proc);
@@ -1517,7 +1514,6 @@ __kmp_affinity_create_x2apicid_map(AddrU
     if (nApics == 1) {
         __kmp_ncores = nPackages = 1;
         __kmp_nThreadsPerCore = nCoresPerPkg = 1;
-        __kmp_ht_enabled = FALSE;
         if (__kmp_affinity_verbose) {
             char buf[KMP_AFFIN_MASK_PRINT_LEN];
             __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN, oldMask);
@@ -1625,7 +1621,7 @@ __kmp_affinity_create_x2apicid_map(AddrU
 
     //
     // When affinity is off, this routine will still be called to set
-    // __kmp_ht_enabled, & __kmp_ncores, as well as __kmp_nThreadsPerCore,
+    // __kmp_ncores, as well as __kmp_nThreadsPerCore,
     // nCoresPerPkg, & nPackages.  Make sure all these vars are set
     // correctly, and return if affinity is not enabled.
     //
@@ -1635,8 +1631,6 @@ __kmp_affinity_create_x2apicid_map(AddrU
     else {
         __kmp_nThreadsPerCore = 1;
     }
-    __kmp_ht_enabled = (__kmp_nThreadsPerCore > 1);
-
     nPackages = totals[pkgLevel];
 
     if (coreLevel >= 0) {
@@ -2134,7 +2128,6 @@ __kmp_affinity_create_cpuinfo_map(AddrUn
     if (num_avail == 1) {
         __kmp_ncores = 1;
         __kmp_nThreadsPerCore = nCoresPerPkg = nPackages = 1;
-        __kmp_ht_enabled = FALSE;
         if (__kmp_affinity_verbose) {
             if (! KMP_AFFINITY_CAPABLE()) {
                 KMP_INFORM(AffNotCapableUseCpuinfo, "KMP_AFFINITY");
@@ -2375,11 +2368,10 @@ __kmp_affinity_create_cpuinfo_map(AddrUn
 
     //
     // When affinity is off, this routine will still be called to set
-    // __kmp_ht_enabled, & __kmp_ncores, as well as __kmp_nThreadsPerCore,
+    // __kmp_ncores, as well as __kmp_nThreadsPerCore,
     // nCoresPerPkg, & nPackages.  Make sure all these vars are set
     // correctly, and return now if affinity is not enabled.
     //
-    __kmp_ht_enabled = (maxCt[threadIdIndex] > 1); // threads per core > 1
     __kmp_ncores = totals[coreIdIndex];
 
     if (__kmp_affinity_verbose) {

Modified: openmp/trunk/runtime/src/kmp_global.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_global.c?rev=227201&r1=227200&r2=227201&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_global.c (original)
+++ openmp/trunk/runtime/src/kmp_global.c Tue Jan 27 10:55:43 2015
@@ -146,10 +146,9 @@ int          __kmp_bt_intervals = KMP_IN
 #ifdef KMP_ADJUST_BLOCKTIME
 int               __kmp_zero_bt = FALSE;
 #endif /* KMP_ADJUST_BLOCKTIME */
-int            __kmp_ht_capable = FALSE;
-int            __kmp_ht_enabled = FALSE;
-int        __kmp_ht_log_per_phy = 1;
+#ifdef KMP_DFLT_NTH_CORES
 int                __kmp_ncores = 0;
+#endif
 int                 __kmp_chunk = 0;
 int           __kmp_abort_delay = 0;
 #if KMP_OS_LINUX && defined(KMP_TDATA_GTID)

Modified: openmp/trunk/runtime/src/kmp_utility.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_utility.c?rev=227201&r1=227200&r2=227201&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_utility.c (original)
+++ openmp/trunk/runtime/src/kmp_utility.c Tue Jan 27 10:55:43 2015
@@ -234,16 +234,9 @@ __kmp_query_cpuid( kmp_cpuinfo_t *p )
         }
 #endif /* KMP_DEBUG */
 
-        __kmp_ht_capable = FALSE;
         if ( (buf.edx >> 28) & 1 ) {
-
-            /* HT - Processor is HT Enabled (formerly JT) */
-            __kmp_ht_capable = TRUE;
-
             /* Bits 23-16: Logical Processors per Physical Processor (1 for P4) */
             log_per_phy = data[ 2 ];
-            __kmp_ht_log_per_phy = log_per_phy;
-
             p->apic_id     = data[ 3 ]; /* Bits 31-24: Processor Initial APIC ID (X) */
             KA_TRACE( trace_level, (" HT(%d TPUs)", log_per_phy ) );
 





More information about the Openmp-commits mailing list