From 0c5883bbce990809800106eaad2512f9a6d1b7eb Mon Sep 17 00:00:00 2001 From: qbisi Date: Mon, 21 Oct 2024 07:20:30 +0800 Subject: [PATCH] mpiCheckPhaseHook: add parameters to bypass errors in sandbox --- .../setup-hooks/mpi-check-hook/default.nix | 4 ++++ .../setup-hooks/mpi-check-hook/mpi-check-hook.sh | 11 +++++++++++ .../setup-hooks/mpi-check-hook/topology.xml | 10 ++++++++++ 3 files changed, 25 insertions(+) create mode 100644 pkgs/build-support/setup-hooks/mpi-check-hook/topology.xml diff --git a/pkgs/build-support/setup-hooks/mpi-check-hook/default.nix b/pkgs/build-support/setup-hooks/mpi-check-hook/default.nix index 2834cfcc44ff..a49e8e338bea 100644 --- a/pkgs/build-support/setup-hooks/mpi-check-hook/default.nix +++ b/pkgs/build-support/setup-hooks/mpi-check-hook/default.nix @@ -2,4 +2,8 @@ makeSetupHook { name = "mpi-checkPhase-hook"; + + substitutions = { + topology = ./topology.xml; + }; } ./mpi-check-hook.sh diff --git a/pkgs/build-support/setup-hooks/mpi-check-hook/mpi-check-hook.sh b/pkgs/build-support/setup-hooks/mpi-check-hook/mpi-check-hook.sh index 41b6d864c8a5..d7275b62244d 100644 --- a/pkgs/build-support/setup-hooks/mpi-check-hook/mpi-check-hook.sh +++ b/pkgs/build-support/setup-hooks/mpi-check-hook/mpi-check-hook.sh @@ -44,6 +44,17 @@ setupMpiCheck() { # Disable CPU pinning export OMPI_MCA_hwloc_base_binding_policy=none export PRTE_MCA_hwloc_default_binding_policy=none + + # OpenMPI get confused by the sandbox environment and spew errors like this (both to stdout and stderr): + # [hwloc/linux] failed to find sysfs cpu topology directory, aborting linux discovery. + # [1729458724.473282] [localhost:78 :0] tcp_iface.c:893 UCX ERROR scandir(/sys/class/net) failed: No such file or directory + # These messages contaminate test output, which makes the difftest to fail. + # The solution is to use a preset cpu topology file and disable ucx model. + + # Disable sysfs cpu topology directory discovery. + export PRTE_MCA_hwloc_use_topo_file="@topology@" + # Use the network model ob1 instead of ucx. + export OMPI_MCA_pml=ob1 ;; MPICH) # Fix to make mpich run in a sandbox diff --git a/pkgs/build-support/setup-hooks/mpi-check-hook/topology.xml b/pkgs/build-support/setup-hooks/mpi-check-hook/topology.xml new file mode 100644 index 000000000000..616ed839f004 --- /dev/null +++ b/pkgs/build-support/setup-hooks/mpi-check-hook/topology.xml @@ -0,0 +1,10 @@ + + + + + + + + + +