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

  • Optionally uses dill as serialization backend through multiprocess, enabling parallelizing more exotic functions and objects

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpire-2.1.0-py3-none-any.whl (277.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mpire-2.1.0.tar.gz
  • Upload date:
  • Size: 269.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for mpire-2.1.0.tar.gz
Algorithm Hash digest
SHA256 9798df35d58c40936f207defdf4d6d1d3e9c579202130af5f149acf3ae9047b6
MD5 e51bb4d664a38d51a6053ae7c0ce71ad
BLAKE2b-256 0c05e5cafb2f4ff1621b0abf8706e086fda7702c0328a115b843a4bd304b350e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mpire-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 277.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for mpire-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 500a5da27b31a7dbc2ba3b5fdfc4f583192ba2a49c4ec4540fce57e9ad667d71
MD5 f482f7a3f7eee952bdc2c3a849a8da2c
BLAKE2b-256 c4c63533d4291a7783cdcdd498b0f66ec9e62cb850436d5b9029cac68bd64fc1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page