Create a gist now

Instantly share code, notes, and snippets.

@Phhere /move_job_hook.py Secret
Created May 29, 2017

What would you like to do?
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