Skip to main content

A Python package for easy multiprocessing, but faster than multiprocessing

Project description

Build status Docs status

MPIRE, short for MultiProcessing Is Really Easy, is a Python package for multiprocessing, but faster and more user-friendly than the default multiprocessing package. It combines the convenient map like functions of multiprocessing.Pool with the benefits of using copy-on-write shared objects of multiprocessing.Process, together with easy-to-use worker state, worker insights, and progress bar functionality.

Full documentation is available at https://slimmer-ai.github.io/mpire/.

Features

  • Multiprocessing with map/map_unordered/imap/imap_unordered functions

  • Easy use of copy-on-write shared objects with a pool of workers

  • Each worker can have its own state and with convenient worker init and exit functionality this state can be easily manipulated (e.g., to load a memory-intensive model only once for each worker without the need of sending it through a queue)

  • Progress bar support using tqdm

  • Progress dashboard support

  • Worker insights gives you insight in your multiprocessing efficiency

  • Graceful and user-friendly exception handling

  • Automatic task chunking for all available map functions to speed up processing of small task queues (including numpy arrays)

  • Adjustable maximum number of active tasks to avoid memory problems

  • Automatic restarting of workers after a specified number of tasks to reduce memory footprint

  • Nested pool of workers are allowed when setting the daemon option

  • Child processes can be pinned to specific or a range of CPUs

  • Uses dill as serialization backend through multiprocess, enabling parallelizing functions in iPython (notebooks)

Installation

Through pip (PyPi):

pip install mpire

From source:

python setup.py install

Documentation

If you want to build the documentation, please install the documentation dependencies by executing:

pip install mpire[docs]

or

pip install .[docs]

Documentation can then be build by executing:

python setup.py build_docs

Documentation can also be build from the docs folder directly. In that case MPIRE should be installed and available in your current working environment. Then execute:

make html

in the docs folder.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpire-2.0.0.tar.gz (261.0 kB view details)

Uploaded Source

Built Distribution

mpire-2.0.0-py3-none-any.whl (268.3 kB view details)

Uploaded Python 3

File details

Details for the file mpire-2.0.0.tar.gz.

File metadata

  • Download URL: mpire-2.0.0.tar.gz
  • Upload date:
  • Size: 261.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for mpire-2.0.0.tar.gz
Algorithm Hash digest
SHA256 aa846183210ca53f3ac435e113be3a714a19cfdf7251012a657ca1dfe66f9fb5
MD5 fdc788b2f177237e98ee34c9c8e74bac
BLAKE2b-256 ff8ae9d736e6a92bcb247e5f865e2bd972a782a0f980d6121c643ada5eed8d1f

See more details on using hashes here.

File details

Details for the file mpire-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: mpire-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 268.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for mpire-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae5172fb9bd8f537d3b677c5e6d03eadeae412336df27abe0b33d7c0e7808466
MD5 ed4c86b7c651906d10e78846e20691c6
BLAKE2b-256 feb69793ac6aa51b48ae95d987b70ae1822541cbdbd75447a9fb2f51dc29e3b4

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