From d1192c9f61c122d21c9426e77de5c41bd54d1b25 Mon Sep 17 00:00:00 2001 From: Sean Bryan Date: Thu, 12 Oct 2023 09:34:25 +1100 Subject: [PATCH] Update usage of `set -ex` The PBS job script produces a lot of excessive output from the `module purge` and `module load ` commands. This can be fixed easily by enabling the set options after the module commands. Replace xtrace mode `-x` with verbose mode `-v` as the job script is not complex. Fixes #174 --- benchcab/utils/pbs.py | 4 ++-- tests/test_pbs.py | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/benchcab/utils/pbs.py b/benchcab/utils/pbs.py index f7cb3762..60414fdc 100644 --- a/benchcab/utils/pbs.py +++ b/benchcab/utils/pbs.py @@ -45,11 +45,11 @@ def render_job_script( #PBS -m e #PBS -l storage={'+'.join(storage_flags)} -set -ex - module purge {module_load_lines} +set -ev + {benchcab_path} fluxsite-run-tasks --config={config_path} {verbose_flag} {'' if skip_bitwise_cmp else f''' {benchcab_path} fluxsite-bitwise-cmp --config={config_path} {verbose_flag} diff --git a/tests/test_pbs.py b/tests/test_pbs.py index c12e3e0d..ec53fe7b 100644 --- a/tests/test_pbs.py +++ b/tests/test_pbs.py @@ -26,13 +26,13 @@ def test_default_job_script(self): #PBS -m e #PBS -l storage=gdata/ks32+gdata/hh5 -set -ex - module purge module load foo module load bar module load baz +set -ev + /absolute/path/to/benchcab fluxsite-run-tasks --config=/path/to/config.yaml /absolute/path/to/benchcab fluxsite-bitwise-cmp --config=/path/to/config.yaml @@ -60,13 +60,13 @@ def test_verbose_flag_added_to_command_line_arguments(self): #PBS -m e #PBS -l storage=gdata/ks32+gdata/hh5 -set -ex - module purge module load foo module load bar module load baz +set -ev + /absolute/path/to/benchcab fluxsite-run-tasks --config=/path/to/config.yaml -v /absolute/path/to/benchcab fluxsite-bitwise-cmp --config=/path/to/config.yaml -v @@ -94,13 +94,13 @@ def test_skip_bitwise_comparison_step(self): #PBS -m e #PBS -l storage=gdata/ks32+gdata/hh5 -set -ex - module purge module load foo module load bar module load baz +set -ev + /absolute/path/to/benchcab fluxsite-run-tasks --config=/path/to/config.yaml """ @@ -132,13 +132,13 @@ def test_pbs_config_parameters(self): #PBS -m e #PBS -l storage=gdata/ks32+gdata/hh5+gdata/foo -set -ex - module purge module load foo module load bar module load baz +set -ev + /absolute/path/to/benchcab fluxsite-run-tasks --config=/path/to/config.yaml """ @@ -165,13 +165,13 @@ def test_default_pbs_config(self): #PBS -m e #PBS -l storage=gdata/ks32+gdata/hh5 -set -ex - module purge module load foo module load bar module load baz +set -ev + /absolute/path/to/benchcab fluxsite-run-tasks --config=/path/to/config.yaml """