From 50979965a675778d7db58c6745a91ce7a81a3d1d Mon Sep 17 00:00:00 2001 From: roryk Date: Mon, 25 Jan 2016 13:50:34 -0500 Subject: [PATCH] Add preliminary support for UGE (an open source fork of SGE) SGE's parallel environment specification is space-delimited and UGE is comma delimited. This handles fix handles both. Other than that it seems to work fine. Thanks to Andrew Oler for spotting this issue, figuring out what wrong, suggesting the fix and testing the fix. --- cluster_helper/cluster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster_helper/cluster.py b/cluster_helper/cluster.py index 61a89f7..c203512 100644 --- a/cluster_helper/cluster.py +++ b/cluster_helper/cluster.py @@ -16,6 +16,7 @@ import shutil import subprocess import time +import re from distutils.version import LooseVersion import sys @@ -402,8 +403,7 @@ def _queue_can_access_pe(pe_name, queue): queue_config = _parseSGEConf(subprocess.check_output(["qconf", "-sq", queue])) except: return False - for test_pe_name in queue_config["pe_list"].split(): - test_pe_name = test_pe_name.split(",")[0].strip() + for test_pe_name in re.split('\W+|,', queue_config["pe_list"]): if test_pe_name == pe_name: return True return False