Skip to content

Commit

Permalink
Upgrade py-cpuinfo to version 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
becantwell committed Jul 9, 2024
1 parent af782fe commit dc2f930
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/lib/xpedite/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pygments>=2.0.2
rpyc>=4.0.1
cement>=3.0.10
termcolor>=1.1.0
py-cpuinfo>=0.1.2
py-cpuinfo>=3.2.0
six>=1.12.0
nbclassic>=1.0.0
setuptools
Expand Down
8 changes: 6 additions & 2 deletions scripts/lib/xpedite/util/cpuInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ def __init__(self, info=None):
self.advertisedHz = self._loadAdvertisedHz()

def _loadId(self):
"""Returns the cpu identifier from vendor, family, model and stepping"""
"""Returns the cpu identifier from vendor, family and model"""
vendorId = self.info.get('vendor_id')
vendorId = vendorId if vendorId else self.info.get('vendor_id_raw')
stepping = self.info.get('stepping') if 'stepping' in self.info else None
if vendorId:
return '{}-{}-{:02X}-{}'.format(vendorId, self.info['family'], self.info['model'], self.info['stepping'])
vendorIdString = '{}-{}-{:02X}'.format(vendorId, self.info['family'], self.info['model'])
if stepping:
vendorIdString += '-{}'.format(stepping)
return vendorIdString
raise Exception('failed to load cpuInfo - missing cpu vendor id\n{}'.format(self.info))

def _loadAdvertisedHz(self):
Expand Down

0 comments on commit dc2f930

Please sign in to comment.