Skip to main content

Python utility for easy multiprocessing + logging.

Project description

EasyMP

Easy multiprocessing and logging (SimpleMP) provides a solution for the two problems:

  1. Logging while using python multiprocessing.
  2. 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


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 hashes)

Uploaded Source

Built Distribution

easymp-0.1.8-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

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