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?
Problems pickling
If you are having problems pickling the pieces you want to parallelize (you will see errors complaining your item cannot be pickled), you might want to install the dill module: https://github.com/uqfoundation/dill. If dill is importable, ipython-cluster-helper will use the dill pickle method, which can pickle many items that the Python pickle cannot. This is currently not functional as dill has some issues pickling objects that IPython can pickle.
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)
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
File details
Details for the file ipython-cluster-helper-0.2.9.tar.gz
.
File metadata
- Download URL: ipython-cluster-helper-0.2.9.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05ee99abc30956875e6f936d856eed472b0b44dbaf2336775fd8fd3e894d97d0 |
|
MD5 | 19895e50cad37baf2ac7e847cc470262 |
|
BLAKE2b-256 | 74830a0a341b23bdec28e98fc2e7cc78aa9e0627f43bde8760ff5f7e636caf0c |