default.nix 2.79 KB
Newer Older
Valentin Reis's avatar
.  
Valentin Reis committed
1
{
Valentin Reis's avatar
Valentin Reis committed
2
  hostNixpkgs ? <nixpkgs>,
3
  pkgs         ? import ../pin.nix { hostPkgs = import hostNixpkgs {}; jsonpath =../nixpkgs-18.03.json; },
Valentin Reis's avatar
.  
Valentin Reis committed
4 5
}:
let
Valentin Reis's avatar
Valentin Reis committed
6
  gitpin = f: pkgs.fetchgit {inherit (pkgs.lib.importJSON f) url sha256 rev fetchSubmodules;};
Valentin Reis's avatar
Valentin Reis committed
7
  compiler_path = "/opt/intel/compilers_and_libraries_2017.1.132/linux";
Valentin Reis's avatar
.  
Valentin Reis committed
8
  callPackage = pkgs.lib.callPackageWith pkgs;
Valentin Reis's avatar
Valentin Reis committed
9
  callPackagePinWith =
Valentin Reis's avatar
Valentin Reis committed
10
  { folderPath
Valentin Reis's avatar
Valentin Reis committed
11 12
  , nixName ? "default"
  , jsonName ? nixName
Valentin Reis's avatar
Valentin Reis committed
13 14
  , depset ? {}
  } :
Valentin Reis's avatar
Valentin Reis committed
15
  let
Valentin Reis's avatar
Valentin Reis committed
16 17 18
    nixPath = folderPath + "/${nixName}.nix";
    jsonPath = folderPath + "/${jsonName}.json";
    src = gitpin jsonPath;
Valentin Reis's avatar
Valentin Reis committed
19
  in
Valentin Reis's avatar
Valentin Reis committed
20 21 22 23
  callPackage nixPath (depset // {inherit src;});

  cpDefaultPin = folderPath: depset: callPackagePinWith { inherit folderPath depset;};
  cpAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName;};
Valentin Reis's avatar
Valentin Reis committed
24
  cpBothAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName; nixName=jsonName;};
Valentin Reis's avatar
Valentin Reis committed
25
  pythonPackages = pkgs.python27Packages;
Valentin Reis's avatar
.  
Valentin Reis committed
26
in rec {
27
  #NRM components
Valentin Reis's avatar
Valentin Reis committed
28

Valentin Reis's avatar
Valentin Reis committed
29
  nodelevel = rec {
Valentin Reis's avatar
Valentin Reis committed
30
    libnrm = cpDefaultPin ./libnrm {};
31 32
    libnrm-pmpi = libnrm.overrideAttrs (oldAttrs: rec {
      configureFlags = "--enable-pmpi";
33
      buildInputs = oldAttrs.buildInputs ++ [ pkgs.mpich2 ];
34
    });
Valentin Reis's avatar
Valentin Reis committed
35 36 37 38
    containers = cpDefaultPin ./containers { inherit pythonPackages; };
    containers-bandit = cpAlternatePin ./containers { inherit pythonPackages; } "bandit";
    nrm = cpDefaultPin ./nrm { inherit pythonPackages; nrm-containers = containers; };
    nrm-bandit = cpAlternatePin ./nrm { inherit pythonPackages; nrm-containers=containers-bandit; } "bandit";
39
  };
Valentin Reis's avatar
Valentin Reis committed
40

41
  #Instrumented applications
Valentin Reis's avatar
Valentin Reis committed
42 43
  applications =
  let
Valentin Reis's avatar
Valentin Reis committed
44 45
    paths = {
     amg = applications/amg;
Valentin Reis's avatar
Valentin Reis committed
46 47 48
     qmcpack = applications/qmcpack;
     openmc = applications/openmc;
     stream = applications/stream;
Valentin Reis's avatar
Valentin Reis committed
49 50
     lammps = applications/lammps;
    };
Valentin Reis's avatar
Valentin Reis committed
51 52 53 54 55 56 57 58
    rawApplication = name : path: cpDefaultPin path {};
    instrumentedApplication = name: path:
      (cpAlternatePin path {} "nrm").overrideAttrs (oldAttrs:
      {
        buildInputs = oldAttrs.buildInputs ++ [nodelevel.libnrm];
      });
  in
  rec {
59 60
    raw = pkgs.lib.mapAttrs rawApplication paths;
    nrm = (pkgs.lib.mapAttrs instrumentedApplication paths) // {
Valentin Reis's avatar
Valentin Reis committed
61 62 63
      dgemm_randomwalk = cpBothAlternatePin applications/simple {inherit intel; inherit (nodelevel) libnrm;} "dgemm_randomwalk";
      graph500 = cpBothAlternatePin applications/simple { inherit (nodelevel) libnrm;} "graph500";
    };
64
  };
Valentin Reis's avatar
Valentin Reis committed
65

66 67
  #Intel compilers
  intel = with pkgs; rec {
68 69
    icc = callPackage intel/icc { inherit compiler_path; };
    mkl = callPackage intel/mkl { inherit compiler_path; };
Valentin Reis's avatar
Valentin Reis committed
70
    WrappedICC = (import intel/cc-wrapper  {
Valentin Reis's avatar
Valentin Reis committed
71 72 73 74 75 76
        inherit stdenv binutils coreutils ;
        libc = glibc;
        nativeTools = false;
        nativeLibc = false;
        cc = icc;
    });
77
  };
Valentin Reis's avatar
renames  
Valentin Reis committed
78
}