Hi,
We are currently building a HPC benchmark to evaluate how several programs behave using different MPI implementations. We have some custom packages like fftw or vtk that are dependencies of the programs that we want to test, using a generic mpi dependency:
vtk = callPackage ./bsc/vtk/default.nix {
mpi = mpi;
inherit (pkgs.xorg) libX11 xorgproto libXt;
};
which then is manually set to the one that we want to use:
#mpi = mpich;
#mpi = openmpi;
mpi = intel-mpi;
However, we are thinking in how to achieve it without modifying the default.nix
source.
Ideally I would like to have some function that can generate a new package set, like this:
genPkgs = pkgs: mpi: <magicallyReplaceAllMpi>
Not sure how to do it with overlays, as the overlay requires the knowledge of which MPI implementation to use, so we won’t follow the self: super:
convention.
The configuration is generated like this:
configs = [ { mpi=intel-mpi; } { mpi=openmpi; } { mpi=mpich; } ... ];
genApp = pkgs: mpi: (genPkgs pkgs mpi).app;
apps = map ({mpi, ...}: genApp pkgs mpi) configs;
Is there already a pattern to do this in nixpkgs
? I saw this trick in the QChem repo, but I think that is too limited for additional composition.
In the future we may also replace some other things like the default compiler for some packages, so it would be nice if we can overlap the changes.