Skip to content

Commit

Permalink
Added ability to call scripts etc within the submit file
Browse files Browse the repository at this point in the history
The user can set the following parameter within the job configuration
files

script = source this script, this, dont forget this 1

and the following will appear in the submit file

source this script
this
dont forget this 1
  • Loading branch information
jimboid committed Sep 19, 2016
1 parent 4ae37e0 commit 2a40507
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions Longbow/corelibs/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"modules": "",
"maxtime": "24:00",
"memory": "",
"scripts": "",
"sge-peflag": "mpi",
"sge-peoverride": "false",
"port": "22",
Expand Down
11 changes: 11 additions & 0 deletions Longbow/plugins/schedulers/lsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ def prepare(job):

jobfile.write("#BSUB -n " + job["cores"] + "\n")

# Load any custom scripts.
if job["scripts"] != "":

scripts = job["scripts"].split(',')

if len(scripts) > 1:

for item in scripts:

jobfile.write(item.strip() + "\n\n")

if job["modules"] is not "":

for module in job["modules"].split(","):
Expand Down
11 changes: 11 additions & 0 deletions Longbow/plugins/schedulers/pbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@ def prepare(job):
"cd $PBS_O_WORKDIR\n"
"export OMP_NUM_THREADS=1\n\n")

# Load any custom scripts.
if job["scripts"] != "":

scripts = job["scripts"].split(',')

if len(scripts) > 1:

for item in scripts:

jobfile.write(item.strip() + "\n\n")

# Load up modules if required.
if job["modules"] is not "":

Expand Down
12 changes: 12 additions & 0 deletions Longbow/plugins/schedulers/sge.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ def prepare(job):
jobfile.write("#$ -pe " + job["sge-peflag"] + " " +
job["cores"] + "\n\n")

# Load any custom scripts.
if job["scripts"] != "":

scripts = job["scripts"].split(',')

if len(scripts) > 1:

for item in scripts:

jobfile.write(item.strip() + "\n\n")

# Add in module to be loaded.
if job["modules"] is not "":

for module in job["modules"].split(","):
Expand Down
11 changes: 11 additions & 0 deletions Longbow/plugins/schedulers/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ def prepare(job):
# Walltime for job
jobfile.write("#SBATCH -t " + job["maxtime"] + ":00\n\n")

# Load any custom scripts.
if job["scripts"] != "":

scripts = job["scripts"].split(',')

if len(scripts) > 1:

for item in scripts:

jobfile.write(item.strip() + "\n\n")

# Load up modules if required.
if job["modules"] is not "":

Expand Down
11 changes: 11 additions & 0 deletions Longbow/plugins/schedulers/soge.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ def prepare(job):

jobfile.write("#$ -pe ib " + cores + "\n\n")

# Load any custom scripts.
if job["scripts"] != "":

scripts = job["scripts"].split(',')

if len(scripts) > 1:

for item in scripts:

jobfile.write(item.strip() + "\n\n")

if job["modules"] is not "":

for module in job["modules"].split(","):
Expand Down

0 comments on commit 2a40507

Please sign in to comment.