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