UCX in HPC-X 2.50 (HPC SDK 26.9) divides 0/0 in MPI_Init, breaking FP trapping; already fixed upstream

Hello,

In case this helps future HPC SDK releases: The UCX 1.21.0 in the bundled HPC-X 2.50 computes 0/0 during MPI_Init. With the default FP environment this is harmless. But a program built with FP traps enabled, e.g. -Ktrap=fp to debug floating-point exceptions, stops with SIGFPE before any user code runs.

A minimal example:

#define _GNU_SOURCE
#include <fenv.h>
#include <mpi.h>
#include <stdio.h>
int main(int argc, char **argv) {
  feenableexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
  MPI_Init(&argc, &argv);
  printf("MPI_Init returned\n");
  MPI_Finalize();
  return 0;
}
$ mpicc fptrap_mpi_init.c && mpirun -np 1 ./a.out
Signal: Floating point exception (8)
Signal code: Invalid floating point operation (7)
[ 1] .../hpcx-2.50/ucx/mt/lib/libucp.so.0(ucp_worker_iface_open+0x4ab)
[ 3] .../hpcx-2.50/ucx/mt/lib/libucp.so.0(ucp_worker_create+0x71c)

A Fortran MPI program built with mpifort -Ktrap=fp stops at the same place. Without UCX (OMPI_MCA_pml=ob1 OMPI_MCA_btl=self,sm OMPI_MCA_osc=^ucx OMPI_MCA_coll=^ucc,hcoll), both run normally.

The faulting instruction is the division in ucp_worker_iface_port_speed (src/ucp/core/ucp_worker.c):

ratio = perf_attr.bandwidth.shared / wiface->attr.bandwidth.shared;

This is 0/0 for an interface with zero shared bandwidth. Upstream UCX has already fixed it, in commit 6ef510d (“UCP/CORE: Skip port speed for zero shared bandwidth”, PR #11672, July 2026). The fix is in the UCX 1.23.0 release candidates, but not in 1.22.0. So it might be worth picking up the patch, or UCX 1.23, in a future HPC-X.

Until then, users can disable UCX for debug runs with FP traps (on a single node, as above), or enable the traps only after MPI_Init.

Environment: NVIDIA HPC SDK 26.9, bundled HPC-X 2.50 (Open MPI 5.0.10rc2, UCX 1.21.0), Ubuntu 26.04.1 LTS, Intel Xeon W-2223.

Thank you in advance!
Pedro

Written with the help of Claude Code.

Hi Pedro,

This one was actually just reported to use yesterday from another user. We’re tracking it as TPR #39143 and will be in contact with the UCX team.

I’ve added your report to the issue.

-Mat