Skip to content

Commit

Permalink
Add second native tag and ldebug flag to rocoto
Browse files Browse the repository at this point in the history
- In rocoto setup scripts, create second <native> tag
to set -l ldebug=true for PBS submissions on WCOSS2.
- Use ldebug=True flag from config.resources to add it
to specific jobs requesting it.

Refs NOAA-EMC#1854
  • Loading branch information
KateFriedman-NOAA committed Sep 29, 2023
1 parent 4752aac commit 7d9021e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions workflow/rocoto/rocoto.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def create_task(task_dict: Dict[str, Any]) -> List[str]:
partition = resources_dict.get('partition', None)
walltime = resources_dict.get('walltime', '00:01:00')
native = resources_dict.get('native', None)
native2 = resources_dict.get('native2', None)
memory = resources_dict.get('memory', None)
nodes = resources_dict.get('nodes', 1)
ppn = resources_dict.get('ppn', 1)
Expand Down Expand Up @@ -100,6 +101,8 @@ def create_task(task_dict: Dict[str, Any]) -> List[str]:
strings.append(f'\t<memory>{memory}</memory>\n')
if native is not None:
strings.append(f'\t<native>{native}</native>\n')
if native2 is not None:
strings.append(f'\t<native>{native2}</native>\n')
strings.append('\n')
strings.append(f'\t<join><cyclestr>{log}</cyclestr></join>\n')
strings.append('\n')
Expand Down
6 changes: 5 additions & 1 deletion workflow/rocoto/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_resource(self, task_name):
Given a task name (task_name) and its configuration (task_names),
return a dictionary of resources (task_resource) used by the task.
Task resource dictionary includes:
account, walltime, cores, nodes, ppn, threads, memory, queue, partition, native
account, walltime, cores, nodes, ppn, threads, memory, queue, partition, native[2]
"""

scheduler = self.app_config.scheduler
Expand Down Expand Up @@ -143,10 +143,13 @@ def get_resource(self, task_name):
memory = task_config.get(f'memory_{task_name}', None)

native = None
native2 = None
if scheduler in ['pbspro']:
native = '-l debug=true,place=vscatter'
if task_config.get('is_exclusive', False):
native += ':exclhost'
if task_config.get('ldebug', False):
native2 = '-l ldebug=true'
elif scheduler in ['slurm']:
native = '--export=NONE'

Expand All @@ -165,6 +168,7 @@ def get_resource(self, task_name):
'threads': threads,
'memory': memory,
'native': native,
'native2': native2,
'queue': queue,
'partition': partition}

Expand Down

0 comments on commit 7d9021e

Please sign in to comment.