Skip to main content

Simplify IPython cluster start up and use for multiple schedulers.

Project description

Quickly and easily parallelize Python functions using IPython on a cluster, supporting multiple schedulers. Optimizes IPython defaults to handle larger clusters and simultaneous processes.


Lets say you wrote a program that takes several files in as arguments and performs some kind of long running computation on them. Your original implementation used a loop but it was way too slow

from yourmodule import long_running_function
import sys

if __name__ == "__main__":
    for f in sys.argv[1:]:

If you have access to one of the supported schedulers you can easily parallelize your program across 5 nodes with ipython-cluster-helper

from cluster_helper.cluster import cluster_view
from yourmodule import long_running_function
import sys

if __name__ == "__main__":
    with cluster_view(scheduler="lsf", queue="hsph", num_jobs=5) as view:, sys.argv[1:])

That’s it! No setup required.

To run a local cluster for testing purposes pass run_local as an extra parameter to the cluster_view function

with cluster_view(scheduler=None, queue=None, num_jobs=5,
                  extra_params={"run_local": True}) as view:, sys.argv[1:])

How it works

ipython-cluster-helper creates a throwaway parallel IPython profile, launches a cluster and returns a view. On program exit it shuts the cluster down and deletes the throwaway profile.

Supported schedulers

Platform LSF (“lsf”), Sun Grid Engine (“sge”), Torque (“torque”), SLURM (“slurm”).


The cool parts of this were ripped from bcbio-nextgen.


  • Brad Chapman (@chapmanb)
  • Mario Giovacchini (@mariogiov)
  • Valentine Svensson (@vals)
  • Roman Valls (@brainstorm)
  • Rory Kirchner (@roryk)
  • Luca Beltrame (@lbeltrame)
  • James Porter (@porterjamesj)
  • Billy Ziege (@billyziege)
  • ink1 (@ink1)
  • @mjdellwo
  • @matthias-k
  • Andrew Oler (@oleraj)
  • Alain Péteut (@peteut)
  • Matt De Both (@mdeboth)
  • Vlad Saveliev (@vladsaveliev)

Project details

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipython-cluster-helper-0.6.4.tar.gz (22.8 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page