Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor print_node_cpus to display CPU ranges instead of individual …
…CPUs This commit enhances the readability and conciseness of the output produced by the print_node_cpus function. Previously, the function listed each available CPU individually, which, especially for systems with a high number of CPUs, resulted in extensive and somewhat cluttered output. The key changes include the introduction of logic to identify contiguous ranges of CPUs, thereby allowing these sequences to be printed as hyphen-separated ranges (e.g., 1-4) instead of itemized lists (e.g., 1 2 3 4). This change significantly streamlines the output, making it more digestible and easier to interpret, particularly for systems with large numbers of CPUs. By tracking the start and end of each CPU range and only printing once a discontinuity (or the end of the list) is encountered, the function can represent the same information more compactly and clearly. This update respects the original structure and logic of the function, altering only the output strategy to improve clarity without affecting the core functionality. It's worth noting that the function's error-handling and interaction with the NUMA library remain unchanged, preserving the original behavior in scenarios where system queries might fail or return unexpected results.
- Loading branch information