HPMC User Guide v 1.00
© 2026 Bassem W. Jamaleddine
Context switching over HPMC's MICs is not harmful, after couple of rounds of CW, they will clear up. The MIC has 240 cores, but what if I run the MPI program with 3000 threads. No problem. The Xeon Phi handles memory consistency inside its hardware and maintain cache coherency between all its active cores. When an RDMA engine reads or modifies data inside the MIC buffer, the hardware handles cache invalidations automatically across the ring bus. This can be seen in the excercise below where we monitored the context switching while displaying the interrupts with dint.
Consider running the following command:
# OMP_NUM_THREADS=3000 I_MPI_DAPL_PROVIDER_LIST=ofa-v2-mlx4_0-1u I_MPI_PERHOST=1 I_MPI_DEBUG=5 \
I_MPI_FABRICS=shm:dapl I_MPI_FALLBACK=0 \
/opt/INTEL-XE-2017-update7/compilers_and_libraries_2017.7.259/linux/mpi/intel64/bin/mpiexec.hydra -n 8 -hosts hpmc7,hpmc9 ./trap_offload
for intra-node communication and Direct Access Programming Layer (dapl)
for InfiniBand RDMA (ofa-v2-mlx4_0-1u)
while disabling automatic fallback to TCP/IP (tcp)
and spawning 3,000 OS threads per MPI rank
As for the MPI Rank Placement, since -n 8 therefore the I_MPI_PERHOST=1 is ignored. Note that passing -n 8 with -hosts hpmc7,hpmc9 overrides the I_MPI_PERHOST=1, placing 4 MPI ranks per host (8 ranks total across 2 nodes). With OMP_NUM_THREADS=3000 active per rank, each host node is actually spawning 12,000 OpenMP threads (4 ranks × 3,000 threads).
19:08 root@HPMC: /mm03fs/MPI # OMP_NUM_THREADS=3000 I_MPI_DAPL_PROVIDER_LIST=ofa-v2-mlx4_0-1u I_MPI_PERHOST=1 I_MPI_DEBUG=5 I_MPI_FABRICS=shm:dapl I_MPI_FALLBACK=0 /opt/INTEL-XE-2017-update7/compilers_and_libraries_2017.7.259/linux/mpi/intel64/bin/mpiexec.hydra -n 8 -hosts hpmc7,hpmc9 ./trap_offload
On SMP systems, the rescheduling interrupts (RES) are the kernel way to notify another CPU-core to schedule a thread. The scheduler spread the load across multiple CPU-cores. As the context switching is progressing due to processors invalidating their own TLB entries being coordinated by the interrupt "TLB shootdowns" acrross the multiple processors.
(uos/HPMC7) 15:36 root@mic0: ~ # dint -delay 2 -iter 60 -prune 4,2 -interrupts RES,CAL,TLB,LOC,4,17,26 -sortby TLB
(HPMC7) 15:36 root@mic0: ~ # dint -delay 2 -iter 60 -prune 4,2 -interrupts RES,CAL,TLB,LOC,4,17,26 -sortby TLB
CPU26 CPU21 CPU242 CPU171 ... CPU32 CPU127 summed
2026-05-17 15:37:18 RES 1 1 0 0 ... 0 0 20 Rescheduling interrupts
2026-05-17 15:37:18 CAL 0 0 0 0 ... 0 0 0 Function call interrupts
2026-05-17 15:37:18 TLB 1 1 0 0 ... 0 0 2 TLB shootdowns
2026-05-17 15:37:18 LOC 53 24 14 14 ... 13 13 3540 Local timer interrupts
2026-05-17 15:37:18 4 0 0 0 0 ... 0 0 0 IO-APIC-edge dma channel
2026-05-17 15:37:18 17 0 0 0 0 ... 0 0 0 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:18 26 0 0 0 0 ... 0 0 0 SBOX-ICR-edge vnet intr
CPU34 CPU29 CPU242 CPU171 ... CPU32 CPU127 summed
2026-05-17 15:37:20 RES 1 1 3 0 ... 0 0 31 Rescheduling interrupts
2026-05-17 15:37:20 CAL 0 0 0 0 ... 0 0 21 Function call interrupts
2026-05-17 15:37:20 TLB 1 1 0 0 ... 0 0 2 TLB shootdowns
2026-05-17 15:37:20 LOC 63 52 48 23 ... 25 23 5935 Local timer interrupts
2026-05-17 15:37:20 4 0 0 0 0 ... 0 0 2 IO-APIC-edge dma channel
2026-05-17 15:37:20 17 0 0 0 0 ... 0 0 0 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:20 26 0 0 0 0 ... 0 0 4 SBOX-ICR-edge vnet intr
CPU0 CPU242 CPU38 CPU42 ... CPU32 CPU127 summed
2026-05-17 15:37:23 RES 5 96 2 1 ... 0 0 259 Rescheduling interrupts
2026-05-17 15:37:23 CAL 8 0 8 8 ... 8 8 1953 Function call interrupts
2026-05-17 15:37:23 TLB 666 1 1 1 ... 0 0 670 TLB shootdowns
2026-05-17 15:37:23 LOC 43 66 35 63 ... 23 23 5985 Local timer interrupts
2026-05-17 15:37:23 4 3 0 0 0 ... 0 0 3 IO-APIC-edge dma channel
2026-05-17 15:37:23 17 0 0 0 0 ... 0 0 0 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:23 26 6 0 0 0 ... 0 0 6 SBOX-ICR-edge vnet intr
CPU6 CPU10 CPU0 CPU26 ... CPU242 CPU241 summed
2026-05-17 15:37:25 RES 2566 2085 58 1606 ... 49 148 39463 Rescheduling interrupts
2026-05-17 15:37:25 CAL 26 26 14 26 ... 24 21 6442 Function call interrupts
2026-05-17 15:37:25 TLB 1777 1582 1428 1394 ... 5 4 30172 TLB shootdowns
2026-05-17 15:37:25 LOC 133 128 157 77 ... 59 105 5623 Local timer interrupts
2026-05-17 15:37:25 4 0 0 12 0 ... 0 0 12 IO-APIC-edge dma channel
2026-05-17 15:37:25 17 0 0 479 0 ... 0 0 479 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:25 26 0 0 8 0 ... 0 0 8 SBOX-ICR-edge vnet intr
CPU42 CPU26 CPU10 CPU30 ... CPU241 CPU243 summed
2026-05-17 15:37:28 RES 1334 1301 1273 1260 ... 2 0 22709 Rescheduling interrupts
2026-05-17 15:37:28 CAL 0 4 1 0 ... 0 0 114 Function call interrupts
2026-05-17 15:37:28 TLB 1300 1265 1231 1221 ... 0 0 21139 TLB shootdowns
2026-05-17 15:37:28 LOC 88 77 76 80 ... 51 27 6339 Local timer interrupts
2026-05-17 15:37:28 4 0 0 0 0 ... 0 0 2 IO-APIC-edge dma channel
2026-05-17 15:37:28 17 0 0 0 0 ... 0 0 0 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:28 26 0 0 0 0 ... 0 0 4 SBOX-ICR-edge vnet intr
CPU6 CPU10 CPU26 CPU90 ... CPU71 CPU127 summed
2026-05-17 15:37:31 RES 82 70 94 67 ... 41 44 10129 Rescheduling interrupts
2026-05-17 15:37:31 CAL 0 0 0 0 ... 0 0 217 Function call interrupts
2026-05-17 15:37:31 TLB 144 116 99 85 ... 0 0 1836 TLB shootdowns
2026-05-17 15:37:31 LOC 261 262 263 262 ... 260 260 62881 Local timer interrupts
2026-05-17 15:37:31 4 0 0 0 0 ... 0 0 3 IO-APIC-edge dma channel
2026-05-17 15:37:31 17 0 0 0 0 ... 0 0 0 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:31 26 0 0 0 0 ... 0 0 6 SBOX-ICR-edge vnet intr
CPU136 CPU56 CPU135 CPU219 ... CPU32 CPU127 summed
2026-05-17 15:37:33 RES 22 22 24 14 ... 13 12 3476 Rescheduling interrupts
2026-05-17 15:37:33 CAL 0 0 0 0 ... 0 0 161 Function call interrupts
2026-05-17 15:37:33 TLB 15 14 14 10 ... 0 0 73 TLB shootdowns
2026-05-17 15:37:33 LOC 229 233 233 231 ... 228 246 59656 Local timer interrupts
2026-05-17 15:37:33 4 0 0 0 0 ... 0 0 2 IO-APIC-edge dma channel
2026-05-17 15:37:33 17 0 0 0 0 ... 0 0 0 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:33 26 0 0 0 0 ... 0 0 3 SBOX-ICR-edge vnet intr
CPU242 CPU0 CPU2 CPU171 ... CPU32 CPU127 summed
2026-05-17 15:37:36 RES 5 5 34 14 ... 16 14 3889 Rescheduling interrupts
2026-05-17 15:37:36 CAL 67 0 0 0 ... 0 0 144 Function call interrupts
2026-05-17 15:37:36 TLB 1 1 1 0 ... 0 0 3 TLB shootdowns
2026-05-17 15:37:36 LOC 81 103 238 142 ... 152 140 38895 Local timer interrupts
2026-05-17 15:37:36 4 0 2 0 0 ... 0 0 2 IO-APIC-edge dma channel
2026-05-17 15:37:36 17 0 4 0 0 ... 0 0 4 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:36 26 0 4 0 0 ... 0 0 4 SBOX-ICR-edge vnet intr
CPU98 CPU97 CPU9 CPU13 ... CPU0 CPU243 summed
2026-05-17 15:37:38 RES 1312 1192 1161 1226 ... 11 2 15454 Rescheduling interrupts
2026-05-17 15:37:38 CAL 12 12 12 12 ... 9 12 2933 Function call interrupts
2026-05-17 15:37:38 TLB 1307 1191 1147 1061 ... 0 0 14862 TLB shootdowns
2026-05-17 15:37:38 LOC 190 184 197 200 ... 36 22 42324 Local timer interrupts
2026-05-17 15:37:38 4 0 0 0 0 ... 3 0 3 IO-APIC-edge dma channel
2026-05-17 15:37:38 17 0 0 0 0 ... 31 0 31 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:38 26 0 0 0 0 ... 5 0 5 SBOX-ICR-edge vnet intr
CPU9 CPU97 CPU13 CPU98 ... CPU0 CPU243 summed
2026-05-17 15:37:41 RES 730 552 541 449 ... 14 31 7693 Rescheduling interrupts
2026-05-17 15:37:41 CAL 9 9 9 9 ... 5 9 2234 Function call interrupts
2026-05-17 15:37:41 TLB 728 552 543 446 ... 0 0 7936 TLB shootdowns
2026-05-17 15:37:41 LOC 127 131 126 131 ... 85 168 30136 Local timer interrupts
2026-05-17 15:37:41 4 0 0 0 0 ... 6 0 6 IO-APIC-edge dma channel
2026-05-17 15:37:41 17 0 0 0 0 ... 26 0 26 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:41 26 0 0 0 0 ... 3 0 3 SBOX-ICR-edge vnet intr
CPU30 CPU26 CPU242 CPU171 ... CPU32 CPU127 summed
2026-05-17 15:37:43 RES 1 1 0 0 ... 0 0 32 Rescheduling interrupts
2026-05-17 15:37:43 CAL 0 0 0 0 ... 0 0 4 Function call interrupts
2026-05-17 15:37:43 TLB 1 1 0 0 ... 0 0 2 TLB shootdowns
2026-05-17 15:37:43 LOC 64 40 40 24 ... 23 23 5949 Local timer interrupts
2026-05-17 15:37:43 4 0 0 0 0 ... 0 0 4 IO-APIC-edge dma channel
2026-05-17 15:37:43 17 0 0 0 0 ... 0 0 14 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:43 26 0 0 0 0 ... 0 0 8 SBOX-ICR-edge vnet intr
CPU34 CPU38 CPU33 CPU242 ... CPU32 CPU127 summed
2026-05-17 15:37:46 RES 0 1 1 2 ... 0 0 34 Rescheduling interrupts
2026-05-17 15:37:46 CAL 0 0 0 0 ... 0 0 3 Function call interrupts
2026-05-17 15:37:46 TLB 1 1 1 0 ... 0 0 3 TLB shootdowns
2026-05-17 15:37:46 LOC 30 63 36 24 ... 23 23 5926 Local timer interrupts
2026-05-17 15:37:46 4 0 0 0 0 ... 0 0 3 IO-APIC-edge dma channel
2026-05-17 15:37:46 17 0 0 0 0 ... 0 0 0 IO-APIC-edge SCIF INTR 0
2026-05-17 15:37:46 26 0 0 0 0 ... 0 0 11 SBOX-ICR-edge vnet intr
The context switching on HPMC9's MIC mic0
(uos/HPMC7) 13:20 root@mic0: ~ # vmstat 1
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 0 15347940 0 261240 0 0 0 0 6 8 1 0 99 0 0 0 0 15347548 0 261240 0 0 0 0 3410 659 0 0 100 0 1 0 0 15347416 0 261240 0 0 0 0 3267 756 0 0 100 0 0 0 0 15347416 0 261240 0 0 0 0 3264 739 0 0 100 0 0 0 0 15347416 0 261240 0 0 0 0 3266 725 0 0 100 0 2 0 0 15347416 0 261240 0 0 0 0 3232 762 0 0 100 0 0 0 0 15347384 0 261240 0 0 0 0 3228 759 0 0 100 0 0 0 0 15347384 0 261240 0 0 0 0 3122 762 0 0 100 0 2 0 0 15347384 0 261240 0 0 0 0 3266 745 0 0 100 0 2 0 0 15347384 0 261240 0 0 0 0 3275 1369 0 0 100 0 10 0 0 14781864 0 310636 0 0 0 0 43161 53744 0 1 99 0 9 0 0 14169840 0 311608 0 0 0 0 35996 36069 1 2 97 0 6 0 0 13487020 0 311608 0 0 0 0 28046 28376 1 2 97 0 2110 0 0 12855716 0 311608 0 0 0 0 24903 78750 1 2 97 0 2995 0 0 12528556 0 311608 0 0 0 0 41663 5134870 75 17 9 0 4991 0 0 12169516 0 311608 0 0 0 0 40590 967734 90 7 3 0 6207 0 0 12149452 0 311608 0 0 0 0 38221 597301 97 2 1 0 3795 0 0 12143620 0 311608 0 0 0 0 34586 7188691 83 16 1 0 0 0 0 12137728 0 311608 0 0 0 0 26855 5227143 15 51 34 0 9 0 0 12297984 0 311568 0 0 0 0 13860 11212 0 1 99 0 4 0 0 13525120 0 311448 0 0 0 0 57050 27202 0 2 98 0 2 0 0 15247340 0 273848 0 0 0 0 48714 10677 0 2 98 0 0 0 0 15282696 0 261240 0 0 0 0 4830 894 0 0 100 0 0 0 0 15282704 0 261240 0 0 0 0 3121 759 0 0 100 0 2 0 0 15282704 0 261240 0 0 0 0 3259 754 0 0 100 0
In general, we should not use more threads then the number of logical core available on the MICs (of hosts hpmc7 and hpmc9).
Each Xeon Phi core only has a 32 KB L1 data cache and a 512 KB L2 cache shared among its 4 hardware threads. Forcing more than 2 threads onto a single core causes threads to constantly evict each other cached data, driving up cache misses.
Also recall from the chapter on MIC Cache Organization, that for each core there are 4 threads: 2 or more of these threads can fill the VPU pipeline for the maximum performance.
In OpenMP, there are barrier synchronization delays, as HPMC workloads rely on OpenMP barriers, and as the exceeding threads compete for the execution slots, active threads sit waiting for preempted threads to be rescheduled back onto a core to reach the barrier.
The TLB (Translation Lookaside Buffer) will shootdowns, causing to stall the in-order execution pipelines due to frequent page walks.
How does it happen that OMP_NUM_THREADS=3000 ran ~1.06 seconds faster (13.56s vs. 14.62s) despite generating high RES interrupts, that is because the context switching clears up quickly without harming overall wall-clock time.
The run to run variance due to the cold initialization made the 3000 threads slightly faster. In the 13 to 14 seconds Xeon Phi offload job, ~1 second (~7%) is typical variance from cold PCIe/COI daemon wake-up, InfiniBand DAPL queue initialization when OMP_NUM_THREADS=3000 warmed up the COI driver and caches first.
The trap_offload offloads its heavy computation to the MICs of hpmc7 and hpmc9. the host OpenMP region is tiny. Once the host OpenMP thread pool initializes and finishes its brief work, those 3,000 host threads go idle expiring the KMP_BLOCKTIME with almost zero CPU while the KNC card executes the offload.
The RES interrupts spiked during the brief host OpenMP fork/join phase (which takes milliseconds). While the MIC is crunching numbers for 13 seconds, the host threads are already parked, so the RES burst never slows down the critical path on the MIC.