Commit 87be7f6b authored by Valentin Reis's avatar Valentin Reis
Browse files

Refactoring the pinning.

parent 69030b4c
......@@ -15,48 +15,30 @@ let
gitpin = f: pkgs.fetchgit {inherit (pkgs.lib.importJSON f) url sha256 rev fetchSubmodules;};
compiler_path = "/opt/intel/compilers_and_libraries_2017.1.132/linux";
callPackage = pkgs.lib.callPackageWith pkgs;
callPackagePin =
callPackagePinWith =
{ path
, nixName ? "default"
, jsonName ? nixName
, depset ? {} } :
, depset ? {}
, pkgs ? pkgs
} :
let
jsonPath = toPath "/${path}/${jsonName}.json";
in
pkgs.lib.callPackageWith pkgs (toPath "/${path}/${nixName}.nix") (depset // {src = gitpin jsonPath;});
cpDefaultPin = path: depset: callPackagePinWith { inherit path depset;};
cpAlternatePin = path: depset: alternate: callPackagePinWith {inherit path depset jsonName;};
pythonPackages = pkgs.python27Packages;
in rec {
#NRM components
nodelevel = rec {
libnrm = callPackagePin {path="libnrm";};
containers = callPackagePin
{
path = "./containers";
depset= { inherit pythonPackages; };
};
containers-bandit = callPackagePin
{
path = "./containers";
depset= { inherit pythonPackages; };
jsonName = "bandit";
};
nrm = callPackagePin {
path= "./nrm";
depset = { inherit pythonPackages containers; };
};
nrm-bandit = callPackagePin {
path= "./nrm";
depset = {
inherit pythonPackages containers;
containers = containers-bandit;
};
jsonName = "bandit";
nodelevel = rec {
libnrm = callPackagePin {path="libnrm";};
containers = cpDefaultPin "./containers" { inherit pythonPackages; };
containers-bandit = cpAlternatePin "./containers" { inherit pythonPackages; } "bandit";
nrm = cpDefaultPin "./nrm" { inherit pythonPackages containers; };
nrm-bandit = cpAlternatePin "./nrm" { inherit pythonPackages containers-bandit; } "bandit";
};
}
#Instrumented applications
applications = rec {
......@@ -65,8 +47,8 @@ in rec {
openmc = callPackage {path="applications/openmc";};
qmcpack = callPackage {path="applications/qmcpack";};
amg = callPackage {path="applications/amg";};
graph500 = callPackagePin {path="applications/simple"; nixName = "graph500";};
simple = callPackagePin {path="applications/simple"; nixName = "dgemm_randomwalk"; depset={inherit intel libnrm;};};
graph500 = cpAlternatePin "applications/simple" {} "graph500";
simple = cpAlternatePin "applications/simple" {inherit intel; inherit (nodelevel) libnrm;} "dgemm_randomwalk";
};
#Intel compilers
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment