Skip to content

When I launch 2 processes, openmpi seems to only bind 4 cores. But if I launch 4 or 8 processes, my cpu cores will be all utilized(80 cores)  #12900

@zpcalan

Description

@zpcalan

mpirun version: (Open MPI) 4.0.4.
OS: Linux 10-90-55-33 5.4.0-146-generic https://github.com/open-mpi/ompi/issues/163-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
CPU info:

vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Gold 6242R CPU @ 3.10GHz
stepping        : 7
microcode       : 0x5003303
cpu MHz         : 3151.218
cache size      : 36608 KB
physical id     : 1
siblings        : 40
core id         : 29
cpu cores       : 20
apicid          : 123
initial apicid  : 123
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
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 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 cpuid_fault epb cat_l3 cdp_l3 invpcid_single ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke avx512_vnni md_clear flush_l1d arch_capabilities
bugs            : spectre_v1 spectre_v2 spec_store_bypass swapgs taa itlb_multihit mmio_stale_data retbleed eibrs_pbrsb
bogomips        : 6202.30
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

When I use mpirun -n 2 [my binary], the process's current affinity list is:

>taskset -pc pid1
pid pid1's current affinity list: 0,40
>taskset -pc pid2
pid pid2's current affinity list: 1,41

As you can see, these two processes are using only 2 cpu cores respectively. This causes rapid performance decline of my program.

After I run with --bind-to numa option, everything is fine: process's affinity list is:

>taskset -pc pid1
pid pid1's current affinity list: 0-19,40-59
>taskset -pc pid2
pid pid2's current affinity list: 20-39,60-79

Two processes both use cpu cores under the same numa node and the performance recovers.

I also try to launch 4 processes without --bind-to numa, but unlike 2 processes, these 4 processes use cpu cores evenly and performance is normal:

>taskset -pc pid1
pid pid1's current affinity list: 0-19,40-59
>taskset -pc pid2
pid pid2's current affinity list: 20-39,60-79
>taskset -pc pid3
pid pid3's current affinity list: 0-19,40-59
>taskset -pc pid4
pid pid4's current affinity list: 20-39,60-79

So here's my question:
Why is ompi having inconsistent behaviors when launching 2 and 4 processes? Are there any default settings that I don't know in these two scenarios?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions