Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1028 from sathnaga/count_cpus
Added method to get total cpus count
  • Loading branch information
lmr committed Apr 21, 2017
2 parents ca4fca8 + 41e297c commit 7df8dd5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/base_utils.py
Expand Up @@ -406,6 +406,11 @@ def count_cpus():
return os.sysconf('SC_NPROCESSORS_ONLN')


def count_total_cpus():
"""Total number of (online+offline) CPUs in the local machine"""
return os.sysconf('SC_NPROCESSORS_CONF')


def sysctl(key, value=None):
"""Generic implementation of sysctl, to read and write.
Expand Down

0 comments on commit 7df8dd5

Please sign in to comment.