fwi: fix input derivation

The fwiInput derivation must be the same used when compiled the fwi app
as the fwi-input used in the experiment.
This commit is contained in:
Aleix Roca Nonell 2021-03-08 19:16:24 +01:00
parent 11e400abb5
commit 1d9a5c4721

View File

@ -21,9 +21,20 @@ let
# "garlic/seq" # "garlic/seq"
]; ];
blocksize = [ 1 2 4 ]; blocksize = [ 1 2 ];
n = [
{nx=500; ny=500; nz=500;}
];
}; };
# The c value contains something like:
# {
# n = { nx=500; ny=500; nz=500; }
# blocksize = 1;
# gitBranch = "garlic/tampi+send+oss+task";
# }
machineConfig = targetMachine.config; machineConfig = targetMachine.config;
# Generate the complete configuration for each unit # Generate the complete configuration for each unit
@ -34,10 +45,18 @@ let
cc = icc; cc = icc;
inherit (c) gitBranch blocksize; inherit (c) gitBranch blocksize;
n = 500; n = 500;
nx = n; #nx = c.n.nx;
ny = n; #ny = c.n.ny;
nz = n; #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;
};
# Repeat the execution of each unit several times # Repeat the execution of each unit several times
loops = 10; loops = 10;
@ -56,19 +75,14 @@ let
inherit varConf genConf; inherit varConf genConf;
}; };
exec = {nextStage, conf, ...}: exec = {nextStage, conf, ...}: stages.exec {
let
input = bsc.apps.fwi.input.override {
inherit (conf) nx ny nz;
};
in stages.exec {
inherit nextStage; inherit nextStage;
pre = '' pre = ''
ln -fs ${input}/InputModels InputModels || true ln -fs ${conf.fwiInput}/InputModels InputModels || true
''; '';
argv = [ argv = [
"${input}/fwi_params.txt" "${conf.fwiInput}/fwi_params.txt"
"${input}/fwi_frequencies.txt" "${conf.fwiInput}/fwi_frequencies.txt"
conf.blocksize conf.blocksize
"-1" # Fordward steps "-1" # Fordward steps
"-1" # Backward steps "-1" # Backward steps
@ -80,7 +94,7 @@ let
# FWI program # FWI program
program = {nextStage, conf, ...}: apps.fwi.solver.override { program = {nextStage, conf, ...}: apps.fwi.solver.override {
inherit (conf) cc gitBranch; inherit (conf) cc gitBranch fwiInput;
}; };
pipeline = stdexp.stdPipeline ++ [ exec program ]; pipeline = stdexp.stdPipeline ++ [ exec program ];