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)
Metadata
Release files for ipython-cluster-helper 0.6.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ipython-cluster-helper-0.6.4.tar.gz | 22.8 kB | Without provenance | Details for ipython-cluster-helper-0.6.4.tar.gz |
Release files / ipython-cluster-helper-0.6.4.tar.gz
| Download URL | ipython-cluster-helper-0.6.4.tar.gz |
|---|---|
| Size | 22.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
322b32c7252498ffb48eae2f81617a501dc8a273d84ceeb8daebf6493ba7d5d0
|
|
BLAKE2b-256 checksum How to use checksums |
5a589a63fa4168eb27801317dba2ccbe578da8e93f3b44e2b2c4fc59b4b3a9d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
|
Security for ipython-cluster-helper 0.6.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.