My program has a longer runtime when running on a cluster node

Recently I encountered a runtime issue: my program runs around 2 times slower on a Grace cluster node compared with the runtime on my own machine, even if their CPU specs look roughly the same (lscpu results are attached at the end).
I did three experiments to verify this:

  1. the same source code is compiled on my own machine and the cluster node, and the respective final executables are dynamically linked. The runtime using my local machine is around 80 s, while the runtime using c34n09 on Grace is around 170 s.
  2. the source code is compiled on my own machine statically, and then it is uploaded to the same node. The runtime using my local machine does not change, while the runtime using the same node is around 180 s.
  3. a portable executable from a third party also runs around 2 times slower on the cluster node.

In case you want to run the binary, the path to the standalone executable is
/home/yy492/project/Dali/bin/adaptec-debug-local
I use the cluster node in the interactive mode via the following command:
[yy492@grace2 ~]$ srun --pty -p pi_manohar --time=720 bash
This program does not frequently read and write from the disk, so I do not have a clue why this slowdown happens. Maybe the memory bandwidth? Could you let me know if you have any thoughts?

run lscpu command on my own machine:
    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):                          6
    On-line CPU(s) list:             0-5
    Thread(s) per core:              1
    Core(s) per socket:              6
    Socket(s):                       1
    NUMA node(s):                    1
    Vendor ID:                       GenuineIntel
    CPU family:                      6
    Model:                           158
    Model name:                      Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Stepping:                        10
    CPU MHz:                         800.005
    CPU max MHz:                     4100.0000
    CPU min MHz:                     800.0000
    BogoMIPS:                        4399.99
    Virtualization:                  VT-x
    L1d cache:                       192 KiB
    L1i cache:                       192 KiB
    L2 cache:                        1.5 MiB
    L3 cache:                        9 MiB
    NUMA node0 CPU(s):               0-5
    Vulnerability Itlb multihit:     KVM: Mitigation: Split huge pages
    Vulnerability L1tf:              Mitigation; PTE Inversion; VMX conditional cache flushes, SMT disabled
    Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT disabled
    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, 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 rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_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 popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d

run lscpu command on a cluster node (c34n09 on Grace):
    Architecture:          x86_64
    CPU op-mode(s):        32-bit, 64-bit
    Byte Order:            Little Endian
    CPU(s):                28
    On-line CPU(s) list:   0-27
    Thread(s) per core:    1
    Core(s) per socket:    14
    Socket(s):             2
    NUMA node(s):          2
    Vendor ID:             GenuineIntel
    CPU family:            6
    Model:                 79
    Model name:            Intel(R) Xeon(R) CPU E5-2660 v4 @ 2.00GHz
    Stepping:              1
    CPU MHz:               1999.889
    BogoMIPS:              3999.77
    Virtualization:        VT-x
    L1d cache:             32K
    L1i cache:             32K
    L2 cache:              256K
    L3 cache:              35840K
    NUMA node0 CPU(s):     0-13
    NUMA node1 CPU(s):     14-27
    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 smx 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 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_ppin intel_pt ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d

It is often expected that the single threaded performance (running on one core only) on the cluster might actually be lower than on a recent personal computer. The high performance potential of a cluster really comes from parallelism and running a volume of tasks that would be unfeasible or impossible on a personal computer. That said, there are also benefits to running a single threaded application on the cluster, even with a slower runtime, such as availability of software and freeing up your local machine for other tasks.

I suspect the main reason why you are seeing such a big difference in run time is that while the base clockspeed on the two chips is similar (2.0 GHz on Grace and 2.2 GHz on your own machine), your local machine CPU can “turbo boost” to 4.1 GHz. When your computer isn’t using all of its core, it can make the ones in use run hotter and faster. We don’t use turbo boost on Grace since the expectation is that all of the cores will be in use all (or most) of the time. To a lesser degree, one also can’t apples-to-apples compare the clock-speed across generations of CPUs. The computer node you listed is a few generations older than your local machine and there are other improvements that also increase performance that are not reflected in the raw clockspeed value.

I see. Thank you for the detailed explanation! That helps a lot.