From 2f851bc2166149d1c3f777c2a80ea6657c5ffd90 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 15 Mar 2024 13:12:46 +0100 Subject: [PATCH] Fix SLURM bug in rank integer sign expansion See: https://bugs.schedmd.com/show_bug.cgi?id=19324 Reviewed-by: Aleix Roca Nonell --- pkgs/overlay.nix | 7 +++++++ pkgs/slurm-rank-expansion.patch | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/slurm-rank-expansion.patch diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 34e56fb..e354fd8 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -30,5 +30,12 @@ final: prev: ]; }); + slurm = prev.slurm.overrideAttrs (old: { + patches = (old.patches or []) ++ [ + # See https://bugs.schedmd.com/show_bug.cgi?id=19324 + ./slurm-rank-expansion.patch + ]; + }); + prometheus-slurm-exporter = prev.callPackage ./slurm-exporter.nix { }; } diff --git a/pkgs/slurm-rank-expansion.patch b/pkgs/slurm-rank-expansion.patch new file mode 100644 index 0000000..4666d76 --- /dev/null +++ b/pkgs/slurm-rank-expansion.patch @@ -0,0 +1,11 @@ +--- a/src/plugins/mpi/pmix/pmixp_dmdx.c 2024-03-15 13:05:24.815313882 +0100 ++++ b/src/plugins/mpi/pmix/pmixp_dmdx.c 2024-03-15 13:09:53.936900823 +0100 +@@ -314,7 +314,7 @@ static void _dmdx_req(buf_t *buf, int no + } + + nsptr = pmixp_nspaces_local(); +- if (nsptr->ntasks <= rank) { ++ if ((long) nsptr->ntasks <= (long) rank) { + char *nodename = pmixp_info_job_host(nodeid); + PMIXP_ERROR("Bad request from %s: nspace \"%s\" has only %d ranks, asked for %d", + nodename, ns, nsptr->ntasks, rank);