你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Updated host info tool
这个提交包含在:
@@ -16,35 +16,43 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import logging
|
||||
|
||||
import humanize
|
||||
|
||||
from gprMax.utilities.host_info import (detect_cuda_gpus, detect_opencl,
|
||||
get_host_info, print_cuda_info,
|
||||
print_opencl_info)
|
||||
from gprMax.utilities.utilities import get_terminal_width, human_size
|
||||
from gprMax.utilities.utilities import get_terminal_width
|
||||
|
||||
logging.basicConfig(format='%(message)s', level=logging.INFO)
|
||||
|
||||
# Host machine info.
|
||||
hostinfo = get_host_info()
|
||||
hyperthreadingstr = f", {hostinfo['logicalcores']} cores with Hyper-Threading" if hostinfo['hyperthreading'] else ''
|
||||
hostname = (f"\n=== {hostinfo['hostname']}")
|
||||
print(f"{hostname} {'=' * (get_terminal_width() - len(hostname) - 1)}")
|
||||
print(f"\n{'Mfr/model:':<12} {hostinfo['machineID']}")
|
||||
print(f"{'CPU:':<12} {hostinfo['sockets']} x {hostinfo['cpuID']} ({hostinfo['physicalcores']} cores{hyperthreadingstr})")
|
||||
print(f"{'RAM:':<12} {human_size(hostinfo['ram'], a_kilobyte_is_1024_bytes=True)}")
|
||||
print(f"{'OS/Version:':<12} {hostinfo['osversion']}")
|
||||
logging.info(f"{hostname} {'=' * (get_terminal_width() - len(hostname) - 1)}")
|
||||
logging.info(f"\n{'Mfr/model:':<12} {hostinfo['machineID']}")
|
||||
logging.info(f"{'CPU:':<12} {hostinfo['sockets']} x {hostinfo['cpuID']} " +
|
||||
f"({hostinfo['physicalcores']} cores{hyperthreadingstr})")
|
||||
logging.info(f"{'RAM:':<12} {humanize.naturalsize(hostinfo['ram'], True)}")
|
||||
logging.info(f"{'OS/Version:':<12} {hostinfo['osversion']}")
|
||||
|
||||
# OpenMP
|
||||
print("\n\n=== OpenMP capabilities (gprMax will not use Hyper-Threading with OpenMP as there is no performance advantage)\n")
|
||||
print(f"{'OpenMP threads: '} {hostinfo['physicalcores']}")
|
||||
logging.info("\n\n=== OpenMP capabilities (gprMax will not use Hyper-Threading " +
|
||||
"as there is no performance advantage)\n")
|
||||
logging.info(f"{'OpenMP threads: '} {hostinfo['physicalcores']}")
|
||||
|
||||
# CUDA
|
||||
print("\n\n=== CUDA capabilities\n")
|
||||
logging.info("\n\n=== CUDA capabilities\n")
|
||||
gpus = detect_cuda_gpus()
|
||||
if gpus:
|
||||
print_cuda_info(gpus)
|
||||
|
||||
# OpenCL
|
||||
print("\n\n=== OpenCL capabilities\n")
|
||||
logging.info("\n\n=== OpenCL capabilities\n")
|
||||
devs = detect_opencl()
|
||||
if devs:
|
||||
print_opencl_info(devs)
|
||||
|
||||
print(f"\n{'=' * (get_terminal_width() - 1)}\n")
|
||||
logging.info(f"\n{'=' * (get_terminal_width() - 1)}\n")
|
||||
|
在新工单中引用
屏蔽一个用户