bscpkgs/garlic/exp/nbody/test.nix

62 lines
1.2 KiB
Nix
Raw Normal View History

2020-10-09 21:55:37 +08:00
{
stdenv
, stdexp
2020-10-09 22:32:28 +08:00
, bsc
2020-10-09 21:55:37 +08:00
, targetMachine
, stages
}:
with stdenv.lib;
let
2020-10-10 01:33:06 +08:00
# Initial variable configuration
varConf = with bsc; {
2020-10-09 21:55:37 +08:00
blocksize = [ 1024 2048 ];
};
2020-10-10 01:33:06 +08:00
# Generate the complete configuration for each unit
genConf = with bsc; c: targetMachine.config // rec {
2020-10-09 21:55:37 +08:00
# nbody options
particles = 1024 * 4;
timesteps = 10;
2020-10-10 01:33:06 +08:00
inherit (c) blocksize;
2020-10-09 21:55:37 +08:00
cc = icc;
mpi = impi;
gitBranch = "garlic/mpi+send";
# Repeat the execution of each unit 30 times
loops = 30;
# Resources
2020-10-10 01:33:06 +08:00
qos = "debug";
2020-10-09 21:55:37 +08:00
ntasksPerNode = 2;
nodes = 1;
cpuBind = "sockets,verbose";
2020-10-10 01:33:06 +08:00
jobName = "nbody-bs-${toString blocksize}-${gitBranch}";
2020-10-09 21:55:37 +08:00
};
# Compute the array of configurations
configs = stdexp.buildConfigs {
2020-10-10 01:33:06 +08:00
inherit varConf genConf;
2020-10-09 21:55:37 +08:00
};
exec = {nextStage, conf, ...}: with conf; stages.exec {
inherit nextStage;
argv = [ "-t" timesteps "-p" particles ];
};
program = {nextStage, conf, ...}: with conf;
let
2020-10-09 23:19:00 +08:00
customPkgs = stdexp.replaceMpi conf.mpi;
2020-10-09 21:55:37 +08:00
in
2020-10-09 23:19:00 +08:00
customPkgs.apps.nbody.override {
inherit cc blocksize mpi gitBranch;
};
2020-10-09 21:55:37 +08:00
2020-10-10 01:33:06 +08:00
pipeline = stdexp.stdUnitPre {sbatch=mySbatch;}
++ [ exec program ];
2020-10-09 21:55:37 +08:00
in
2020-10-09 23:19:00 +08:00
stdexp.genExperiment { inherit configs pipeline; }