Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push 2025 01 07 #898

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/cppcheck.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cppcheck $1 --force --enable=warning --inline-suppr -iPCMService.cpp -isimdjson -iPcmMsrDriver_info.c -igoogletest -DTEXT -j $2 2> cppcheck.out
cppcheck $1 --force --enable=warning --inline-suppr -iPCMService.cpp -isimdjson -ipugixml -iPcmMsrDriver_info.c -igoogletest -DTEXT -j $2 2> cppcheck.out

if [ -s cppcheck.out ]
then
Expand Down
9 changes: 3 additions & 6 deletions src/cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down
Loading