From a96839d11a4f6cd174319e5b07b6733f63e56cd6 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 19 Apr 2021 15:57:31 +0200 Subject: [PATCH] hpcg: merge weak scaling and add size experiment The scaling.nix file defines both the strong and weak experiments by using the parameter "enableStrong". --- garlic/exp/hpcg/oss.scalability.192.nix | 89 ------------------ garlic/exp/hpcg/oss.slices.weakscaling.nix | 104 --------------------- garlic/exp/hpcg/scaling.nix | 77 +++++++++++++++ garlic/exp/hpcg/{ss.nix => size.nix} | 22 ++--- garlic/exp/index.nix | 23 +---- 5 files changed, 90 insertions(+), 225 deletions(-) delete mode 100644 garlic/exp/hpcg/oss.scalability.192.nix delete mode 100644 garlic/exp/hpcg/oss.slices.weakscaling.nix create mode 100644 garlic/exp/hpcg/scaling.nix rename garlic/exp/hpcg/{ss.nix => size.nix} (74%) diff --git a/garlic/exp/hpcg/oss.scalability.192.nix b/garlic/exp/hpcg/oss.scalability.192.nix deleted file mode 100644 index 534e3cd..0000000 --- a/garlic/exp/hpcg/oss.scalability.192.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ - stdenv -, stdexp -, bsc -, targetMachine -, stages -, genInput -}: - -with stdenv.lib; - -let - # Initial variable configuration - varConf = { - n = [ { x = 192; y = 192; z = 192; } ]; - nprocs = [ - { x = 2; y = 1; z = 1; } - { x = 2; y = 2; z = 1; } - { x = 2; y = 2; z = 2; } - { x = 4; y = 2; z = 2; } - { x = 4; y = 4; z = 2; } - ]; - # nblocks = [ 12 24 48 96 192 384 768 1536 ]; - nblocks = [ 384 768 1536 ]; - ncommblocks = [ 1 ]; - # nodes = [ 1 ]; - # nodes = [ 1 2 4 8 16 ]; - }; - - # Generate the complete configuration for each unit - genConf = c: targetMachine.config // rec { - expName = "hpcg.oss"; - unitName = "${expName}.nb${toString nblocks}"; - - inherit (targetMachine.config) hw; - - # hpcg options - inherit (c) n nprocs nblocks ncommblocks; - - gitBranch = "garlic/tampi+isend+oss+task"; - - # Repeat the execution of each unit 30 times - loops = 10; - - disableAspectRatio = false; - - # Resources - qos = "debug"; - ntasksPerNode = hw.socketsPerNode; - time = "02:00:00"; - # task in one socket - cpusPerTask = hw.cpusPerSocket; - nodes = (nprocs.x * nprocs.y * nprocs.z) / ntasksPerNode; - jobName = "hpcg-${toString n.x}-${toString n.y}-${toString n.z}-${gitBranch}"; - }; - - # Compute the array of configurations - configs = stdexp.buildConfigs { - inherit varConf genConf; - }; - - input = genInput configs; - - exec = {nextStage, conf, ...}: stages.exec { - inherit nextStage; - argv = [ - "--nx=${toString conf.n.x}" - "--ny=${toString conf.n.y}" - "--nz=${toString conf.n.z}" - "--npx=${toString conf.nprocs.x}" - "--npy=${toString conf.nprocs.y}" - "--npz=${toString conf.nprocs.z}" - "--nblocks=${toString conf.nblocks}" - "--ncomms=${toString conf.ncommblocks}" - # The input symlink is generated by the input stage, which is generated by - # the genInput function. - "--load=input" - ]; - }; - - program = {nextStage, conf, ...}: bsc.apps.hpcg.override { - inherit (conf) gitBranch; - }; - - pipeline = stdexp.stdPipeline ++ [ input exec program ]; - -in - - stdexp.genExperiment { inherit configs pipeline; } diff --git a/garlic/exp/hpcg/oss.slices.weakscaling.nix b/garlic/exp/hpcg/oss.slices.weakscaling.nix deleted file mode 100644 index 4ff467d..0000000 --- a/garlic/exp/hpcg/oss.slices.weakscaling.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ - stdenv -, stdexp -, bsc -, targetMachine -, stages -, genInput -}: - -with stdenv.lib; - -let - # Initial variable configuration - varConf = { - n = [ { x = 192; y = 192; z = 192; } ]; - nprocs = [ - { x = 2; y = 1; z = 1; } - { x = 4; y = 1; z = 1; } - { x = 8; y = 1; z = 1; } - { x = 16; y = 1; z = 1; } - { x = 32; y = 1; z = 1; } - - { x = 1; y = 2; z = 1; } - { x = 1; y = 4; z = 1; } - { x = 1; y = 8; z = 1; } - { x = 1; y = 16; z = 1; } - { x = 1; y = 32; z = 1; } - - { x = 1; y = 1; z = 2; } - { x = 1; y = 1; z = 4; } - { x = 1; y = 1; z = 8; } - { x = 1; y = 1; z = 16; } - { x = 1; y = 1; z = 32; } - - ]; - # nblocks = [ 12 24 48 96 192 384 768 1536 ]; - nblocks = [ 384 768 1536 ]; - ncommblocks = [ 1 ]; - # nodes = [ 1 ]; - # nodes = [ 1 2 4 8 16 ]; - }; - - # Generate the complete configuration for each unit - genConf = c: targetMachine.config // rec { - expName = "hpcg.oss"; - unitName = "${expName}.nb${toString nblocks}"; - - inherit (targetMachine.config) hw; - - # hpcg options - inherit (c) n nprocs nblocks ncommblocks; - - gitBranch = "garlic/tampi+isend+oss+task"; - - # Repeat the execution of each unit 30 times - loops = 10; - - disableAspectRatio = true; - - # Resources - qos = "debug"; - ntasksPerNode = hw.socketsPerNode; - time = "02:00:00"; - # task in one socket - cpusPerTask = hw.cpusPerSocket; - nodes = (nprocs.x * nprocs.y * nprocs.z) / ntasksPerNode; - jobName = "hpcg-${toString n.x}-${toString n.y}-${toString n.z}-${gitBranch}"; - }; - - # Compute the array of configurations - configs = stdexp.buildConfigs { - inherit varConf genConf; - }; - - input = genInput configs; - - exec = {nextStage, conf, ...}: stages.exec { - inherit nextStage; - argv = [ - "--nx=${toString conf.n.x}" - "--ny=${toString conf.n.y}" - "--nz=${toString conf.n.z}" - # Distribute all processes in X axis - "--npx=${toString conf.nprocs.x}" - "--npy=${toString conf.nprocs.y}" - "--npz=${toString conf.nprocs.z}" - "--nblocks=${toString conf.nblocks}" - "--ncomms=${toString conf.ncommblocks}" - # The input symlink is generated by the input stage, which is generated by - # the genInput function. - "--load=input" - # Disable HPCG Aspect Ratio to run any mpi layout - ] ++ optional (conf.disableAspectRatio) "--no-ar=1"; - }; - - program = {nextStage, conf, ...}: bsc.apps.hpcg.override { - inherit (conf) gitBranch; - }; - - pipeline = stdexp.stdPipeline ++ [ input exec program ]; - -in - - stdexp.genExperiment { inherit configs pipeline; } diff --git a/garlic/exp/hpcg/scaling.nix b/garlic/exp/hpcg/scaling.nix new file mode 100644 index 0000000..ecd1b16 --- /dev/null +++ b/garlic/exp/hpcg/scaling.nix @@ -0,0 +1,77 @@ +{ + stdenv +, stdexp +, bsc +, targetMachine +, stages +, garlicTools +, callPackage +, enableExtended ? false +, enableStrong ? true +}: + +with stdenv.lib; +with garlicTools; + +let + common = callPackage ./common.nix { }; + + inherit (common) pipeline getSizePerTask; + + maxNodes = 16; + + # Initial variable configuration + varConf = { + nodes = range2 1 maxNodes; + baseSizeZ = if (enableExtended) then [ 8 16 ] else [ 16 ]; + blocksPerCpu = if (enableExtended) then range2 1 8 else [ 4 ]; + gitBranch = [ + "garlic/tampi+isend+oss+task" + ]; + }; + + # Generate the complete configuration for each unit + genConf = c: targetMachine.config // rec { + expName = if (enableStrong) then "hpcg-ss" else "hpcg-ws"; + unitName = "${expName}" + + "-nodes${toString nodes}" + + "-bpc${toString blocksPerCpu}"; + + inherit (targetMachine.config) hw; + + inherit maxNodes; + sizeFactor = if (enableStrong) then maxNodes / nodes else 1; + + # hpcg options + inherit (c) nodes blocksPerCpu gitBranch; + totalTasks = ntasksPerNode * nodes; + sizePerCpu = { + x = 2; + y = 2; + z = c.baseSizeZ * sizeFactor; + }; + sizePerTask = getSizePerTask cpusPerTask sizePerCpu; + nprocs = { x=1; y=1; z=totalTasks; }; + nblocks = blocksPerCpu * cpusPerTask; + ncomms = 1; + disableAspectRatio = true; + + # Repeat the execution of each unit several times + loops = 10; + + # Resources + qos = "debug"; + time = "02:00:00"; + cpusPerTask = hw.cpusPerSocket; + ntasksPerNode = hw.socketsPerNode; + jobName = unitName; + }; + + # Compute the array of configurations + configs = stdexp.buildConfigs { + inherit varConf genConf; + }; + +in + + stdexp.genExperiment { inherit configs pipeline; } diff --git a/garlic/exp/hpcg/ss.nix b/garlic/exp/hpcg/size.nix similarity index 74% rename from garlic/exp/hpcg/ss.nix rename to garlic/exp/hpcg/size.nix index 164681f..3d3b9a5 100644 --- a/garlic/exp/hpcg/ss.nix +++ b/garlic/exp/hpcg/size.nix @@ -6,7 +6,6 @@ , stages , garlicTools , callPackage -, enableExtended ? false }: with stdenv.lib; @@ -19,36 +18,33 @@ let # Initial variable configuration varConf = { - nodes = range2 1 16; - blocksPerCpu = if (enableExtended) - then range2 1 8 - else [ 4 ]; - gitBranch = [ - "garlic/tampi+isend+oss+task" - ]; + sizeFactor = [ 1 2 4 8 16 32 ]; }; # Generate the complete configuration for each unit genConf = c: targetMachine.config // rec { - expName = "hpcg-ss"; + expName = "hpcg-size"; unitName = "${expName}" + "-nodes${toString nodes}" - + "-bpc${toString blocksPerCpu}"; + + "-sf${toString sizeFactor}"; inherit (targetMachine.config) hw; # hpcg options - inherit (c) nodes blocksPerCpu gitBranch; + inherit (c) sizeFactor; + gitBranch = "garlic/tampi+isend+oss+task"; + nodes = 16; totalTasks = ntasksPerNode * nodes; - sizePerCpu = { x=2; y=2; z=128 / totalTasks; }; + sizePerCpu = { x = 2; y = 2; z = 4 * sizeFactor; }; sizePerTask = getSizePerTask cpusPerTask sizePerCpu; nprocs = { x=1; y=1; z=totalTasks; }; + blocksPerCpu = 4; nblocks = blocksPerCpu * cpusPerTask; ncomms = 1; disableAspectRatio = true; # Repeat the execution of each unit several times - loops = 10; + loops = 5; # Resources qos = "debug"; diff --git a/garlic/exp/index.nix b/garlic/exp/index.nix index dc46b76..3545337 100644 --- a/garlic/exp/index.nix +++ b/garlic/exp/index.nix @@ -47,25 +47,10 @@ }; hpcg = rec { - #serial = callPackage ./hpcg/serial.nix { }; - #mpi = callPackage ./hpcg/mpi.nix { }; - #omp = callPackage ./hpcg/omp.nix { }; - #mpi_omp = callPackage ./hpcg/mpi+omp.nix { }; - genInput = callPackage ./hpcg/gen.nix { }; - - oss = callPackage ./hpcg/oss.nix { - inherit genInput; - }; - - ossGranularity = callPackage ./hpcg/oss.granularity.192.nix { - inherit genInput; - }; - - ossSlicesWeakscaling = callPackage ./hpcg/oss.slices.weakscaling.nix { - inherit genInput; - }; - - ss = callPackage ./hpcg/ss.nix { }; + granularity = callPackage ./hpcg/granularity.nix { }; + ss = callPackage ./hpcg/scaling.nix { }; + ws = ss.override { enableStrong=false; }; + size = callPackage ./hpcg/size.nix { }; big.ss = ss.override { enableExtended = true; }; };