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.

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.

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”) and SLURM (“slurm”).

More to come?

Credits

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

Contributors

  • Brad Chapman (@bchapman)

  • @mariogiov

  • Valentine Svensson (@vals)

  • Roman Valls (@brainstorm)

  • Rory Kirchner (@roryk)

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for ipython-cluster-helper-0.1.14.tar.gz
Algorithm Hash digest
SHA256 0c94ba7b70c864fce5929ec9821ad1f6ebc4e0156357db3e0f5e76bcd981f1c6
MD5 72b05ec06ff344ceb02d5ed27f00a78c
BLAKE2b-256 1845e009e625dce631c79809a3a90df334ed1b7490c30239e16279c1ae81b487

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