Skip to main content

Simplify IPython cluster start up and use for multiple schedulers.

Project description

https://travis-ci.org/roryk/ipython-cluster-helper.svg https://zenodo.org/badge/3658/roryk/ipython-cluster-helper.svg

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

Example

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:]:
        long_running_function(f)

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:
        view.map(long_running_function, 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:
    view.map(long_running_function, 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”).

Credits

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

Contributors

  • 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.2.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

ipython_cluster_helper-0.6.2-py2.py3-none-any.whl (18.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ipython-cluster-helper-0.6.2.tar.gz.

File metadata

File hashes

Hashes for ipython-cluster-helper-0.6.2.tar.gz
Algorithm Hash digest
SHA256 b474a55cd098269c5996db90c9ce06bc22a73334f7eff86875098f1b3c4e17ac
MD5 1a8276e1ca2b91b0dc3d3fd40ddf4edb
BLAKE2b-256 4b054b1285d303f5b88d6f7ff71cc877418810512330960042cd0a041aac300a

See more details on using hashes here.

File details

Details for the file ipython_cluster_helper-0.6.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ipython_cluster_helper-0.6.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 88fa44103bed76e7e8e48e6bf5e73e9a24309ce316487a45be4e661d27a98220
MD5 d173d899ad7a78f05923023629168619
BLAKE2b-256 d9dec5321443ee07471648c4384218c26e532bb81ffff95627efffdf9be45b36

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page