Commit 3ed45347 authored by David Trudgian's avatar David Trudgian
Browse files

Add gres option for GPU resources etc

parent df5cc3fa
......@@ -138,6 +138,10 @@ summary:
# Cluster partition to use
partition: 256GB
# Generic Resource (e.g. GPU request)
# OPTIONAL: Request a SLURM generic resource like a GPU
# gres: 'gpu:1'
# Total number of nodes to use
nodes: 4
......
......@@ -86,7 +86,11 @@ def main():
partition = str(p.vals['partition'])
time_limit = str(p.vals['time_limit'])
sbatch_cmd = [ 'sbatch', '-N', nodes, '-p', partition, '-t', time_limit, '-oparam_runner_%j.out' ]
if 'gres' in p.vals:
gres = str(p.vals['gres'])
sbatch_cmd = [ 'sbatch', '-N', nodes, '-p', partition, '-t', time_limit, '--gres', gres, '-oparam_runner_%j.out' ]
else:
sbatch_cmd = [ 'sbatch', '-N', nodes, '-p', partition, '-t', time_limit, '-oparam_runner_%j.out' ]
batch_script = "#!/bin/bash\n"
batch_script += python_exe
......
......@@ -17,10 +17,17 @@
"partition":{
"type":"string",
"minLength":1,
"title":"SLURM partitionb",
"title":"SLURM partition",
"description":"SLURM partition (queue) to which the batch job will be submitted.",
"name":"partition"
},
"gres":{
"type":"string",
"minLength":1,
"title":"SLURM gres",
"description":"SLURM generic resources specification (e.g. to request GPU).",
"name":"gres"
},
"nodes":{
"type":"integer",
"minLength":1,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment