Skip to content

Optimize CPU info gathering for high thread count systems#172

Open
aggifford wants to merge 1 commit intomej:masterfrom
aggifford:fix-high-thread-timeout
Open

Optimize CPU info gathering for high thread count systems#172
aggifford wants to merge 1 commit intomej:masterfrom
aggifford:fix-high-thread-timeout

Conversation

@aggifford
Copy link
Copy Markdown

Replaces line-by-line bash loop with grep/awk commands for processing /proc/cpuinfo, reducing execution time from 40+ seconds to <1 second on systems with 768+ threads.

On high thread count systems (e.g., dual AMD EPYC with 768 threads), /proc/cpuinfo contains ~19,200 lines. The original while-loop implementation caused nhc_hw_gather_data() to timeout even with TIMEOUT=600.

The optimized implementation uses grep and awk for direct value extraction, maintaining identical functionality while dramatically improving performance.

Fixes #30

Replaces line-by-line bash loop with grep/awk commands for processing
/proc/cpuinfo, reducing execution time from 40+ seconds to <1 second
on systems with 768+ threads.

On high thread count systems (e.g., dual AMD EPYC with 768 threads),
/proc/cpuinfo contains ~19,200 lines. The original while-loop implementation
caused nhc_hw_gather_data() to timeout even with TIMEOUT=600.

The optimized implementation uses grep and awk for direct value extraction,
maintaining identical functionality while dramatically improving performance.

Fixes mej#30
@KasperSkytte
Copy link
Copy Markdown

I'm having the same issue on even 288 thread zen3 servers

@zzzoom
Copy link
Copy Markdown

zzzoom commented Mar 19, 2026

@aggifford this is fixed in the dev branch, probably the 1.4.4s (master, 1.4.4-master, 1.4.4-dev) too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize nhc_hw_gather_data for gathering CPU information on KNL nodes

4 participants