default.nix 2.85 KB
Newer Older
Valentin Reis's avatar
.  
Valentin Reis committed
1
{
Valentin Reis's avatar
Valentin Reis committed
2
  hostNixpkgs ? <nixpkgs>,
Valentin Reis's avatar
Valentin Reis committed
3
  pkgs         ? import ../pin.nix {
Valentin Reis's avatar
Valentin Reis committed
4
    hostPkgs = import hostNixpkgs {};
Valentin Reis's avatar
Valentin Reis committed
5 6 7
    jsonpath =../nixpkgs-18.03.json;
  },
  datamovepkgs ? import ../pin.nix {
Valentin Reis's avatar
Valentin Reis committed
8
    hostPkgs = import hostNixpkgs {};
Valentin Reis's avatar
Valentin Reis committed
9 10
    jsonpath=../datamove.json;
  },
Valentin Reis's avatar
Valentin Reis committed
11
  packagepins ? import ./pins.nix {inherit (pkgs) stdenv fetchgit fetchgitPrivate;}
Valentin Reis's avatar
.  
Valentin Reis committed
12 13
}:
let
Valentin Reis's avatar
Valentin Reis committed
14
  gitpin = f: pkgs.fetchgit {inherit (pkgs.lib.importJSON f) url sha256 rev fetchSubmodules;};
Valentin Reis's avatar
Valentin Reis committed
15
  compiler_path = "/opt/intel/compilers_and_libraries_2017.1.132/linux";
Valentin Reis's avatar
.  
Valentin Reis committed
16
  callPackage = pkgs.lib.callPackageWith pkgs;
Valentin Reis's avatar
Valentin Reis committed
17
  callPackagePinWith =
Valentin Reis's avatar
Valentin Reis committed
18
  { folderPath
Valentin Reis's avatar
Valentin Reis committed
19 20
  , nixName ? "default"
  , jsonName ? nixName
Valentin Reis's avatar
Valentin Reis committed
21 22
  , depset ? {}
  } :
Valentin Reis's avatar
Valentin Reis committed
23
  let
Valentin Reis's avatar
Valentin Reis committed
24 25 26
    nixPath = folderPath + "/${nixName}.nix";
    jsonPath = folderPath + "/${jsonName}.json";
    src = gitpin jsonPath;
Valentin Reis's avatar
Valentin Reis committed
27
  in
Valentin Reis's avatar
Valentin Reis committed
28 29 30 31
  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
32
  cpBothAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName; nixName=jsonName;};
Valentin Reis's avatar
Valentin Reis committed
33
  pythonPackages = pkgs.python27Packages;
Valentin Reis's avatar
.  
Valentin Reis committed
34
in rec {
35
  #NRM components
Valentin Reis's avatar
Valentin Reis committed
36

Valentin Reis's avatar
Valentin Reis committed
37
  nodelevel = rec {
Valentin Reis's avatar
Valentin Reis committed
38 39 40 41 42
    libnrm = cpDefaultPin ./libnrm {};
    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";
43
  };
Valentin Reis's avatar
Valentin Reis committed
44

45
  #Instrumented applications
Valentin Reis's avatar
Valentin Reis committed
46 47
  applications =
  let
Valentin Reis's avatar
Valentin Reis committed
48 49 50 51 52 53 54
    paths = {
     amg = applications/amg;
     qmcpack = applications/qmcpack;
     openmc = applications/openmc;
     stream = applications/stream;
     lammps = applications/lammps;
    };
Valentin Reis's avatar
Valentin Reis committed
55 56 57 58 59 60 61 62
    rawApplication = name : path: cpDefaultPin path {};
    instrumentedApplication = name: path:
      (cpAlternatePin path {} "nrm").overrideAttrs (oldAttrs:
      {
        buildInputs = oldAttrs.buildInputs ++ [nodelevel.libnrm];
      });
  in
  rec {
Valentin Reis's avatar
Valentin Reis committed
63

Valentin Reis's avatar
Valentin Reis committed
64 65
    raw = builtins.mapAttrs rawApplication paths;
    nrm = builtins.mapAttrs instrumentedApplication paths;
Valentin Reis's avatar
Valentin Reis committed
66 67 68 69 70

     #{inherit (nodelevel) libnrm;};

    dgemm_randomwalk = cpBothAlternatePin applications/simple {inherit intel; inherit (nodelevel) libnrm;} "dgemm_randomwalk";
    graph500 = cpBothAlternatePin applications/simple { inherit (nodelevel) libnrm;} "graph500";
71
  };
Valentin Reis's avatar
Valentin Reis committed
72

73 74
  #Intel compilers
  intel = with pkgs; rec {
75 76
    icc = callPackage intel/icc { inherit compiler_path; };
    mkl = callPackage intel/mkl { inherit compiler_path; };
Valentin Reis's avatar
Valentin Reis committed
77
    WrappedICC = (import intel/cc-wrapper  {
Valentin Reis's avatar
Valentin Reis committed
78 79 80 81 82 83
        inherit stdenv binutils coreutils ;
        libc = glibc;
        nativeTools = false;
        nativeLibc = false;
        cc = icc;
    });
84
  };
Valentin Reis's avatar
renames  
Valentin Reis committed
85
}