#!/bin/bash #PBS -N ipython_testjob #PBS -l walltime=0:02:00 #PBS -l nodes=2:ppn=4 #PBS -m bea -M behrmann@physik.fu-berlin.de ## set environment export PATH=/opt/python2.7/bin/:${PATH} export PYTHONPATH=/opt/python2.7/lib/python2.7/site-packages/ ## go to the directory the user typed 'qsub' in cd $PBS_O_WORKDIR ## start IPython cluster with eight engines using the mpi profile ## remember 8 (engines) = 2 (nodes) x 4 (processors) ipcluster start -n 8 --profile=mpi & ## the engines are ready after 30s, we will give them an ## extra 10s as grace period sleep 40 ## run the script you want to run ## python can be used instead of ipython, but in case of errors ## ipython offers more valuable tracebacks ipython ./test.py ## stop the IPython cluster again ipcluster stop --profile=mpi