anchor.diff:      for entry in $out/bin/mpichversion $out/bin/mpivars; do
         echo "fix rpath: $entry"
         patchelf --set-rpath "$out/lib" $entry
  +    done
  +  '';
  +
  +  # Make OpenSSH available, which is required for mpirun_rsh.
  +  # Enables hybrid parallelisation scheme by default.
  +  postFixup = ''
  +    for exe in $out/bin/*; do
  +      wrapProgram $exe\
  +        --prefix PATH : "${openssh}/bin" \
  +        --set-default MV2_ENABLE_AFFINITY "0"
       done
     '';
   
  
positive.code:   ];
  
  
    nativeBuildInputs = [ pkgconfig bison ];
    propagatedBuildInputs = [ numactl rdma-core zlib infiniband-diags opensm ];
    buildInputs = [ numactl libxml2
                    perl gfortran
                    slurm openssh
                    hwloc rdma-core
                    infiniband-diags opensm ];
  
    configureFlags = lib.optionals useSlurm [ "--with-pmi=pmi1" "--with-pm=slurm" ];
  
    doCheck = true;
  
  
negative.code: { lib, stdenv, fetchurl, pkgconfig, bison, numactl, libxml2
  , perl, gfortran, slurm, openssh, hwloc, zlib, makeWrapper
  # InfiniBand dependencies
  , infiniband-diags, opensm, rdma-core
  # OmniPath dependencies
  , libpsm2, libfabric
  # Compile with slurm as a process manager
  , useSlurm ? false
  # Network type for MVAPICH2
  , network ? "ethernet"
  } :
  
  assert builtins.elem network [ "ethernet" "infiniband" "omnipath" ];
  
  assert
    (if network == "infiniband"
       then (lib.lists.all (x: x != null) [ infiniband-diags opensm rdma-core ])
       else true
    );
  
  assert
    (if network == "omnipath"
       then (lib.lists.all (x: x != null) [ libpsm2 libfabric ])
       else true
    );
  
  let
  
  