2020-10-15 18:51:11 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, stdexp
|
|
|
|
, bsc
|
|
|
|
, targetMachine
|
|
|
|
, stages
|
2020-10-19 18:44:20 +02:00
|
|
|
, enableJemalloc ? false
|
2020-10-21 18:18:43 +02:00
|
|
|
|
|
|
|
# Leave the first CPU per socket unused?
|
|
|
|
, freeCpu ? false
|
2020-10-21 18:43:40 +02:00
|
|
|
, particles ? 1024 * 32
|
2020-10-15 18:51:11 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
# Initial variable configuration
|
|
|
|
varConf = with bsc; {
|
|
|
|
# We need at least cpusPerNode blocks
|
2020-10-16 15:56:28 +02:00
|
|
|
nblocks = [ 4 8 16 32 64 128 256 512 ];
|
2020-10-15 18:51:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
machineConfig = targetMachine.config;
|
|
|
|
|
|
|
|
# Generate the complete configuration for each unit
|
|
|
|
genConf = with bsc; c: targetMachine.config // rec {
|
|
|
|
inherit (machineConfig) hw;
|
|
|
|
# nbody options
|
2020-10-21 18:43:40 +02:00
|
|
|
inherit particles;
|
2020-10-15 18:51:11 +02:00
|
|
|
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";
|
2020-10-21 18:18:43 +02:00
|
|
|
inherit enableJemalloc;
|
2020-10-19 18:44:20 +02:00
|
|
|
|
2020-10-15 18:51:11 +02:00
|
|
|
# Repeat the execution of each unit 30 times
|
|
|
|
loops = 10;
|
|
|
|
|
|
|
|
# Resources
|
|
|
|
qos = "debug";
|
|
|
|
ntasksPerNode = hw.socketsPerNode;
|
|
|
|
nodes = 1;
|
|
|
|
time = "02:00:00";
|
2020-10-21 18:18:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
# If we want to leave one CPU per socket unused
|
|
|
|
inherit freeCpu;
|
|
|
|
|
|
|
|
cpuBind = if (freeCpu)
|
|
|
|
then "verbose,mask_cpu:0xfffffe,0xfffffe000000"
|
|
|
|
else "verbose,sockets";
|
|
|
|
|
2020-10-15 18:51:11 +02:00
|
|
|
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
|
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; }
|