fwi: add problem size parameters

This commit is contained in:
Rodrigo Arias 2021-03-04 17:53:07 +01:00 committed by Aleix Roca Nonell
parent fa0e9f591f
commit 485b9150e5

View File

@ -1,8 +1,12 @@
{
stdenv
, nz ? 200
, nx ? 200
, ny ? 500
}:
with stdenv.lib;
with builtins;
stdenv.mkDerivation rec {
name = "fwi-input";
@ -14,6 +18,13 @@ stdenv.mkDerivation rec {
enableParallelBuilding = false;
# Set the input size with the weird order (nz,nx,ny).
postPatch = ''
sed -i 1c${toString nz} SetupParams/fwi_params.txt
sed -i 2c${toString nx} SetupParams/fwi_params.txt
sed -i 3c${toString ny} SetupParams/fwi_params.txt
'';
# FIXME: This is an ugly hack.
# When using _GNU_SOURCE or any other definition used in features.h, we need
# to define them before mcc includes nanos6.h from the command line. So the