2020-10-15 18:51:11 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, stdexp
|
|
|
|
, bsc
|
|
|
|
, targetMachine
|
|
|
|
, stages
|
2020-11-17 11:26:35 +01:00
|
|
|
, garlicTools
|
2020-10-19 18:44:20 +02:00
|
|
|
, enableJemalloc ? false
|
2020-11-17 11:26:35 +01:00
|
|
|
, particles ? null
|
2020-10-15 18:51:11 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2020-11-17 11:26:35 +01:00
|
|
|
with garlicTools;
|
2020-10-15 18:51:11 +02:00
|
|
|
|
|
|
|
let
|
2020-11-17 11:26:35 +01:00
|
|
|
|
|
|
|
machineConfig = targetMachine.config;
|
|
|
|
inherit (machineConfig) hw;
|
|
|
|
|
|
|
|
# Number of cases tested
|
|
|
|
steps = 7;
|
|
|
|
|
|
|
|
# First value for nblocks: we want to begin by using 1/2 blocks/cpu so we set
|
|
|
|
# the first number of blocks to cpusPerSocket / 2
|
|
|
|
nblocks0 = hw.cpusPerSocket / 2;
|
|
|
|
|
2020-10-15 18:51:11 +02:00
|
|
|
# Initial variable configuration
|
|
|
|
varConf = with bsc; {
|
2020-11-17 11:26:35 +01:00
|
|
|
# Create a list with values 2^n with n from 0 to (steps - 1) inclusive
|
|
|
|
i = expRange 2 0 (steps - 1);
|
2020-10-15 18:51:11 +02:00
|
|
|
};
|
|
|
|
|
2020-11-17 11:26:35 +01:00
|
|
|
# Set here the particles, so we don't have an infinite recursion in the
|
|
|
|
# genConf attrset.
|
|
|
|
_particles = if (particles != null)
|
|
|
|
then particles
|
|
|
|
else 4096 * hw.cpusPerSocket;
|
2020-10-15 18:51:11 +02:00
|
|
|
|
|
|
|
# Generate the complete configuration for each unit
|
|
|
|
genConf = with bsc; c: targetMachine.config // rec {
|
2020-11-17 11:26:35 +01:00
|
|
|
expName = "nbody-nblocks";
|
|
|
|
unitName = "${expName}${toString nblocks}";
|
2020-10-30 16:30:06 +01:00
|
|
|
|
2020-10-15 18:51:11 +02:00
|
|
|
inherit (machineConfig) hw;
|
|
|
|
# nbody options
|
2020-11-17 11:26:35 +01:00
|
|
|
particles = _particles;
|
2020-10-15 18:51:11 +02:00
|
|
|
timesteps = 10;
|
2020-11-17 11:26:35 +01:00
|
|
|
nblocks = c.i * nblocks0;
|
2020-10-15 18:51:11 +02:00
|
|
|
totalTasks = ntasksPerNode * nodes;
|
|
|
|
particlesPerTask = particles / totalTasks;
|
|
|
|
blocksize = particlesPerTask / nblocks;
|
|
|
|
cc = icc;
|
|
|
|
mpi = impi;
|
|
|
|
gitBranch = "garlic/tampi+send+oss+task";
|
|
|
|
cflags = "-g";
|
2020-10-21 18:18:43 +02:00
|
|
|
inherit enableJemalloc;
|
2020-10-19 18:44:20 +02:00
|
|
|
|
2020-11-17 11:26:35 +01:00
|
|
|
# Repeat the execution of each unit 10 times
|
2020-10-15 18:51:11 +02:00
|
|
|
loops = 10;
|
|
|
|
|
|
|
|
# Resources
|
|
|
|
qos = "debug";
|
2020-11-17 11:26:35 +01:00
|
|
|
cpusPerTask = hw.cpusPerSocket;
|
2020-10-15 18:51:11 +02:00
|
|
|
ntasksPerNode = hw.socketsPerNode;
|
|
|
|
nodes = 1;
|
2020-10-21 18:18:43 +02:00
|
|
|
|
2020-11-17 11:26:35 +01:00
|
|
|
jobName = unitName;
|
2020-10-15 18:51:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# 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
|
2020-10-19 18:44:20 +02:00
|
|
|
customPkgs.apps.nbody.override ({
|
2020-10-15 18:51:11 +02:00
|
|
|
inherit cc blocksize mpi gitBranch cflags;
|
2020-10-19 18:44:20 +02:00
|
|
|
} // optionalAttrs enableJemalloc {
|
|
|
|
mcxx = bsc.mcxx.override {
|
|
|
|
nanos6 = bsc.nanos6Jemalloc;
|
|
|
|
};
|
|
|
|
});
|
2020-10-15 18:51:11 +02:00
|
|
|
|
|
|
|
pipeline = stdexp.stdPipeline ++ [ exec program ];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdexp.genExperiment { inherit configs pipeline; }
|