From b192fc44f5ad63e3b5f37a83ba88de0475110b1b Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 9 Mar 2021 18:45:33 +0100 Subject: [PATCH] heat: refactor cache into granul experiment --- garlic/exp/heat/cache.nix | 87 -------------------------------------- garlic/exp/heat/granul.nix | 11 ++++- garlic/exp/index.nix | 4 +- 3 files changed, 12 insertions(+), 90 deletions(-) delete mode 100644 garlic/exp/heat/cache.nix diff --git a/garlic/exp/heat/cache.nix b/garlic/exp/heat/cache.nix deleted file mode 100644 index 979533b..0000000 --- a/garlic/exp/heat/cache.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ - stdenv -, stdexp -, bsc -, targetMachine -, stages -, garlicTools -}: - -with stdenv.lib; -with garlicTools; - -let - # Initial variable configuration - varConf = with bsc; { - cbs = range2 8 4096; - rbs = range2 32 4096; - }; - - machineConfig = targetMachine.config; - - # Generate the complete configuration for each unit - genConf = with bsc; c: targetMachine.config // rec { - expName = "heat"; - unitName = expName + - ".cbs-${toString cbs}" + - ".rbs-${toString rbs}"; - - inherit (machineConfig) hw; - - # heat options - timesteps = 10; - cols = 1024 * 16; # Columns - rows = 1024 * 16; # Rows - cbs = c.cbs; - rbs = c.rbs; - gitBranch = "garlic/tampi+isend+oss+task"; - - # Repeat the execution of each unit 30 times - loops = 10; - - # Resources - qos = "debug"; - ntasksPerNode = 1; - nodes = 1; - time = "02:00:00"; - # Assign one socket to each task (only one process) - cpusPerTask = hw.cpusPerSocket; - jobName = unitName; - }; - - # Compute the array of configurations - configs = stdexp.buildConfigs { - inherit varConf genConf; - }; - - perf = {nextStage, conf, ...}: stages.perf { - inherit nextStage; - perfOptions = "stat -o .garlic/perf.csv -x , " + - "-e cycles,instructions,cache-references,cache-misses"; - }; - - exec = {nextStage, conf, ...}: stages.exec { - inherit nextStage; - argv = [ - "--rows" conf.rows - "--cols" conf.cols - "--rbs" conf.rbs - "--cbs" conf.cbs - "--timesteps" conf.timesteps - ]; - - # The next stage is the program - env = '' - ln -sf ${nextStage}/etc/heat.conf heat.conf || true - ''; - }; - - program = {nextStage, conf, ...}: bsc.garlic.apps.heat.override { - inherit (conf) gitBranch; - }; - - pipeline = stdexp.stdPipeline ++ [ perf exec program ]; - -in - - stdexp.genExperiment { inherit configs pipeline; } diff --git a/garlic/exp/heat/granul.nix b/garlic/exp/heat/granul.nix index 4edd013..0cd8f16 100644 --- a/garlic/exp/heat/granul.nix +++ b/garlic/exp/heat/granul.nix @@ -5,6 +5,7 @@ , targetMachine , stages , garlicTools +, enablePerf ? false }: with stdenv.lib; @@ -54,6 +55,12 @@ let inherit varConf genConf; }; + perf = {nextStage, conf, ...}: stages.perf { + inherit nextStage; + perfOptions = "stat -o .garlic/perf.csv -x , " + + "-e cycles,instructions,cache-references,cache-misses"; + }; + exec = {nextStage, conf, ...}: stages.exec { inherit nextStage; argv = [ @@ -74,7 +81,9 @@ let inherit (conf) gitBranch; }; - pipeline = stdexp.stdPipeline ++ [ exec program ]; + pipeline = stdexp.stdPipeline ++ + (optional enablePerf perf) ++ + [ exec program ]; in diff --git a/garlic/exp/index.nix b/garlic/exp/index.nix index f616e07..f51895a 100644 --- a/garlic/exp/index.nix +++ b/garlic/exp/index.nix @@ -63,9 +63,9 @@ }; }; - heat = { + heat = rec { granul = callPackage ./heat/granul.nix { }; - cache = callPackage ./heat/cache.nix { }; + cache = granul.override { enablePerf = true; }; }; bigsort = rec {