bscpkgs/bsc/garlic/exp/nbody/bs.nix

115 lines
2.1 KiB
Nix
Raw Normal View History

2020-08-10 15:27:46 +02:00
{
bsc
, nbody
, genApp
, genConfigs
2020-08-12 14:00:04 +02:00
# Wrappers
2020-08-17 18:50:18 +02:00
, launchWrapper
2020-08-12 14:00:04 +02:00
, sbatchWrapper
2020-08-17 18:50:18 +02:00
, srunWrapper
2020-08-12 14:00:04 +02:00
, argvWrapper
, controlWrapper
, nixsetupWrapper
2020-09-02 10:44:13 +02:00
, statspyWrapper
, extraeWrapper
, perfWrapper
2020-08-10 15:27:46 +02:00
}:
let
# Set the configuration for the experiment
config = {
cc = [ bsc.icc ];
blocksize = [ 1024 ];
2020-08-12 14:00:04 +02:00
};
extraConfig = {
gitBranch = "garlic/mpi+send";
mpi = bsc.impi;
particles = 1024*128;
2020-09-02 10:44:13 +02:00
timesteps = 100;
ntasksPerNode = "48";
nodes = "1";
time = "02:00:00";
qos = "debug";
2020-08-10 15:27:46 +02:00
};
# Compute the cartesian product of all configurations
2020-08-12 14:00:04 +02:00
allConfigs = genConfigs config;
2020-08-17 18:50:18 +02:00
filteredConfigs = with builtins; filter (c: c.blocksize <= 4096) allConfigs;
configs = map (conf: conf // extraConfig) filteredConfigs;
2020-08-12 14:00:04 +02:00
sbatch = conf: app: with conf; sbatchWrapper {
2020-08-12 14:00:04 +02:00
app = app;
nixPrefix = "/gpfs/projects/bsc15/nix";
exclusive = true;
inherit ntasksPerNode nodes time qos;
2020-08-12 14:00:04 +02:00
};
2020-08-17 18:50:18 +02:00
srun = app: srunWrapper {
app = app;
nixPrefix = "/gpfs/projects/bsc15/nix";
2020-09-02 10:44:13 +02:00
srunOptions = "--cpu-bind=verbose,rank";
2020-08-17 18:50:18 +02:00
};
2020-08-12 14:00:04 +02:00
argv = conf: app:
with conf;
argvWrapper {
app = app;
env = ''
set -e
export I_MPI_THREAD_SPLIT=1
'';
2020-08-12 14:00:04 +02:00
argv = ''(-t ${toString timesteps} -p ${toString particles})'';
};
2020-09-02 10:44:13 +02:00
statspy = app:
statspyWrapper {
app = app;
};
extrae = app:
extraeWrapper {
app = app;
traceLib = "mpi";
configFile = ./extrae.xml;
};
perf = app:
perfWrapper {
app = app;
perfArgs = "sched record -a";
};
2020-08-12 14:00:04 +02:00
nbodyFn = conf:
with conf;
nbody.override { inherit cc mpi blocksize gitBranch; };
2020-08-12 14:00:04 +02:00
pipeline = conf:
2020-09-02 10:44:13 +02:00
# sbatch conf (
# nixsetupWrapper (
# controlWrapper (
srun (
nixsetupWrapper (
2020-09-02 10:44:13 +02:00
# extrae (
# perf (
argv conf (
nbodyFn conf
)
# )
# )
)
)
# )
# )
# )
;
2020-08-12 14:00:04 +02:00
# Ideally it should look like this:
#pipeline = sbatch nixsetup control argv nbodyFn;
2020-08-17 18:50:18 +02:00
jobs = map pipeline configs;
2020-08-12 14:00:04 +02:00
2020-08-10 15:27:46 +02:00
in
2020-08-17 18:50:18 +02:00
launchWrapper jobs