Skip to content

Commit b2ca128

Browse files
authored
Merge pull request #3151 from vkarak/feat/platform-info
[feat] Include hardware platform info in `ProcessorInfo`
2 parents 37f7eff + 60b2152 commit b2ca128

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

docs/config_reference.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,6 +1923,15 @@ A *processor info object* in ReFrame's configuration is used to hold information
19231923

19241924
.. versionadded:: 4.6
19251925

1926+
.. attribute:: systems.partitions.processor.platform
1927+
1928+
:required: No
1929+
:default: ``None``
1930+
1931+
The hardware platform for this processor (e.g., ``x86_64``, ``arm64`` etc.)
1932+
1933+
.. versionadded:: 4.6
1934+
19261935
.. attribute:: systems.partitions.processor.num_cpus
19271936

19281937
:required: No

reframe/core/systems.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ProcessorInfo(_ReadOnlyInfo, jsonext.JSONSerializable):
5656

5757
__slots__ = ()
5858
_known_attrs = (
59-
'arch', 'model', 'num_cpus', 'num_cpus_per_core',
59+
'arch', 'model', 'platform', 'num_cpus', 'num_cpus_per_core',
6060
'num_cpus_per_socket', 'num_sockets', 'topology'
6161
)
6262

reframe/schemas/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
"arch": {"type": "string"},
221221
"vendor": {"type": "string"},
222222
"model": {"type": "string"},
223+
"platform": {"type": "string"},
223224
"num_cpus": {"type": "number"},
224225
"num_cpus_per_core": {"type": "number"},
225226
"num_cpus_per_socket": {"type": "number"},

reframe/utility/cpuinfo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import contextlib
88
import glob
99
import os
10+
import platform
1011
import re
1112

1213
import reframe.utility.osext as osext
@@ -284,7 +285,8 @@ def cpuinfo():
284285
'arch': archspec.cpu.host().name,
285286
'vendor': archspec.cpu.host().vendor,
286287
'model': archspec.cpu.detect.raw_info_dictionary().get('model name',
287-
'N/A')
288+
'N/A'),
289+
'platform': platform.machine()
288290
}
289291

290292
# Try first to get information from the filesystem

unittests/resources/config/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def hostname():
7676
'processor': {
7777
'arch': 'skylake',
7878
'model': 'Intel Skylake',
79+
'platform': 'x86_64',
7980
'num_cpus': 8,
8081
'num_cpus_per_core': 2,
8182
'num_cpus_per_socket': 8,

unittests/test_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ def test_system_create(site_config):
466466
assert partition.processor.topology is not None
467467
assert partition.processor.arch == 'skylake'
468468
assert partition.processor.model == 'Intel Skylake'
469+
assert partition.processor.platform == 'x86_64'
469470
assert partition.processor.num_cpus == 8
470471
assert partition.processor.num_cpus_per_core == 2
471472
assert partition.processor.num_cpus_per_socket == 8

0 commit comments

Comments
 (0)