Skip to content

Commit 3b8d838

Browse files
committed
Added pipes.quote for batch system lauchers. Fixes bug where LSF would not launch engines or controller.
1 parent 0369b78 commit 3b8d838

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

IPython/parallel/apps/launcher.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import copy
2323
import logging
2424
import os
25+
import pipes
2526
import stat
2627
import sys
2728
import time
@@ -1141,7 +1142,7 @@ class PBSControllerLauncher(PBSLauncher, BatchClusterAppMixin):
11411142
#PBS -V
11421143
#PBS -N ipcontroller
11431144
%s --log-to-file --profile-dir="{profile_dir}" --cluster-id="{cluster_id}"
1144-
"""%(' '.join(ipcontroller_cmd_argv)))
1145+
"""%(' '.join(map(pipes.quote, ipcontroller_cmd_argv))))
11451146

11461147

11471148
def start(self):
@@ -1157,7 +1158,7 @@ class PBSEngineSetLauncher(PBSLauncher, BatchClusterAppMixin):
11571158
#PBS -V
11581159
#PBS -N ipengine
11591160
%s --profile-dir="{profile_dir}" --cluster-id="{cluster_id}"
1160-
"""%(' '.join(ipengine_cmd_argv)))
1161+
"""%(' '.join(map(pipes.quote,ipengine_cmd_argv))))
11611162

11621163
def start(self, n):
11631164
"""Start n engines by profile or profile_dir."""
@@ -1181,7 +1182,7 @@ class SGEControllerLauncher(SGELauncher, BatchClusterAppMixin):
11811182
#$ -S /bin/sh
11821183
#$ -N ipcontroller
11831184
%s --log-to-file --profile-dir="{profile_dir}" --cluster-id="{cluster_id}"
1184-
"""%(' '.join(ipcontroller_cmd_argv)))
1185+
"""%(' '.join(map(pipes.quote, ipcontroller_cmd_argv))))
11851186

11861187
def start(self):
11871188
"""Start the controller by profile or profile_dir."""
@@ -1195,7 +1196,7 @@ class SGEEngineSetLauncher(SGELauncher, BatchClusterAppMixin):
11951196
#$ -S /bin/sh
11961197
#$ -N ipengine
11971198
%s --profile-dir="{profile_dir}" --cluster-id="{cluster_id}"
1198-
"""%(' '.join(ipengine_cmd_argv)))
1199+
"""%(' '.join(map(pipes.quote, ipengine_cmd_argv))))
11991200

12001201
def start(self, n):
12011202
"""Start n engines by profile or profile_dir."""
@@ -1249,7 +1250,7 @@ class LSFControllerLauncher(LSFLauncher, BatchClusterAppMixin):
12491250
#BSUB -oo ipcontroller.o.%%J
12501251
#BSUB -eo ipcontroller.e.%%J
12511252
%s --log-to-file --profile-dir="{profile_dir}" --cluster-id="{cluster_id}"
1252-
"""%(' '.join(ipcontroller_cmd_argv)))
1253+
"""%(' '.join(map(pipes.quote,ipcontroller_cmd_argv))))
12531254

12541255
def start(self):
12551256
"""Start the controller by profile or profile_dir."""
@@ -1264,7 +1265,7 @@ class LSFEngineSetLauncher(LSFLauncher, BatchClusterAppMixin):
12641265
#BSUB -oo ipengine.o.%%J
12651266
#BSUB -eo ipengine.e.%%J
12661267
%s --profile-dir="{profile_dir}" --cluster-id="{cluster_id}"
1267-
"""%(' '.join(ipengine_cmd_argv)))
1268+
"""%(' '.join(map(pipes.quote, ipengine_cmd_argv))))
12681269

12691270
def start(self, n):
12701271
"""Start n engines by profile or profile_dir."""

0 commit comments

Comments
 (0)