Skip to content

Commit

Permalink
update example batch script to run with slurm for Theia
Browse files Browse the repository at this point in the history
  • Loading branch information
grantfirl committed May 29, 2019
1 parent 6ea8677 commit 8adb1a7
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions scm/etc/gmtb_scm_run.py → scm/etc/gmtb_scm_slurm_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,34 @@
from subprocess import Popen, PIPE
import time

proc = Popen('qsub', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
proc = Popen('sbatch', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)

### User-editable section -- See https://theiadocs.rdhpcs.noaa.gov/wikis/theiadocs/doku.php?id=running_and_monitoring_jobs for appropriate values ###
job_name = "test_job"
account = "gmtb"
walltime = "0:20:00"
processors = "procs=1"
walltime = "20"
processors = "1"
queue = "batch"
command = "./gmtb_scm twpice"
command = "./run_gmtb_scm.py -c twpice"
email_addr = "Grant.Firl@noaa.gov"
email_occasion = "abe"
email_occasion = "BEGIN,END,FAIL"
serial_mem = "512M"
working_dir = "../bin"
### End User-editable section ###


job_string = """#!/bin/bash
#PBS -N %s
#PBS -A %s
#PBS -l walltime=%s
#PBS -l %s
#PBS -o ./%s.out
#PBS -e ./%s.err
#PBS -q %s
#PBS -M %s
#PBS -m %s
#PBS -l vmem=%s
#PBS -d %s
#PBS -V
#SBATCH -J %s
#SBATCH -A %s
#SBATCH --time=%s
#SBATCH -n %s
#SBATCH -o ./%s.out
#SBATCH -e ./%s.err
#SBATCH -q %s
#SBATCH --mail-user=%s
#SBATCH --mail-type=%s
#SBATCH --mem=%s
#SBATCH -D%s
%s""" % (job_name, account, walltime, processors, job_name, job_name, queue, email_addr, email_occasion, serial_mem, working_dir, command)

# Send job_string to qsub
Expand Down

0 comments on commit 8adb1a7

Please sign in to comment.