Skip to content

Commit c405dfd

Browse files
committed
Added basic msub support
1 parent bf95ae3 commit c405dfd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

scripts/smart_dispatch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
LOGS_FOLDERNAME = "SMART_DISPATCH_LOGS"
2121
CLUSTER_NAME = utils.detect_cluster()
2222
AVAILABLE_QUEUES = get_available_queues(CLUSTER_NAME)
23+
LAUNCHER = utils.get_launcher(CLUSTER_NAME)
2324

2425

2526
def main():
@@ -85,7 +86,7 @@ def main():
8586
# Launch the jobs with QSUB
8687
if not args.doNotLaunch:
8788
for pbs_filename in pbs_filenames:
88-
qsub_output = check_output('qsub ' + pbs_filename, shell=True)
89+
qsub_output = check_output('{launcher} {pbs_filename}'.format(launcher=LAUNCHER, pbs_filename=pbs_filename), shell=True)
8990
print qsub_output,
9091

9192

smartdispatch/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def unhexify(match):
5353

5454
return re.sub(r"\\x..", unhexify, text)
5555

56+
5657
@contextmanager
5758
def open_with_lock(*args, **kwargs):
5859
""" Context manager for opening file with an exclusive lock. """
@@ -95,3 +96,10 @@ def detect_cluster():
9596
elif server_name.split('.')[-1] == 'helios':
9697
cluster_name = "helios"
9798
return cluster_name
99+
100+
101+
def get_launcher(cluster_name):
102+
if cluster_name == "helios":
103+
return "msub"
104+
else:
105+
return "qsub"

0 commit comments

Comments
 (0)