##// END OF EJS Templates
Backport PR #2126: ipcluster broken with any batch (PBS/LSF/SGE)...
Backport PR #2126: ipcluster broken with any batch (PBS/LSF/SGE) I have setup ipcluster_config.py to start with LSF: ``` c.IPClusterStart.controller_launcher_class = 'LSF' c.IPClusterStart.engine_launcher_class = 'LSF' ``` But the ipcluster command fails to start the engines: ``` ipcluster start --profile=lsf -n 10 ``` The problem is fixed if I add quotes to the launch command string ```cmd``` in ```launcher.py```. ``` diff --git a/IPython/parallel/apps/launcher.py b/IPython/parallel/apps/launcher.py index e752d2a..6035303 100644 --- a/IPython/parallel/apps/launcher.py +++ b/IPython/parallel/apps/launcher.py @@ -73,7 +73,7 @@ WINDOWS = os.name == 'nt' # Paths to the kernel apps #----------------------------------------------------------------------------- -cmd = "from IPython.parallel.apps.%s import launch_new_instance; launch_new_instance()" +cmd = "\"from IPython.parallel.apps.%s import launch_new_instance; launch_new_instance()\"" ipcluster_cmd_argv = [sys.executable, "-c", cmd % "ipclusterapp"] ```

File last commit:

r7739:dff285da
r7995:061632b4
Show More
taskmap.ipynb
124 lines | 2.9 KiB | text/plain | TextLexer

Load balanced map and parallel function decorator

In [1]:
from IPython.parallel import Client
In [2]:
rc = Client()
v = rc.load_balanced_view()
In [3]:
result = v.map(lambda x: 2*x, range(10))
print "Simple, default map: ", list(result)
Simple, default map:  
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
In [4]:
ar = v.map_async(lambda x: 2*x, range(10))
print "Submitted tasks, got ids: ", ar.msg_ids
result = ar.get()
print "Using a mapper: ", result
Submitted tasks, got ids:  ['d482fcb3-f8e9-41ff-ba16-9fd4118324f1', 'e4fe38dd-8a4d-4f3a-a111-e4c9fdbea7c3', '580431f4-ac66-4517-b03e-a58aa690a87b', '19a012cf-5d9d-4cf3-9656-d56263958c0e', '012ebbb5-5def-47ad-a247-20f88d2c8980', '0dea6cdb-5b22-4bac-a1bb-7544c0ef44e6', '909d073f-7eee-42a7-8f3b-8f7aa32e7639', 'be6c7466-d541-47a0-b12d-bc408d40ad77', 'b97b5967-a5a3-45c5-95cc-44e0823fd646', '69b06902-9526-42d9-bda6-c943be19cc5a']
Using a mapper:  [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
In [5]:
@v.parallel(block=True)
def f(x): return 2*x

result = f.map(range(10))
print "Using a parallel function: ", result
Using a parallel function:  [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
In [ ]: