首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >一台CPU性能较高的机器(根据gprof的说法)如何有更差的实时性能?

一台CPU性能较高的机器(根据gprof的说法)如何有更差的实时性能?
EN

Stack Overflow用户
提问于 2014-03-26 20:41:28
回答 2查看 631关注 0票数 4

背景

我有一个计算密集型程序,我试图在一个超级计算机节点上运行。以下是超级计算机上一个节点的规范:

  • 操作系统: Redhat 6企业级64位
  • CPU: Intel 2x6-核2.8GHz (12核) --缓存12 12
  • 拉姆: 24 GB?MHz (没有检查dmidecode的sudo访问权限)

我还在运行在我的MacBook上的Ubuntu虚拟机上测试了这个程序:

  • 操作系统: Ubuntu 13.10 64位
  • CPU: Intel 4x2.30GHz (4核) --缓存6MB
  • 内存:3GB @1600 MHz

这个程序是用gcc的相同版本在两台机器上建立的。然而,为了简化程序的测试运行,在超级计算机上运行程序的实时时间要比在我的虚拟机上长得多。

这对我来说毫无意义,更让人困惑的是,当我在我的程序上运行gprof时,它表明超级计算机确实比我的虚拟机更快。下表显示了我在每台机器(SC =超级计算机,VM =虚拟机)上看到的程序的不同时间:

代码语言:javascript
复制
                            | SC   | VM    |
|---------------------------|------|-------|
| Release (-O3) Real Time   | 15s  | 3s    |
| Debug (-g -pg) Real Time  | 55s  | 35s   |
| Debug (-g -pg) gprof Time | 6.10 | 9.24s |

无论我测试它多少次,都会发生这种情况,在超级计算机的情况下,当程序运行时,我是计算节点上的唯一用户(也就是说,它不应该与其他进程冲突)。

我的程序中很少涉及I/O。它读取1.4MB文件并输出82字节文件。

问题

gprof表示CPU时间性能更好时,导致超级计算机的实时性能下降的原因是什么?我能做些什么来提高超级计算机的实时性能?

其他信息

该程序将大部分时间用于生成和求解线性方程组。实际的解决程序是一个支持openmpi的库,它使用与机器上可用核心数量相对应的独立线程。

我可以使用相同的线性求解程序库运行一个单独的测试程序,它从矩阵市场格式化文件(690 is - "A“矩阵几乎是200万平方)中读取一个更复杂的线性系统,并解决与我编写的程序无关的线性系统。在这种情况下,超级计算机( 48s)比虚拟机( 74s)更快。这既表明问题不在线性求解器中,也表明问题与I/O无关,因为这个测试需要更多的I/O强度。

CPU信息

SC

代码语言:javascript
复制
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 0
siblings    : 6
core id     : 0
cpu cores   : 6
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5600.41
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 0
siblings    : 6
core id     : 1
cpu cores   : 6
apicid      : 2
initial apicid  : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5600.41
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 0
siblings    : 6
core id     : 2
cpu cores   : 6
apicid      : 4
initial apicid  : 4
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5600.41
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 0
siblings    : 6
core id     : 8
cpu cores   : 6
apicid      : 16
initial apicid  : 16
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5600.41
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 4
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 0
siblings    : 6
core id     : 9
cpu cores   : 6
apicid      : 18
initial apicid  : 18
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5600.41
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 5
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 0
siblings    : 6
core id     : 10
cpu cores   : 6
apicid      : 20
initial apicid  : 20
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5600.41
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 6
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 1
siblings    : 6
core id     : 0
cpu cores   : 6
apicid      : 32
initial apicid  : 32
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5599.85
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 7
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 1
siblings    : 6
core id     : 1
cpu cores   : 6
apicid      : 34
initial apicid  : 34
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5599.85
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 8
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 1
siblings    : 6
core id     : 2
cpu cores   : 6
apicid      : 36
initial apicid  : 36
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5599.85
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 9
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 1
siblings    : 6
core id     : 8
cpu cores   : 6
apicid      : 48
initial apicid  : 48
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5599.85
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 10
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 1
siblings    : 6
core id     : 9
cpu cores   : 6
apicid      : 50
initial apicid  : 50
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5599.85
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 11
vendor_id   : GenuineIntel
cpu family  : 6
model       : 44
model name  : Intel(R) Xeon(R) CPU           X5660  @ 2.80GHz
stepping    : 2
cpu MHz     : 2800.207
cache size  : 12288 KB
physical id : 1
siblings    : 6
core id     : 10
cpu cores   : 6
apicid      : 52
initial apicid  : 52
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat epb dts tpr_shadow vnmi flexpriority ept vpid
bogomips    : 5599.85
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

虚拟机

代码语言:javascript
复制
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 58
model name  : Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
stepping    : 9
microcode   : 0x15
cpu MHz     : 2294.125
cache size  : 6144 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm fsgsbase smep
bogomips    : 4588.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 58
model name  : Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
stepping    : 9
microcode   : 0x15
cpu MHz     : 2294.125
cache size  : 6144 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm fsgsbase smep
bogomips    : 4588.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 58
model name  : Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
stepping    : 9
microcode   : 0x15
cpu MHz     : 2294.125
cache size  : 6144 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm fsgsbase smep
bogomips    : 4588.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 58
model name  : Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
stepping    : 9
microcode   : 0x15
cpu MHz     : 2294.125
cache size  : 6144 KB
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb xsaveopt pln pts dtherm fsgsbase smep
bogomips    : 4588.25
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-03-28 18:01:16

这可能不是你的问题的答案,但更像是一个延伸的评论。考虑到没有显示代码行,我只能推测问题的性质。一个双套接字系统与威斯特米尔的构成了一个ccNUMA (缓存相干非统一存储器访问)平台.对于NUMA系统,全局内存被划分为区域,其中一些是本地的,而另一些则是相对于任何给定的CPU核来说是远程的。就内存周期而言,访问本地内存的成本较低,而且通常带宽更高。您的MacBook只有一个CPU套接字,而不是NUMA系统。

也就是说,在ccNUMA系统上启用进程和线程绑定(或钉扎)是非常重要的。操作系统调度程序通常试图保持所有CPU内核负载相等,因此不断地移动线程(进程作为线程的集合)。如果一个线程在一个NUMA节点上分配内存,然后移动到另一个NUMA节点上,那么内存访问将大大减慢。这可以使用处理器关联机制来抵消--其中一种机制向操作系统提供了一个CPU列表,其中一个给定线程可以在其中运行。固定亲和面罩的实际动作称为绑定或钉扎。当涉及到缓存使用时,绑定也很重要,因为将线程从一个核心移动到另一个相同的套接字会导致重新加载L1和L2缓存,而移动到不同的套接字会导致重新加载L1、L2和L3缓存。

使用tasksetnumactl很容易完成进程绑定。绑定线程更复杂,因为它依赖于线程机制。OpenMP 4.0规范了整个过程,但是现在大多数OpenMP实现都是从前一个时代(即3.1版)开始的,因此我们不得不求助于特定于供应商的方法。对于GCC / libgomp来说,要走的路是通过设置GOMP_CPU_AFFINITY。对于12核集群节点,应该执行以下操作:

代码语言:javascript
复制
GOMP_CPU_AFFINITY="0-11" ./executable

同时,OpenMP也会产生一些开销,而小矩阵的开销可能会很高,从而否定了线程处理的好处。开销也随着线程数量的增加而增加。因此,您应该将您的程序与VM中和集群节点上相同数量的线程进行比较。设置OMP_NUM_THREADS应该适用于编写良好的OpenMP代码,这些代码不试图根据某些内部逻辑来修复线程本身的数量。

在简历中,你应该尝试如下:

代码语言:javascript
复制
GOMP_CPU_AFFINITY="0-3" OMP_NUM_THREADS=4 ./executable

在两种系统上。这将消除NUMA的影响和不同的OpenMP间接费用。其余的差异将来自不同的L3缓存体系结构(常春藤桥具有桑迪桥引入的分段L3缓存)、减少常春藤桥中某些指令的延迟、不同的电源管理(可能是X 5660的TurboBoost禁用了?),以及@amdn提到的求解器库使用的不同指令集。

票数 1
EN

Stack Overflow用户

发布于 2014-03-26 22:10:03

Note3:最新的想法是超级计算机有一个更快的I/O子系统,但是在矩阵运算中缺乏速度,因为CPU缺少AVX扩展。MacBook从磁盘执行I/O的速度较慢,但计算速度更快,因为它的CPU具有AVX扩展。也许超级计算机需要33秒来加载690 71,15秒才能计算,而MacBook需要71秒来加载690 71,3秒才能计算。这将达到观察到的总计48秒的超级计算机和74秒的MacBook。

Note2:我有一个新的理论,我认为当您运行单独的测试程序时,超级计算机和MacBook都是内存带宽受限的。那里的数据是690 is,不适合处理器缓存,而生产运行中的数据是1.4MB,这确实适合CPU缓存。在MacBook处理器中,集成存储器控制器采用双通道结构。在超级计算机上,X5660 Xeon处理器内存控制器启用三个通道。因此,对于不适合CPU上一级缓存的非常大的数据集,超级计算机将更快,因为它有更多的内存带宽(3vs2通道)。对于适合于CPU缓存的小工作集,MacBook会更快,因为问题变成了CPU约束,而MacBook CPU有专门用于线性代数的MacBook指令。

原始答案

很可能,您的线性求解程序库根据对CPU功能的运行时检测来选择最快的例程。“超级计算机”可能有更多的内核、更大的缓存、更多的内存,并以更高的频率运行,但是它没有您的MacBook中提供的Intel高级矢量扩展(Intel AVX)指令。这是一个关于线性代数AVX的讨论

一些英特尔工程师的报价

我们最近在桑迪桥和常春藤桥上完成了一组SSE与AVX的测试,性能改善范围在~3x到~6x (用于sqrt操作)之间,代码( C/C++ )通过Intel C++编译器13.0.0.089 (初始版本)进行了逐步优化。

还有这个

矩阵乘法是AVX性能演示的理想应用。它在很大程度上依赖于L1局部性的贴图,因此再次强调性能库(如MKL )。

http://ark.intel.com/compare/47921,64900

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22672615

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档