Python utility for easy multiprocessing + logging.
Project description
EasyMP
Easy multiprocessing and logging (SimpleMP) provides a solution for the two problems:
- Logging while using python multiprocessing.
- Stopping spawned processes using CTRL+C.
Install
pip install easymp
Example
from easymp import parallel, addlogging, execute
@addlogging
def square(x):
logger.info("Square: %d" % x)
return x * x
@addlogging
@parallel
def process(x):
y = square(x)
logger.info("Input %d, output %d." % (x, y))
return True
if __name__ == "__main__":
execute(process, it=range(20), nprocs=3)
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
easymp-0.1.8.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file easymp-0.1.8.tar.gz
.
File metadata
- Download URL: easymp-0.1.8.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d8c6ad992852faeaada22289057f271ddd4f4c70725ed47b461613305b23745 |
|
MD5 | cf46def4b23138c188db90cc8021f67a |
|
BLAKE2b-256 | 2f75be400b280d811597ada990e316760efd1106cea8a5ef7172a8ef54db9393 |
File details
Details for the file easymp-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: easymp-0.1.8-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8df95a9d47e182c93d82469ea7db81f636c27670ae1073ca7940db9dbb191933 |
|
MD5 | 5bab73ea8d5b88194883265a173b0116 |
|
BLAKE2b-256 | 0fea3d23f4692f0670abbe6da931f709b694a1bd67d2b111b9d168df3a94b20c |