Skip to content

Commit

Permalink
debugs and tests and prints.
Browse files Browse the repository at this point in the history
  • Loading branch information
ledm committed Nov 24, 2023
1 parent 70f7bee commit b8da78c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 10 additions & 2 deletions bgcval2/parrellel_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"""
import argparse
import subprocess
import os

from getpass import getuser

from bgcval2.analysis_compare import load_comparison_yml
Expand Down Expand Up @@ -81,17 +83,23 @@ def submits_lotus(compare_yml, config_user, dry_run=False):

for job in jobs:
suites = details['suites'][job]
print(suites)
if isinstance(suites, str):
suites = suites.split(' ')

if out.find(job) > -1:
print("That job exists already: skipping", job)
continue

command_txt = ['sbatch', '-J', job, 'lotus_timeseries.sh', job]
for suite in suites:
command_txt.append(suite)
print(' '.join(command_txt))
if dry_run:
print(' '.join(command_txt))
print('Not submitting (dry-run):', ' '.join(command_txt))
else:
# Submit job:
print('Submitting:', ' '.join(command_txt))
command1 = subprocess.Popen(command_txt)


Expand All @@ -112,7 +120,7 @@ def main():
if not os.path.isfile(compare_yml):
print(f"analysis_timeseries: Could not find comparison config file {compare_yml}")
sys.exit(1)
dry_run = compare_yml.dry_run
dry_run = args.dry_run
submits_lotus(compare_yml, config_user, dry_run)


Expand Down
8 changes: 3 additions & 5 deletions lotus_timeseries.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
#!/bin/bash
#SBATCH --job-name=bgcval2
#SBATCH --partition=short-serial
#SBATCH --time 6:00:00
#SBATCH -o logs/log_bgcval2_ts_%J.out
#SBATCH -e logs/log_bgcval3_ts_%J.err

# slurm job name should be set in the command line with -J option to the jobID

######################
# This script runs a single time series job.
#
# Runs:
# lotus_timeseries.sh jobID suite1 suite2 etc...
# sbatch -J jobID lotus_timeseries.sh jobID suite1 suite2 etc...
#
#########################



#########################
# Edit these bits:

# Change this to your bgcval2 conda environment name
CONDA_ENV=bgcval2

Expand Down

0 comments on commit b8da78c

Please sign in to comment.