New design with overlays

This commit is contained in:
2020-09-16 12:22:55 +02:00
parent 847b5b3e0a
commit dba1cc22bc
6 changed files with 249 additions and 251 deletions

View File

@@ -1,27 +1,26 @@
{
pkgs
, bsc
, callPackage
, callPackages
}:
let
callPackage = pkgs.lib.callPackageWith (pkgs // bsc // garlic);
callPackages = pkgs.lib.callPackagesWith (pkgs // bsc // garlic);
garlic = rec {
garlic = {
# Load some helper functions to generate app variants
inherit (import ./gen.nix) genApps genApp genConfigs;
inherit bsc;
mpptest = callPackage ./mpptest { };
ppong = callPackage ./ppong {
mpi = bsc.mpi;
mpi = pkgs.mpi;
};
nbody = callPackage ./nbody {
cc = bsc.icc;
mpi = bsc.impi;
cc = pkgs.icc;
mpi = pkgs.impi;
tampi = pkgs.tampi;
gitBranch = "garlic/seq";
};
@@ -38,15 +37,17 @@ let
};
# Perf is tied to a linux kernel specific version
linuxPackages = bsc.linuxPackages_4_4;
linuxPackages = pkgs.linuxPackages_4_4;
perfWrapper = callPackage ./perf.nix {
perf = linuxPackages.perf;
perf = pkgs.linuxPackages.perf;
};
exp = {
noise = callPackage ./exp/noise.nix { };
nbody = {
bs = callPackage ./exp/nbody/bs.nix { };
bs = callPackage ./exp/nbody/bs.nix {
pkgs = pkgs // garlic;
};
mpi = callPackage ./exp/nbody/mpi.nix { };
};
osu = rec {

View File

@@ -1,7 +1,7 @@
{
bsc
, stdenv
, nbody
stdenv
, nixpkgs
, pkgs
, genApp
, genConfigs
, runWrappers
@@ -12,7 +12,7 @@ with stdenv.lib;
let
# Set variable configuration for the experiment
varConfig = {
cc = [ bsc.icc ];
cc = [ pkgs.bsc.icc ];
blocksize = [ 1024 ];
};
@@ -20,7 +20,7 @@ let
common = {
# Compile time nbody config
gitBranch = "garlic/mpi+send";
mpi = bsc.impi;
mpi = pkgs.bsc.impi;
# nbody runtime options
particles = 1024*128;
@@ -97,10 +97,31 @@ let
-p ${toString conf.particles} )'';
};
nbodyFn = {stage, conf, ...}: with conf; nbody.override {
inherit cc blocksize mpi gitBranch;
bscOverlay = import ../../../../overlay.nix;
genPkgs = newOverlay: nixpkgs {
overlays = [
bscOverlay
newOverlay
];
};
# We may be able to use overlays by invoking the fix function directly, but we
# have to get the definition of the bsc packages and the garlic ones as
# overlays.
nbodyFn = {stage, conf, ...}: with conf;
let
# We set the mpi implementation to the one specified in the conf, so all
# packages in bsc will use that one.
customPkgs = genPkgs (self: super: {
bsc = super.bsc // { mpi = conf.mpi; };
});
in
customPkgs.bsc.garlic.nbody.override {
inherit cc blocksize mpi gitBranch;
};
stages = with common; []
# Use sbatch to request resources first
++ optional enableSbatch sbatch

View File

@@ -1,6 +1,7 @@
{
stdenv
, cc
, tampi ? null
, mpi ? null
, cflags ? null
, gitBranch
@@ -37,6 +38,7 @@ stdenv.mkDerivation rec {
dontPatchShebangs = true;
installPhase = ''
echo ${tampi}
mkdir -p $out/bin
cp nbody* $out/bin/${name}
'';

View File

@@ -2,27 +2,27 @@
stdenv
, gcc
, nanos6
, icc-unwrapped
, iccUnwrapped
, wrapCCWith
, intel-license
, intelLicense
}:
let
targetConfig = stdenv.targetPlatform.config;
inherit gcc;
in wrapCCWith rec {
cc = icc-unwrapped;
cc = iccUnwrapped;
extraBuildCommands = ''
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
echo "-isystem ${icc-unwrapped}/include" >> $out/nix-support/cc-cflags
echo "-isystem ${icc-unwrapped}/include/intel64" >> $out/nix-support/cc-cflags
echo "-isystem ${iccUnwrapped}/include" >> $out/nix-support/cc-cflags
echo "-isystem ${iccUnwrapped}/include/intel64" >> $out/nix-support/cc-cflags
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
cat "${icc-unwrapped}/nix-support/propagated-build-inputs" >> \
cat "${iccUnwrapped}/nix-support/propagated-build-inputs" >> \
$out/nix-support/propagated-build-inputs
echo "export INTEL_LICENSE_FILE=${intel-license}" \
echo "export INTEL_LICENSE_FILE=${intelLicense}" \
>> $out/nix-support/setup-hook
# Create the wrappers for icc and icpc