Closed pmav99 closed 1 year ago
Fixing this is easy enough. For example:
#!/usr/bin/env bash
#
# launchschism.sh
#
# Launch schism using MPI
set -euo pipefail
root_dir="$(dirname "$(realpath "$0")")"
cd "${root_dir}"
rm -rf outputs
mkdir -p outputs
exec mpirun {mpirun_flags} -N {ncores} {cmd} {scribes}
Nevertheless, I think that it would be useful to add some extra functionality to the script. E.g. to log the progress of the execution to stdout and to store the logs to the model directory. The "problem" is that in order to do so we need to make use of bash variables which conflict with the syntax python uses for variable interpolation in strings:
"${bash_var}" # <- bash
This is my {python_var}. # <- python
To circumvent this we need to use an actual template engine (i.e. jinja) instead of plain string formatting. BTW we are already pulling jinja
as a secondary dependency. I will think about it.
For now, I decided to:
The transition to jinja will make it easier to implement more elaborate logic in the launch scripts in the future.