Skip to main content

A Python package for easy multiprocessing, but faster than multiprocessing

Project description

Build status Docs status

MPIRE 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.

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 (e.g., to load a memory-intensive model only once for each worker without the need of sending it through a queue)

  • 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

  • Multiple process start methods available, including: fork (default), forkserver, spawn, and threading

  • Progress bar support using tqdm

  • Progress dashboard support

  • (Optional) dill support

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

Uploaded Source

Built Distribution

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

mpire-1.2.1-py3-none-any.whl (242.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mpire-1.2.1.tar.gz
  • Upload date:
  • Size: 237.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for mpire-1.2.1.tar.gz
Algorithm Hash digest
SHA256 83d906f1ebe042dea866319aafee21c545c2252aee516fb556a93dece105d012
MD5 a980f2d6c591b2b58355b383c2743f4d
BLAKE2b-256 75dbf9cc3b8d1c8c35c0c0a808d44046e87ca63d345b6c00093dead1d5df7860

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mpire-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 242.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for mpire-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5aad447c30f0116507cb2acc3b055f283d73900de12c20bdb8564ad814e5347
MD5 fe2ffcd2ce9b1e4e7777a368a7c632b2
BLAKE2b-256 3fa105fbd48de6d3b985d84af8a2ef4b24742e606d1865fb1be4c1e8a2a6ece4

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