From dca559a64dc39cb4859d47ad8511bf4c0c3af7e1 Mon Sep 17 00:00:00 2001 From: "zachary.burnett" Date: Tue, 16 Feb 2021 14:40:43 -0500 Subject: [PATCH 1/5] extract jobID from string --- coupledmodeldriver/job_script.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coupledmodeldriver/job_script.py b/coupledmodeldriver/job_script.py index 2f8eb1a2..1a725c79 100644 --- a/coupledmodeldriver/job_script.py +++ b/coupledmodeldriver/job_script.py @@ -428,8 +428,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: @@ -447,7 +447,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', ] ) From 136f5d8d1f18335edf96286bb01117579c4b8239 Mon Sep 17 00:00:00 2001 From: "zachary.burnett" Date: Wed, 17 Feb 2021 13:12:18 -0500 Subject: [PATCH 2/5] run name --- examples/hera/hera_hsofs_irma.py | 2 +- examples/hera/hera_hsofs_sandy.py | 2 +- examples/local/local_hsofs_irma.py | 2 +- examples/local/local_hsofs_sandy.py | 2 +- examples/stampede2/stampede2_hsofs_sandy.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/hera/hera_hsofs_irma.py b/examples/hera/hera_hsofs_irma.py index 69aa0ecd..7680ca4f 100644 --- a/examples/hera/hera_hsofs_irma.py +++ b/examples/hera/hera_hsofs_irma.py @@ -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() diff --git a/examples/hera/hera_hsofs_sandy.py b/examples/hera/hera_hsofs_sandy.py index 41b3dee3..d7ff1778 100644 --- a/examples/hera/hera_hsofs_sandy.py +++ b/examples/hera/hera_hsofs_sandy.py @@ -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() diff --git a/examples/local/local_hsofs_irma.py b/examples/local/local_hsofs_irma.py index 84775375..1e1a26ec 100644 --- a/examples/local/local_hsofs_irma.py +++ b/examples/local/local_hsofs_irma.py @@ -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() diff --git a/examples/local/local_hsofs_sandy.py b/examples/local/local_hsofs_sandy.py index 00e6a5b7..ac7492ba 100644 --- a/examples/local/local_hsofs_sandy.py +++ b/examples/local/local_hsofs_sandy.py @@ -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() diff --git a/examples/stampede2/stampede2_hsofs_sandy.py b/examples/stampede2/stampede2_hsofs_sandy.py index 7bfa76e4..2e7544ec 100644 --- a/examples/stampede2/stampede2_hsofs_sandy.py +++ b/examples/stampede2/stampede2_hsofs_sandy.py @@ -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() From 6893de9ca9e391e3ab6024a281a79c3ebe0caac7 Mon Sep 17 00:00:00 2001 From: "zachary.burnett" Date: Wed, 17 Feb 2021 14:22:36 -0500 Subject: [PATCH 3/5] add columns to squeue output --- coupledmodeldriver/job_script.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coupledmodeldriver/job_script.py b/coupledmodeldriver/job_script.py index 1a725c79..e7d7085a 100644 --- a/coupledmodeldriver/job_script.py +++ b/coupledmodeldriver/job_script.py @@ -418,7 +418,8 @@ 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 + lines.append('squeue -u $USER -o "%.8A %.21j %.4C %.31E %.7a"') return '\n'.join(lines) From 223c2dd5d2f60f9fa7a813d61b546c66792991f3 Mon Sep 17 00:00:00 2001 From: "zachary.burnett" Date: Wed, 17 Feb 2021 14:41:41 -0500 Subject: [PATCH 4/5] add more columns to squeue output --- coupledmodeldriver/job_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coupledmodeldriver/job_script.py b/coupledmodeldriver/job_script.py index e7d7085a..f1b82a87 100644 --- a/coupledmodeldriver/job_script.py +++ b/coupledmodeldriver/job_script.py @@ -419,7 +419,7 @@ def __str__(self) -> str: if self.platform != Platform.LOCAL: # slurm queue output https://slurm.schedmd.com/squeue.html - lines.append('squeue -u $USER -o "%.8A %.21j %.4C %.31E %.7a"') + lines.append('squeue -u $USER -o "%.8F %.21j %.4C %.4D %.31E %.7a %.9P %.20V %.20S %.20e"') return '\n'.join(lines) From 4e89e2f106d15b48c6dc46fff8d54cc963367e9f Mon Sep 17 00:00:00 2001 From: "zachary.burnett" Date: Wed, 17 Feb 2021 15:56:00 -0500 Subject: [PATCH 5/5] echo command for ease of use --- coupledmodeldriver/job_script.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coupledmodeldriver/job_script.py b/coupledmodeldriver/job_script.py index f1b82a87..59916bce 100644 --- a/coupledmodeldriver/job_script.py +++ b/coupledmodeldriver/job_script.py @@ -419,7 +419,11 @@ def __str__(self) -> str: if self.platform != Platform.LOCAL: # slurm queue output https://slurm.schedmd.com/squeue.html - lines.append('squeue -u $USER -o "%.8F %.21j %.4C %.4D %.31E %.7a %.9P %.20V %.20S %.20e"') + 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)