diff --git a/src/cpucounters.cpp b/src/cpucounters.cpp index 169ff089..27cfd7d3 100644 --- a/src/cpucounters.cpp +++ b/src/cpucounters.cpp @@ -1255,9 +1255,9 @@ bool PCM::discoverSystemTopology() pi = (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX)slpi; if (pi->Relationship == RelationProcessorCore) { - threads_per_core = (pi->Processor.Flags == LTP_PC_SMT) ? 2 : 1; - // std::cout << "thr per core: " << threads_per_core << "\n"; - num_cores += threads_per_core; + const auto current_threads_per_core = (pi->Processor.Flags == LTP_PC_SMT) ? 2 : 1; + // std::cout << "thr per core: " << current_threads_per_core << "\n"; + num_cores += current_threads_per_core; } } // std::cout << std::flush; @@ -1372,8 +1372,6 @@ bool PCM::discoverSystemTopology() return false; } - if (entry.socket_id == 0 && entry.core_id == 0) ++threads_per_core; - topology.push_back(entry); socketIdMap[entry.socket_id] = 0; } @@ -1426,7 +1424,6 @@ bool PCM::discoverSystemTopology() socketIdMap[entries[i].socket_id] = 0; if(entries[i].os_id >= 0) { - if(entries[i].core_id == 0 && entries[i].socket_id == 0) ++threads_per_core; if (populateHybridEntry(entries[i], i) == false) { return false; diff --git a/src/topology.h b/src/topology.h index 62529a07..ae6f458a 100644 --- a/src/topology.h +++ b/src/topology.h @@ -172,7 +172,7 @@ class Core : public SystemObject void addHyperThreadInfo( int32 osID, TopologyEntry te ) { if ( te.thread_id >= MAX_THREADS_PER_CORE ) { std::stringstream ss; - ss << "ERROR: Core: thread_id cannot be larger than " << MAX_THREADS_PER_CORE << ".\n"; + ss << "ERROR: Core: thread_id " << te.thread_id << " cannot be larger than " << MAX_THREADS_PER_CORE << ".\n"; throw std::runtime_error( ss.str() ); } if ( threads_.size() == 0 ||