Skip to content

Commit

Permalink
Merge pull request #21 from noaa-ocs-modeling/develop
Browse files Browse the repository at this point in the history
extract jobid from output string and use in job submission dependencies
  • Loading branch information
zacharyburnett committed Feb 17, 2021
2 parents a893e93 + 4e89e2f commit 74f9a67
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
13 changes: 9 additions & 4 deletions coupledmodeldriver/job_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,12 @@ def __str__(self) -> str:
]

if self.platform != Platform.LOCAL:
lines.append('squeue -u $USER -o "%.8A %.4C %.10m %.20E"')
# slurm queue output https://slurm.schedmd.com/squeue.html
squeue_command = 'squeue -u $USER -o "%.8F %.21j %.4C %.4D %.31E %.7a %.9P %.20V %.20S %.20e"'
lines.extend([
f'echo {squeue_command}',
squeue_command,
])

return '\n'.join(lines)

Expand All @@ -428,8 +433,8 @@ def coldstart(self) -> str:
if self.platform != Platform.LOCAL:
lines.extend(
[
'coldstart_adcprep_jobid=$(sbatch adcprep.job)',
'coldstart_jobid=$(sbatch --dependency=afterany:$coldstart_adcprep_jobid nems_adcirc.job)',
"coldstart_adcprep_jobid=$(sbatch adcprep.job | awk '{print $NF}')",
"coldstart_jobid=$(sbatch --dependency=afterany:$coldstart_adcprep_jobid nems_adcirc.job | awk '{print $NF}')",
]
)
else:
Expand All @@ -447,7 +452,7 @@ def hotstart(self) -> str:
if self.platform != Platform.LOCAL:
lines.extend(
[
'hotstart_adcprep_jobid=$(sbatch --dependency=afterany:$coldstart_jobid adcprep.job)',
"hotstart_adcprep_jobid=$(sbatch --dependency=afterany:$coldstart_jobid adcprep.job | awk '{print $NF}')",
'sbatch --dependency=afterany:$hotstart_adcprep_jobid nems_adcirc.job',
]
)
Expand Down
2 changes: 1 addition & 1 deletion examples/hera/hera_hsofs_irma.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
OUTPUT_DIRECTORY = (Path(__file__).parent / '../data') / 'configuration' / 'hera_hsofs_irma'

if __name__ == '__main__':
runs = {f'nems_hsofs_test': (None, None)}
runs = {f'test_case_1': (None, None)}

# init tidal forcing and setup requests
tidal_forcing = Tides()
Expand Down
2 changes: 1 addition & 1 deletion examples/hera/hera_hsofs_sandy.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
OUTPUT_DIRECTORY = (Path(__file__).parent / '../data') / 'configuration' / 'hera_hsofs_sandy'

if __name__ == '__main__':
runs = {f'nems_hsofs_test': (None, None)}
runs = {f'test_case_1': (None, None)}

# init tidal forcing and setup requests
tidal_forcing = Tides()
Expand Down
2 changes: 1 addition & 1 deletion examples/local/local_hsofs_irma.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
OUTPUT_DIRECTORY = (Path(__file__).parent / '../data') / 'configuration' / 'local_hsofs_irma'

if __name__ == '__main__':
runs = {f'nems_hsofs_test': (None, None)}
runs = {f'test_case_1': (None, None)}

# init tidal forcing and setup requests
tidal_forcing = Tides()
Expand Down
2 changes: 1 addition & 1 deletion examples/local/local_hsofs_sandy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
OUTPUT_DIRECTORY = (Path(__file__).parent / '../data') / 'configuration' / 'local_hsofs_sandy'

if __name__ == '__main__':
runs = {f'nems_hsofs_test': (None, None)}
runs = {f'test_case_1': (None, None)}

# init tidal forcing and setup requests
tidal_forcing = Tides()
Expand Down
2 changes: 1 addition & 1 deletion examples/stampede2/stampede2_hsofs_sandy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)

if __name__ == '__main__':
runs = {f'nems_hsofs_test': (None, None)}
runs = {f'test_case_1': (None, None)}

# init tidal forcing and setup requests
tidal_forcing = Tides()
Expand Down

0 comments on commit 74f9a67

Please sign in to comment.