Commit 79d93fef authored by Valentin Reis's avatar Valentin Reis
Browse files

Refactoring parametrized stream problem size and optional libnrm use.

parent 59feb155
Pipeline #4975 passed with stage
in 1 second
{ stdenv, src, fetchgit, mpich2}:
{ stdenv, src, fetchgit, mpich2
, libnrm
, nrmSupport ? false
}:
let
inherit (stdenv.lib) optional;
in
stdenv.mkDerivation {
inherit src;
name = "AMG";
buildInputs = [mpich2];
buildInputs = [mpich2] ++ (optional nrmSupport libnrm);
installPhase = ''
mkdir -p $out/bin
cp test/amg $out/bin
......
......@@ -8,9 +8,16 @@
, gzip
, fftw
, openblas
, mpiSupport ? false, mpi ? null
, mpiSupport ? false
, mpi ? null
, libnrm
, nrmSupport ? false
}:
let
inherit (stdenv.lib) optional;
in
assert mpiSupport -> mpi != null;
stdenv.mkDerivation rec {
......@@ -35,7 +42,7 @@ stdenv.mkDerivation rec {
};
buildInputs = [ fftw libpng openblas gzip bash ]
++ (stdenv.lib.optionals mpiSupport [ mpi ]);
++ (optional mpiSupport [ mpi ]) ++ (optional nrmSupport libnrm);
# Must do manual build due to LAMMPS requiring a seperate build for
# the libraries and executable
......
{ stdenv, src, fetchgit, mpich2, cmake, gfortran, hdf5 , hdf5-cpp , hdf5-fortran , pkgconfig}:
{ stdenv, src, fetchgit, mpich2, cmake, gfortran, hdf5 , hdf5-cpp , hdf5-fortran , pkgconfig, libnrm
, nrmSupport ? false }:
let
inherit (stdenv.lib) optional;
in
stdenv.mkDerivation {
inherit src;
name = "OpenMC";
nativeBuildInputs = [ cmake pkgconfig hdf5 hdf5-cpp hdf5-fortran];
buildInputs = [ gfortran pkgconfig hdf5 hdf5-cpp hdf5-fortran];
buildInputs = [ gfortran pkgconfig hdf5 hdf5-cpp hdf5-fortran] ++ (optional nrmSupport libnrm);
}
{ stdenv, src, fetchgit, openmpi, cmake, liblapack, openblas, fftw, libxml2, hdf5, pythonPackages, hdf5-fortran, gfortran, boost}:
{ stdenv, src, fetchgit, openmpi, cmake, liblapack, openblas, fftw, libxml2, hdf5, pythonPackages, hdf5-fortran, gfortran, boost
, libnrm,
nrmSupport ? false}:
let
inherit (stdenv.lib) optional optionals;
in
stdenv.mkDerivation {
inherit src;
name = "qmcpack";
cmakeFlags = [
"-DCMAKE_C_COMPILER=${openmpi}/bin/mpicc"
"-DCMAKE_CXX_COMPILER=${openmpi}/bin/mpic++"
] ++ optionals nrmSupport [
"-DQMC_INCLUDE=${libnrm}/include/"
"-DQMC_EXTRA_LIBS=${libnrm}/lib/libnrm.so"
];
nativeBuildInputs = [ cmake openmpi ];
buildInputs = [ liblapack openblas fftw libxml2 hdf5 hdf5-fortran pythonPackages.numpy gfortran boost ];
buildInputs = [
liblapack
openblas
fftw
libxml2
hdf5
hdf5-fortran
pythonPackages.numpy
gfortran
boost
] ++ (optional nrmSupport libnrm);
propagatedBuildInputs = [ pythonPackages.numpy ];
dontUseCmakeBuildDir = true;
preConfigure = ''
......
{ stdenv, src, intel, gsl, libnrm, mpich2}:
{ stdenv, src, intel, gsl, libnrm, mpich2, libnrm}:
stdenv.mkDerivation {
inherit src;
name = "simple-benchmarks";
......
{ stdenv, src, fetchgit, gfortran, pkgconfig }:
{ stdenv, src, fetchgit, gfortran, pkgconfig, libnrm
, problemSize ? "80000000"
, iterationCount ? "20"
, nrmSupport ? false }:
let
inherit (stdenv.lib) optional;
in
stdenv.mkDerivation {
inherit src;
name = "stream";
nativeBuildInputs = [ gfortran pkgconfig ];
buildInputs = [ ];
buildInputs = optional nrmSupport libnrm;
buildFlags = ''CC=gcc FC=gfortran'';
preBuild =
"substituteInPlace Makefile --replace 'CFLAGS =' 'CFLAGS = -DSTREAM_ARRAY_SIZE=${problemSize} -DNTIMES=${iterationCount}'";
buildFlags = "CC=gcc FC=gfortran";
installPhase = ''
mkdir -p $out/bin/
cp stream_c.exe $out/bin
cp stream_f.exe $out/bin
cp stream_c.exe $out/bin/stream_c_${iterationCount}
cp stream_f.exe $out/bin/stream_f_${iterationCount}
'';
}
......@@ -3,5 +3,5 @@
"rev": "9be6830772f4f5d6b612660a4988e6cba02429bc",
"date": "2018-02-19T21:23:12+01:00",
"sha256": "1iqw6106ax3l5231bgp1myr99q58hp4nl4v2q4nnrmbllfh2vzhi",
"fetchSubmodules": true
"fetchSubmodules": false
}
{
hostPkgs ? import <nixpkgs> {},
hostPkgs ? import <nixpkgs> {},
system ? builtins.currentSystem,
pkgs-stable ? import ../pin.nix { inherit hostPkgs; jsonpath=../nixpkgs-18.03.json; depset = {inherit system;}; },
pkgs ? import ../pin.nix { inherit hostPkgs; jsonpath=../nixpkgs-unstable.json; depset = {inherit system;}; },
kapack ? import ../pin.nix { hostPkgs = pkgs ; jsonpath=../kapack.json; depset = {hostPkgs=pkgs;};},
supportedSystems ? [ "x86_64-linux" "i686-linux" ]
supportedSystems ? [ "x86_64-linux" "i686-linux" ],
}:
let
releaseTools = import "${pkgs}/top-level/release-lib.nix" {
......@@ -31,6 +31,7 @@ let
cpAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName;};
cpBothAlternatePin = folderPath: depset: jsonName: callPackagePinWith {inherit folderPath depset jsonName; nixName=jsonName;};
pythonPackages = pkgs.python27Packages;
python = pkgs.python;
argopkgs = rec {
#pyzmq = pythonPackages.pyzmq.override { zeromq3 = pkgs.zeromq; };
......@@ -57,21 +58,14 @@ let
let
paths = {
amg = applications/amg;
#qmcpack = applications/qmcpack;
qmcpack = applications/qmcpack;
#openmc = applications/openmc;
stream = applications/stream;
lammps = applications/lammps;
};
rawApplication = name : path: cpDefaultPin path {};
rawApplication = name : path: cpDefaultPin path { inherit (nodelevel) libnrm; };
instrumentedApplication = name: path:
(cpAlternatePin path {} "nrm").overrideAttrs (oldAttrs:
{
buildInputs = oldAttrs.buildInputs ++ [nodelevel.libnrm];
cmakeFlags = if (name=="qmcpack") then
(oldAttrs.cmakeFlags ++ [ ''-DQMC_INCLUDE=${nodelevel.libnrm}/include/'' ''-DQMC_EXTRA_LIBS=${nodelevel.libnrm}/lib/libnrm.so'' ])
else
[];
});
(cpAlternatePin path {inherit (nodelevel) libnrm; } "nrm").override {nrmSupport = true;};
in
rec {
raw = pkgs.lib.mapAttrs rawApplication paths;
......@@ -95,8 +89,10 @@ let
};
zmcat = pkgs-stable.haskellPackages.callPackage ./tools/zmcat {};
asv = callPackage ./tools/asv {};
asv-nix = callPackage ./tools/asv-nix/default.nix { inherit asv; };
aml = cpDefaultPin ./aml {};
};
in argopkgs // pkgs
in pkgs // argopkgs
{ stdenv, src, autoreconfHook, fetchgit, zeromq, gfortran, pkgconfig, mpich2 }:
stdenv.mkDerivation {
inherit src;
name = "libnrm";
nativeBuildInputs = [ autoreconfHook pkgconfig ];
buildInputs = [ zeromq gfortran ];
}
inherit src;
name = "libnrm";
nativeBuildInputs = [ autoreconfHook pkgconfig ];
buildInputs = [ zeromq gfortran ] ;
}
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