Skip to content

Commit

Permalink
Removed method 1 from cpu_count_physical()
Browse files Browse the repository at this point in the history
  • Loading branch information
jandrovins committed Apr 15, 2020
1 parent f884ef4 commit f0d5b3b
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,17 +618,6 @@ def cpu_count_logical():

def cpu_count_physical():
"""Return the number of physical cores in the system."""
# Method #1
core_ids = set()
for path in glob.glob(
"/sys/devices/system/cpu/cpu[0-9]*/topology/core_id"):
with open_binary(path) as f:
core_ids.add(int(f.read()))
result = len(core_ids)
if result != 0:
return result

# Method #2
mapping = {}
current_info = {}
with open_binary('%s/cpuinfo' % get_procfs_path()) as f:
Expand Down

0 comments on commit f0d5b3b

Please sign in to comment.