ipython

module (bold = default) build dependencies
ipython/3.0.0/b1 python3/3.4.0

Starting an ipython notebook on a single compute node inside of slurm

To start an ipython notebook on a compute node, run the following

module load ipython
srun -p debug -n 1 -t 60 --mem=2gb sh -c 'ipython notebook --ip=`hostname`.bluehive.circ.private --port=8080'

This should start a job on a compute node (say bhc0001)

You can then open up firefox inside of X2go and navigate to

ComputeNodeHere.bluehive.circ.private:8080

(where ComputeNodeHere is replaced with the actual compute node the job is running on, for instance bhc0001

Or you can open a tunnel from your workstation to bluehive by running

ssh -L 8080:ComputeNodeHere:8080 YourNetIDHere@bluehive.circ.rochester.edu

or setting up the tunnel in putty. You can then open your browser and point it to

http://localhost:8080

Starting a parallel compute engine connected to a ipython notebook

To run a ipython notebook that can connect to a parallel engine, you can use the following sample script

#!/bin/sh
#SBATCH -p debug
#SBATCH -J ipython
#SBATCH --ntasks-per-node=22
#SBATCH -N 2
#SBATCH --exclusive
#SBATCH --time=1:00:00
#SBATCH --mem-per-cpu=1g
module load ipython
ipcontroller --ip='*' --port=8081 --location=`hostname` &
sleep 10
srun ipengine --ip=`hostname` --port=8081 &
sleep 25
ipython notebook --ip=`hostname`.bluehive.circ.private --port=8080

Then you can connect to the python notebook server as before and execute parallel code.

from IPython.parallel import Client
c=Client()
c.ids

Running ipython notebooks in batch mode

If you want to execute an ipython notebook in batch mode, you can use runipy

runipy input.ipynb output.ipynb

instead of spawning the ipython notebook server.

And if you want to execute a python notebook and update the output in place, you can use

runipy -o MyNotebook.ipynb

also see Using Software.