##// 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
task1.ipynb
139 lines | 2.5 KiB | text/plain | TextLexer
Brian E. Granger
Converting notebooks to JSON format.
r4634 {
Brian Granger
Updating example notebooks to v3 format.
r6035 "metadata": {
"name": "task1"
},
"nbformat": 3,
MinRK
rebuild example notebooks...
r7739 "nbformat_minor": 0,
Brian Granger
Updating example notebooks to v3 format.
r6035 "worksheets": [
{
"cells": [
{
"cell_type": "markdown",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "source": [
"# Simple task farming example"
]
},
{
"cell_type": "code",
"collapsed": true,
"input": [
"from IPython.parallel import Client"
],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [],
MinRK
rebuild example notebooks...
r7739 "prompt_number": 1
Brian Granger
Updating example notebooks to v3 format.
r6035 },
{
"cell_type": "markdown",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "source": [
"A `Client.load_balanced_view` is used to get the object used for working with load balanced tasks."
]
},
{
"cell_type": "code",
"collapsed": true,
"input": [
MinRK
rebuild example notebooks...
r7739 "rc = Client()\n",
Brian Granger
Updating example notebooks to v3 format.
r6035 "v = rc.load_balanced_view()"
],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [],
MinRK
rebuild example notebooks...
r7739 "prompt_number": 2
Brian Granger
Updating example notebooks to v3 format.
r6035 },
{
"cell_type": "markdown",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "source": [
"Set the variable `d` on all engines:"
]
},
{
"cell_type": "code",
"collapsed": true,
"input": [
"rc[:]['d'] = 30"
],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [],
MinRK
rebuild example notebooks...
r7739 "prompt_number": 3
Brian Granger
Updating example notebooks to v3 format.
r6035 },
{
"cell_type": "markdown",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "source": [
"Define a function that will be our task:"
]
},
{
"cell_type": "code",
"collapsed": true,
"input": [
MinRK
rebuild example notebooks...
r7739 "def task(a):\n",
Brian Granger
Updating example notebooks to v3 format.
r6035 " return a, 10*d, a*10*d"
],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [],
MinRK
rebuild example notebooks...
r7739 "prompt_number": 4
Brian Granger
Updating example notebooks to v3 format.
r6035 },
{
"cell_type": "markdown",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "source": [
"Run the task once:"
]
},
{
"cell_type": "code",
"collapsed": true,
"input": [
"ar = v.apply(task, 5)"
],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [],
MinRK
rebuild example notebooks...
r7739 "prompt_number": 5
Brian Granger
Updating example notebooks to v3 format.
r6035 },
{
"cell_type": "markdown",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "source": [
"Print the results:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print \"a, b, c: \", ar.get()"
],
"language": "python",
MinRK
rebuild example notebooks...
r7739 "metadata": {},
Brian Granger
Updating example notebooks to v3 format.
r6035 "outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
MinRK
rebuild example notebooks...
r7739 "a, b, c: [5, 300, 1500]\n"
Brian Granger
Updating example notebooks to v3 format.
r6035 ]
}
],
MinRK
rebuild example notebooks...
r7739 "prompt_number": 6
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
Brian Granger
Updating example notebooks to v3 format.
r6035 }
MinRK
rebuild example notebooks...
r7739 ],
"metadata": {}
Brian Granger
Updating example notebooks to v3 format.
r6035 }
]
Brian E. Granger
Converting notebooks to JSON format.
r4634 }