Skip to content

Instantly share code, notes, and snippets.

@Phhere
Created May 29, 2017 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Phhere/1451349967e2272b4c338012e5508200 to your computer and use it in GitHub Desktop.
Save Phhere/1451349967e2272b4c338012e5508200 to your computer and use it in GitHub Desktop.
Job Move Hook
import pbs
import sys
try:
event = pbs.event()
if (event.type is pbs.QUEUEJOB):
if hasattr(event, 'job'):
job = event.job
chunks = parse_select(job.Resource_List)
if not chunks['arch']:
if chunks['max_ncpus'] > 24 or chunks['max_mem'] > 112096796672:
chunks['arch'] = 'uv2000'
if chunks['arch'] == 'uv2000':
q_uv2000 = pbs.server().queue('UV2000')
job.queue = q_uv2000
event.accept()
except SystemExit:
# The e.accept() and e.reject() methods generate a SystemExit
# exception.
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment