From 65745e0aaf5aec50e13e7f75f609e4ceedf7de73 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 15 Oct 2020 18:51:11 +0200 Subject: [PATCH] WIP: Add another nbody experiment --- garlic/exp/nbody/tampi.nix | 78 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 garlic/exp/nbody/tampi.nix diff --git a/garlic/exp/nbody/tampi.nix b/garlic/exp/nbody/tampi.nix new file mode 100644 index 0000000..eb23db1 --- /dev/null +++ b/garlic/exp/nbody/tampi.nix @@ -0,0 +1,78 @@ +{ + stdenv +, stdexp +, bsc +, targetMachine +, stages +}: + +with stdenv.lib; + +let + # Initial variable configuration + varConf = with bsc; { + # We need at least cpusPerNode blocks + nblocks = [ 32 64 128 256 ]; + }; + + machineConfig = targetMachine.config; + + # Generate the complete configuration for each unit + genConf = with bsc; c: targetMachine.config // rec { + inherit (machineConfig) hw; + # nbody options + particles = 1024 * 32; + timesteps = 10; + inherit (c) nblocks; + totalTasks = ntasksPerNode * nodes; + particlesPerTask = particles / totalTasks; + blocksize = particlesPerTask / nblocks; + assert1 = assertMsg (nblocks >= hw.cpusPerSocket) + "nblocks too low: ${toString nblocks} < ${toString hw.cpusPerSocket}"; + assert2 = assertMsg (particlesPerTask >= nblocks) + "too few particles: ${toString particlesPerTask} < ${toString nblocks}"; + cc = icc; + mpi = impi; + gitBranch = "garlic/tampi+send+oss+task"; + cflags = "-g"; + + # Repeat the execution of each unit 30 times + loops = 10; + + # Resources + qos = "debug"; + ntasksPerNode = hw.socketsPerNode; + nodes = 1; + time = "02:00:00"; + cpuBind = "sockets,verbose"; + jobName = "bs-${toString blocksize}-${gitBranch}-nbody"; + }; + + # Compute the array of configurations + configs = stdexp.buildConfigs { + inherit varConf genConf; + }; + + perf = {nextStage, conf, ...}: with conf; stages.perf { + inherit nextStage; + perfOptions = "record --call-graph dwarf -o \\$\\$.perf"; + }; + + exec = {nextStage, conf, ...}: with conf; stages.exec { + inherit nextStage; + argv = [ "-t" timesteps "-p" particles ]; + }; + + program = {nextStage, conf, ...}: with conf; + let + customPkgs = stdexp.replaceMpi conf.mpi; + in + customPkgs.apps.nbody.override { + inherit cc blocksize mpi gitBranch cflags; + }; + + pipeline = stdexp.stdPipeline ++ [ exec program ]; + +in + + stdexp.genExperiment { inherit configs pipeline; }