Skip to content

Commit 17efe10

Browse files
Adding PBSSpawner
1 parent c320f05 commit 17efe10

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

batchspawner/batchspawner.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,28 @@ class MoabSpawner(TorqueSpawner):
483483
state_running_re = Unicode(r'State="Running"').tag(config=True)
484484
state_exechost_re = Unicode(r'AllocNodeList="([^\r\n\t\f :"]*)').tag(config=True)
485485

486+
class PBSSpawner(TorqueSpawner):
487+
batch_script = Unicode("""#!/bin/sh
488+
{% if queue or host %}#PBS -q {% if queue %}{{queue}}{% endif %}\
489+
{% if host %}@{{host}}{% endif %}{% endif %}
490+
#PBS -l walltime={{runtime}}
491+
#PBS -l select=1:ncpus={{nprocs}}:mem={{memory}}
492+
#PBS -N jupyterhub-singleuser
493+
#PBS -v {{keepvars}}
494+
{% if options %}#PBS {{options}}{% endif %}
495+
496+
{{prologue}}
497+
{{cmd}}
498+
{{epilogue}}
499+
""").tag(config=True)
500+
501+
# outputs job data XML string
502+
batch_query_cmd = Unicode('qstat -fx {job_id}').tag(config=True)
503+
504+
state_pending_re = Unicode(r'job_state = [QH]').tag(config=True)
505+
state_running_re = Unicode(r'job_state = R').tag(config=True)
506+
state_exechost_re = Unicode(r'exec_host = ([\w_-]+)/').tag(config=True)
507+
486508
class UserEnvMixin:
487509
"""Mixin class that computes values for USER, SHELL and HOME in the environment passed to
488510
the job submission subprocess in case the batch system needs these for the batch script."""

0 commit comments

Comments
 (0)