From 485b9150e57a3bd43beed7f8c55017f48439140e Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 4 Mar 2021 17:53:07 +0100 Subject: [PATCH] fwi: add problem size parameters --- garlic/apps/fwi/input.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/garlic/apps/fwi/input.nix b/garlic/apps/fwi/input.nix index 63073da..f591731 100644 --- a/garlic/apps/fwi/input.nix +++ b/garlic/apps/fwi/input.nix @@ -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