-
-
Save Phhere/1451349967e2272b4c338012e5508200 to your computer and use it in GitHub Desktop.
Job Move Hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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