bscpkgs/garlic/exp/osu/latency.nix

69 lines
1.5 KiB
Nix
Raw Normal View History

2020-08-19 00:28:30 +08:00
{
2021-02-23 22:22:56 +08:00
stdenv
, stdexp
, bsc
, targetMachine
, stages
2020-08-19 17:07:21 +08:00
# Should we test the network (true) or the shared memory (false)?
, interNode ? true
2021-03-01 18:55:13 +08:00
, enableMultithread ? false
2020-08-19 00:28:30 +08:00
}:
2021-03-01 18:55:13 +08:00
with builtins;
with stdenv.lib;
2020-08-19 00:28:30 +08:00
let
2021-03-01 18:55:13 +08:00
machineConfig = targetMachine.config;
2021-02-23 22:22:56 +08:00
# Initial variable configuration
varConf = with bsc; {
2021-02-24 00:52:48 +08:00
mpi = [ impi bsc.openmpi mpich ]; #psmpi ];
2020-08-19 00:28:30 +08:00
};
2021-02-23 22:22:56 +08:00
# Generate the complete configuration for each unit
genConf = with bsc; c: targetMachine.config // rec {
2021-03-01 18:55:13 +08:00
inherit (machineConfig) hw;
2020-08-19 17:07:21 +08:00
nodes = if interNode then 2 else 1;
ntasksPerNode = if interNode then 1 else 2;
2021-03-01 18:55:13 +08:00
cpusPerTask = if (enableMultithread) then hw.cpusPerSocket else 1;
2020-08-19 00:28:30 +08:00
time = "00:10:00";
qos = "debug";
2021-02-23 22:22:56 +08:00
loops = 30;
expName = "osu-latency-${mpi.name}";
unitName = expName;
jobName = expName;
inherit (c) mpi;
2021-03-01 18:55:13 +08:00
inherit enableMultithread;
2020-08-19 00:28:30 +08:00
};
2021-02-23 22:22:56 +08:00
# Compute the array of configurations
configs = stdexp.buildConfigs {
inherit varConf genConf;
2020-08-19 00:28:30 +08:00
};
2021-02-23 22:22:56 +08:00
exec = {nextStage, conf, ...}: with conf; stages.exec {
inherit nextStage;
2021-03-01 18:55:13 +08:00
program = if (enableMultithread) then
"${nextStage}/bin/osu_latency_mt"
else
"${nextStage}/bin/osu_latency";
argv = optionals (enableMultithread) [
"-t" "${toString conf.cpusPerTask}:${toString conf.cpusPerTask}"
];
2020-08-19 00:28:30 +08:00
};
2021-02-23 22:22:56 +08:00
program = {nextStage, conf, ...}: bsc.osumb.override {
# Use the specified MPI implementation
inherit (conf) mpi;
};
2020-08-19 00:28:30 +08:00
2021-02-23 22:22:56 +08:00
pipeline = stdexp.stdPipeline ++ [ exec program ];
2020-08-19 00:28:30 +08:00
in
2021-02-23 22:22:56 +08:00
stdexp.genExperiment { inherit configs pipeline; }