From c7c8d858f4f358b101278d7e3d45d2efd0805295 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Wed, 29 Jul 2020 18:38:39 +0200 Subject: [PATCH] Test runner script WIP --- bsc/garlic/default.nix | 26 +++++++++++++++++++------- bsc/garlic/gen.nix | 2 +- bsc/garlic/runner.nix | 27 +++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 bsc/garlic/runner.nix diff --git a/bsc/garlic/default.nix b/bsc/garlic/default.nix index 4cf41cb..e8c5244 100644 --- a/bsc/garlic/default.nix +++ b/bsc/garlic/default.nix @@ -8,7 +8,7 @@ let callPackages = pkgs.lib.callPackagesWith (pkgs // bsc // garlic); # Load some helper functions to generate app variants - inherit (import ./gen.nix) genApps genConfigs; + inherit (import ./gen.nix) genApps genApp genConfigs; garlic = rec { @@ -21,6 +21,10 @@ let gitBranch = "garlic/seq"; }; + runner = callPackage ./runner.nix { + app = null; + }; + exp = { mpiImpl = callPackage ./experiments { apps = genApps [ ppong ] ( @@ -31,12 +35,20 @@ let }; nbody = callPackage ./experiments { - apps = genApps [ nbody ] ( + apps = genApp nbody [ + { cc=bsc.icc; + cflags="-march=core-avx2"; } + { cc=bsc.clang-ompss2; + cflags="-O3 -march=core-avx2 -ffast-math -Rpass-analysis=loop-vectorize"; } + ]; + }; + + nbody-blocksize = callPackage ./experiments { + apps = genApp nbody ( genConfigs { - cc = [ pkgs.gcc7 pkgs.gcc9 ]; - gitBranch = [ "garlic/seq" ]; - } - ); + cc = [ bsc.icc ]; + blocksize = [ "1024" "2048" ]; + }); }; # Test if there is any difference between intel -march and -xCORE @@ -47,7 +59,7 @@ let cflags = [ "-march=core-avx2" "-xCORE-AVX2" ]; }) ++ ( genConfigs { cc = [ bsc.clang-ompss2 ]; - cflags = [ "-march=core-avx2 -Rpass-analysis=loop-vectorize" ]; + cflags = [ "-O3 -march=core-avx2 -Rpass-analysis=loop-vectorize" ]; })); }; }; diff --git a/bsc/garlic/gen.nix b/bsc/garlic/gen.nix index adac866..0c20f9c 100644 --- a/bsc/garlic/gen.nix +++ b/bsc/garlic/gen.nix @@ -23,7 +23,7 @@ let genConfigs = (config: lib.foldl mergeConfig [{}] (attrToList config)); # Generate multiple app versions by override with each config - genApp = (app: configs: map (conf: app.override conf) configs); + genApp = (app: configs: map (conf: app.override conf // {conf=conf;}) configs); # Generate app version from an array of apps genApps = (apps: configs: diff --git a/bsc/garlic/runner.nix b/bsc/garlic/runner.nix new file mode 100644 index 0000000..bbaaa54 --- /dev/null +++ b/bsc/garlic/runner.nix @@ -0,0 +1,27 @@ +{ + stdenv +, app +, argv ? "" +, binary ? "/bin/run" +}: + +stdenv.mkDerivation { + name = "${app.name}-runner"; + preferLocalBuild = true; + + src = ./.; + + buildInputs = [ app ]; + + installPhase = '' + mkdir -p $out/bin + + cat > $out/bin/run <