Skip to content

Commit

Permalink
Add debug option to xml submissions
Browse files Browse the repository at this point in the history
- When pbspro: add debug=true to native statement; similar
to what already happens but now users can turn it off
- When slurm: add SBATCH_DEBUG=2 (-vv, very verbose) to xml;
exports SBATCH_DEBUG to environment for all jobs

Refs NOAA-EMC#619
  • Loading branch information
KateFriedman-NOAA committed Feb 22, 2024
1 parent 1f31a4d commit 6fcb333
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion workflow/rocoto/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ def get_resource(self, task_name):

native = None
if scheduler in ['pbspro']:
native = '-l debug=true,place=vscatter'
# Set place=vscatter by default and debug=true if DEBUG="YES"
if self._base['DEBUG']:
native = '-l debug=true,place=vscatter'
else:
native = '-l place=vscatter'
# Set either exclusive or shared - default on WCOSS2 is exclusive when not set
if task_config.get('is_exclusive', False):
native += ':exclhost'
Expand Down
3 changes: 3 additions & 0 deletions workflow/rocoto/workflow_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def _get_definitions(self) -> str:

entity['MAXTRIES'] = self.rocoto_config['maxtries']

if self._base['DEBUG'] and self._app_config.scheduler in ['slurm']:
entity['SBATCH_DEBUG'] = '2'

# Put them all in an XML key-value syntax
strings = []
for key, value in entity.items():
Expand Down

0 comments on commit 6fcb333

Please sign in to comment.