2020-10-30 15:58:03 +01:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, stdexp
|
|
|
|
, bsc
|
|
|
|
, targetMachine
|
|
|
|
, stages
|
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
# Initial variable configuration
|
|
|
|
varConf = {
|
2021-01-29 15:33:12 +01:00
|
|
|
gitBranch = [
|
|
|
|
"garlic/tampi+send+oss+task"
|
2021-03-04 18:41:24 +01:00
|
|
|
# "garlic/mpi+send+omp+task"
|
|
|
|
# "garlic/mpi+send+oss+task"
|
|
|
|
# "garlic/mpi+send+seq"
|
|
|
|
# "garlic/oss+task"
|
|
|
|
# "garlic/omp+task"
|
|
|
|
# "garlic/seq"
|
2021-01-29 15:33:12 +01:00
|
|
|
];
|
2021-03-04 18:41:24 +01:00
|
|
|
|
2021-03-08 19:16:24 +01:00
|
|
|
blocksize = [ 1 2 ];
|
|
|
|
|
|
|
|
n = [
|
|
|
|
{nx=500; ny=500; nz=500;}
|
|
|
|
];
|
2020-10-30 15:58:03 +01:00
|
|
|
};
|
|
|
|
|
2021-03-08 19:16:24 +01:00
|
|
|
# The c value contains something like:
|
|
|
|
# {
|
|
|
|
# n = { nx=500; ny=500; nz=500; }
|
|
|
|
# blocksize = 1;
|
|
|
|
# gitBranch = "garlic/tampi+send+oss+task";
|
|
|
|
# }
|
|
|
|
|
2021-01-29 15:33:12 +01:00
|
|
|
machineConfig = targetMachine.config;
|
|
|
|
|
2020-10-30 15:58:03 +01:00
|
|
|
# Generate the complete configuration for each unit
|
|
|
|
genConf = with bsc; c: targetMachine.config // rec {
|
2021-01-29 15:33:12 +01:00
|
|
|
expName = "fwi";
|
|
|
|
unitName = "${expName}-test";
|
|
|
|
inherit (machineConfig) hw;
|
|
|
|
|
2020-10-30 15:58:03 +01:00
|
|
|
cc = icc;
|
2021-03-04 18:41:24 +01:00
|
|
|
inherit (c) gitBranch blocksize;
|
2021-03-08 19:16:24 +01:00
|
|
|
|
2021-03-04 18:41:24 +01:00
|
|
|
n = 500;
|
2021-03-08 19:16:24 +01:00
|
|
|
#nx = c.n.nx;
|
|
|
|
#ny = c.n.ny;
|
|
|
|
#nz = c.n.nz;
|
|
|
|
|
|
|
|
# Same but shorter:
|
|
|
|
inherit (c.n) nx ny nz;
|
|
|
|
|
|
|
|
fwiInput = bsc.apps.fwi.input.override {
|
|
|
|
inherit (c.n) nx ny nz;
|
|
|
|
};
|
2020-10-30 15:58:03 +01:00
|
|
|
|
2021-01-29 15:33:12 +01:00
|
|
|
# Repeat the execution of each unit several times
|
|
|
|
loops = 10;
|
2020-10-30 15:58:03 +01:00
|
|
|
|
|
|
|
# Resources
|
2021-01-29 15:33:12 +01:00
|
|
|
cpusPerTask = hw.cpusPerSocket;
|
|
|
|
ntasksPerNode = 1;
|
2020-10-30 15:58:03 +01:00
|
|
|
nodes = 1;
|
2021-01-29 15:33:12 +01:00
|
|
|
qos = "debug";
|
2020-10-30 15:58:03 +01:00
|
|
|
time = "02:00:00";
|
2021-01-29 15:33:12 +01:00
|
|
|
jobName = unitName;
|
2020-10-30 15:58:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Compute the array of configurations
|
|
|
|
configs = stdexp.buildConfigs {
|
|
|
|
inherit varConf genConf;
|
|
|
|
};
|
|
|
|
|
2021-03-08 19:16:24 +01:00
|
|
|
exec = {nextStage, conf, ...}: stages.exec {
|
2021-03-04 18:41:24 +01:00
|
|
|
inherit nextStage;
|
|
|
|
pre = ''
|
2021-03-08 19:16:24 +01:00
|
|
|
ln -fs ${conf.fwiInput}/InputModels InputModels || true
|
2021-03-04 18:41:24 +01:00
|
|
|
'';
|
|
|
|
argv = [
|
2021-03-08 19:16:24 +01:00
|
|
|
"${conf.fwiInput}/fwi_params.txt"
|
|
|
|
"${conf.fwiInput}/fwi_frequencies.txt"
|
2021-03-04 18:41:24 +01:00
|
|
|
conf.blocksize
|
|
|
|
"-1" # Fordward steps
|
|
|
|
"-1" # Backward steps
|
|
|
|
"-1" # Write/read frequency
|
|
|
|
];
|
|
|
|
};
|
2021-01-29 15:33:12 +01:00
|
|
|
|
|
|
|
apps = bsc.garlic.apps;
|
2020-10-30 15:58:03 +01:00
|
|
|
|
|
|
|
# FWI program
|
2021-01-29 15:33:12 +01:00
|
|
|
program = {nextStage, conf, ...}: apps.fwi.solver.override {
|
2021-03-08 19:16:24 +01:00
|
|
|
inherit (conf) cc gitBranch fwiInput;
|
2021-01-29 15:33:12 +01:00
|
|
|
};
|
2020-10-30 15:58:03 +01:00
|
|
|
|
2021-03-04 18:41:24 +01:00
|
|
|
pipeline = stdexp.stdPipeline ++ [ exec program ];
|
2020-10-30 15:58:03 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdexp.genExperiment { inherit configs pipeline; }
|