Skip to content

Commit

Permalink
Pass PAYU_METADATA_OFF env var along to subsequent pbs jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-basevi committed Aug 22, 2024
1 parent 0b9b612 commit f89bff0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
4 changes: 4 additions & 0 deletions payu/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ def set_env_vars(init_run=None, n_runs=None, lab_path=None, dir_path=None,
if force_prune_restarts:
payu_env_vars['PAYU_FORCE_PRUNE_RESTARTS'] = force_prune_restarts

if 'PAYU_METADATA_OFF' in os.environ:
# Pass through environment variable from current environment
metadata_off = os.environ['PAYU_METADATA_OFF']

if metadata_off:
payu_env_vars['PAYU_METADATA_OFF'] = metadata_off

Expand Down
12 changes: 0 additions & 12 deletions payu/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,9 +795,6 @@ def archive(self, force_prune_restarts=False):
expt=self.counter
)

if not self.metadata.enabled:
cmd += f' --metadata-off'

sp.check_call(shlex.split(cmd))

if self.config.get('hpctoolkit', False):
Expand All @@ -807,9 +804,6 @@ def archive(self, force_prune_restarts=False):
expt=self.counter
)

if not self.metadata.enabled:
cmd += f' --metadata-off'

sp.check_call(shlex.split(cmd))

archive_script = self.userscripts.get('archive')
Expand Down Expand Up @@ -860,9 +854,6 @@ def postprocess(self):
' payu sync')
cmd += f' --sync-ignore-last'

if not self.metadata.enabled:
cmd += f' --metadata-off'

sp.check_call(shlex.split(cmd))

def sync(self):
Expand All @@ -884,9 +875,6 @@ def resubmit(self):
n=self.n_runs
)

if not self.metadata.enabled:
cmd += f' --metadata-off'

cmd = shlex.split(cmd)
sp.call(cmd)

Expand Down

0 comments on commit f89bff0

Please sign in to comment.