我测试了两个系统,都运行 Linux Mint 18.1,并在它们上运行相同的程序。
系统1具有以下特点:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 23
Model name: Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz
Stepping: 10
CPU MHz: 1603.000
CPU max MHz: 2936.0000
CPU min MHz: 1603.0000
BogoMIPS: 5866.45
L1d cache: 32K
L1i cache: 32K
L2 cache: 3072K
NUMA node0 CPU(s): 0,1
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 lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dtherm
` total used free shared buff/cache` available
Mem: 5967 1809 835 88 3321 3750
Low: 5967 5131 835
和系统2:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 63
Model name: Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz
Stepping: 2
CPU MHz: 3399.902
CPU max MHz: 3600.0000
CPU min MHz: 1200.0000
BogoMIPS: 6596.24
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 15360K
NUMA node0 CPU(s): 0-11
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 rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts
total used free shared buff/cache available
Mem: 48203 5957 388 138 41857 41600
Low: 48203 47814 388
程序计时如下(实时):
system 1 2 cores ~30 seconds
system 2 6 cores ~120 seconds
我找不到为什么规格更好的系统 2 性能较低的答案。系统 2 有 8 个空闲核心。一些Matlab
代码在其他 4 个核心上运行。另外,在此过程中我检查了我是否有足够的可用内存。
编辑:我的程序是一个简单的欧拉积分,并行于OpenMP
.它没有大量的输入/输出。我限制了export OMP_NUM_THREADS=6
系统 2 终端上的线程数。程序在我的本地系统上运行。我不知道Matlab代码在做什么。这是一台共享计算机,我使用 ssh 来访问该计算机。我希望这些细节能有所帮助。
我用 2 和 6 线程做了另一个计时:
system 1 2 threads 52 seconds
system 2 2 threads 54 seconds
system 2 6 threads 4 minutes and 22.3492 seconds
system 3 6 threads 19 seconds
系统3是:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
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: 60
Stepping: 3
CPU MHz: 800.000
BogoMIPS: 7982.20
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0-7
看来程序没有问题。系统2很可疑。
编辑 最近我们在系统 2 中添加了 2 个 16GB RAM。我猜想 openmp 在不同的 RAM 插槽上分配内存,并且 RAM 之间的通信使得该过程非常缓慢。有没有办法强制程序只从一个 RAM 插槽分配内存?