如何解决四核上的 mpi4py - 只有 1 个处理器?
我正在尝试在具有运行 Fedora 33 的四核处理器的系统上设置 mpi4py。我假设我应该有 8 个可用进程,但是当我运行测试脚本时,我只看到大小为1 并且所有进程都返回 0。我尝试设置主机列表文件以及在命令行上指定多个主机,但结果始终相同。
除了非常简单的 mpi4py 指令安装之外,我似乎找不到任何信息,但显然有些问题。感谢您提供有关如何诊断此问题的任何建议。
我尝试运行的脚本名为 mpi_test.py:
from mpi4py import MPI
comm = MPI.COMM_WORLD
print('%d of %d' % (comm.Get_rank(),comm.Get_size()))
一个简单的命令行执行和结果是:
mpiexec -np 4 python mpi_test.py
0 of 1
0 of 1
0 of 1
0 of 1
使用这个主机文件(kanagawa 是我的主机名):
kanagawa:4
我看到了:
mpiexec -np 4 -f hostfile python mpi_test.py
0 of 1
0 of 1
0 of 1
0 of 1
并在命令行上指定主机/进程:
mpiexec -np 4 -hosts kanagawa,kanagawa,kanagawa python mpi_test.py
0 of 1
0 of 1
0 of 1
0 of 1
这台机器的处理器规格:
lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit,64-bit
Byte Order: Little Endian
Address sizes: 39 bits physical,48 bits virtual
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 142
Model name: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Stepping: 10
CPU MHz: 800.228
CPU max MHz: 4000.0000
CPU min MHz: 400.0000
BogoMIPS: 3999.93
Virtualization: VT-x
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 1 MiB
L3 cache: 8 MiB
NUMA node0 CPU(s): 0-7
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes,SMT vulnerabl
e
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Full generic retpoline,IBPB conditional,IBRS_FW,STIBP co
nditional,RSB filling
Vulnerability Srbds: Mitigation; Microcode
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36
clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdt
scp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology n
onstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est
tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popc
nt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefet
ch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow v
nmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi
2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec
xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hw
p_epp md_clear flush_l1d
编辑:
我在几个 Raspberry Pi 系统上测试了相同的设置,它按预期工作:
mpiexec -n 6 --machinefile briar_hosts python -m mpi4py.bench helloworld
Hello,World! I am process 0 of 6 on briar.
Hello,World! I am process 1 of 6 on briar.
Hello,World! I am process 2 of 6 on berry00.
Hello,World! I am process 3 of 6 on berry00.
Hello,World! I am process 4 of 6 on berry00.
Hello,World! I am process 5 of 6 on berry00.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。