get cpu information by standard modules

本文详细介绍了Python的platform和multiprocessing模块中用于获取处理器信息的函数,包括platform.processor()和multiprocessing.cpu_count()。同时提供了一个简单的示例来演示如何使用这些函数获取当前系统的处理器类型和CPU核心数量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

提示错误[root@localhost speccpu2017]# runcpu --config=arm64.cfg --copies=1 --threads=1 - -reportable -n 3 fprate & [1] 19484 [root@localhost speccpu2017]# SPEC CPU(r) 2017 Benchmark Suites Copyright 1995-2019 Standard Performance Evaluation Corporation (SPEC) runcpu v6612 Using 'linux-aarch64' tools Reading file manifests... read 32349 entries from 2 files in 0.13s (240098 files /s) Loading runcpu modules................. Locating benchmarks...found 47 benchmarks in 73 benchsets. Reading config file '/opt/speccpu2017/config/arm64.cfg' 1 configuration selected: Action Run Mode Workload Report Type Benchmarks -------- -------- -------- --------------- ---------------------------- validate rate refrate SPECrate2017_fp fprate Downloading update information for version check... NOTICE: Could not retrieve update metadata;got Could not connect to 'www.spec.org:80': Name or service not known ...Version check failed. A connection to the internet is useful, but is NOT required in order to run CPU2017. If one is available, several components will be checked to see if they are current. If you need to use an HTTP proxy to access the Internet, please see the 'http_proxy' entry in config.html. ---------------------------------- The run will continue in 5 seconds ---------------------------------- Reportable runs must include a 'test' run; adding to run list Reportable runs must include a 'train' run; adding to run list ------------------------------------------------------------------------------- Setting up environment for running fprate... Starting runcpu for fprate... Running "specperl /opt/speccpu2017/bin/sysinfo" to gather system information. sysinfo: r6732 of 2022-11-07 (fe91c89b7ed5c36ae2c92cc097bec197) sysinfo: ...getting basic information about kernel, users, and limits sysinfo: Getting system information for Linux... sysinfo: ...getting CPU info sysinfo: ...getting info from numactl sysinfo: ...getting memory info sysinfo: ...getting info from systemd sysinfo: ...getting power info sysinfo: ...getting system tuning info sysinfo: ...getting OS info sysinfo: ...getting disk info sysinfo: ...getting info from /sys/devices/virtual/dmi/id sysinfo: ...getting info from dmidecode Retrieving flags file (/opt/speccpu2017/config/flags/gcc.xml)... Reportable runs must include a 'test' run; adding to run list Reportable runs must include a 'train' run; adding to run list Benchmarks selected: 503.bwaves_r, 507.cactuBSSN_r, 508.namd_r, 510.parest_r, 51 1.povray_r, 519.lbm_r, 521.wrf_r, 526.blender_r, 527.cam4_r, 538.imagick_r, 544. nab_r, 549.fotonik3d_r, 554.roms_r, 997.specrand_fr Notice: Errors may not be ignored for reportable runs. Compiling Binaries Building 503.bwaves_r base mytest-64: (build_base_mytest-64.0000) [2025-07-24 08:48:41] Building 507.cactuBSSN_r base mytest-64: (build_base_mytest-64.0000) [2025-07- 24 08:48:43]
07-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值