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.1.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

ipython_cluster_helper-0.6.1-py2.7.egg (42.9 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for ipython-cluster-helper-0.6.1.tar.gz
Algorithm Hash digest
SHA256 89d3684bb60a5660679e413b9e7fb99f20e9cf465ec1fd68b054708cf34be6b9
MD5 5144fae6fa4f990f26f570452e210df9
BLAKE2b-256 6331be8019fa00822f8924f10ee35987b429cc509d9e34158eac3e0af616704a

See more details on using hashes here.

File details

Details for the file ipython_cluster_helper-0.6.1-py2.7.egg.

File metadata

File hashes

Hashes for ipython_cluster_helper-0.6.1-py2.7.egg
Algorithm Hash digest
SHA256 3e84271dea44fdb483d49b23a2c0ad9d7edeb5e49d9dad381e34c8a711d6b0a2
MD5 b0268000b17c1f92ebda37c9f35dc77a
BLAKE2b-256 f9433bec77a47de7b1c99e96d0118b5a237d7191c03dd03f4d19aafef9338ade

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