Skip to main content

Parman extends Python concurrent.futures to facilitate parallel workflows

Project description

pytest PyPI Upload PyPI Version PyPI - Python Version LGPL-3 License

Parman

At this stage, Parman is an experimental project, so expect a rocky road ahead.

The goal of Parman is to extend concurrent.futures (and compatible implementations) with features that facilitate a transparent implementation of workflows.

  • WaitFuture: a Future subclass that is "finished" after its dependencies have finished. (To be created with WaitGraph.submit, which never blocks.)
  • ScheduledFuture: a Future subclass that submits a Future after its dependencies have finished. (To be created with Scheduler.submit, which never blocks.)
  • Various Runner classes, similar to Executors, which dispatch function calls elsewhere. The main differences with conventional executors being:
    • Closures are submitted for (remote) execution, which contain more metadata, e.g. about (keyword) arguments and return values, than ordinary functions The extra metadata offer several advantages...
    • A dry run can be carried out to quickly validate the connectivity of steps in the workflow before launching a full scale calculation.
    • Closure arguments may contain futures. If schedule=True is set, closures are scheduled for later execution when not all dependency futures have finished yet. (Dependencies are inferred from the arguments and keyword arguments.) Otherwise, the runner will block until all required futures have completed.
    • Closure return values are instantiated as much as possible, instead of just returning a single future. They may contain futures more deeply nested for parts of the return value, This makes it easier to submit more closures further down the workflow.

As a result, workflows can be implemented efficiently with relatively simple Python scripts, mostly hiding the interaction with Future objects.

Other useful features:

  • Compatible with Python's built-in Concurrent package and Parsl. (Parls is an optional dependency.)
  • Simplicity:
    • Template jobs, for a straightforward migration of existing job scripts.
    • Minimal Python package dependencies.
    • Minimal API.

Getting started

Install

python -m pip install parman

Examples

At this stage, there is no documentation as such. If you want to learn how to use Parman, check out the demos. If you want to understand the internals, read the source and the docstrings.

Non-goals

  • Support for Dask, because:
    1. The Dask Future does not subclass from concurrent.futures.Future. Supporting dask would imply a lot of extra boilerplate code in Parman.
    2. The Dask Future implements only a subset of concurrent.futures.Future.
    3. Dask Distributed has a large memory and time overhead.

Plans

  • Simplify usage.
  • Add more examples.
  • Tutorial.

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

Parman-0.4.0.tar.gz (76.0 kB view details)

Uploaded Source

Built Distribution

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

Parman-0.4.0-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

Details for the file Parman-0.4.0.tar.gz.

File metadata

  • Download URL: Parman-0.4.0.tar.gz
  • Upload date:
  • Size: 76.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for Parman-0.4.0.tar.gz
Algorithm Hash digest
SHA256 21da0241866d90bdd907f7742af596bd828d6e75c24c72c5d5937d63b134f2c1
MD5 4578973808feb52bdeef09b0e2bf7587
BLAKE2b-256 bda6fa67f8d7cdfcef24425ce18c7d45bbdd193eaece1e3ed385bd6fec690bec

See more details on using hashes here.

File details

Details for the file Parman-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: Parman-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 47.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for Parman-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ce8769c0acf67b7867add41c88041fc356d0cbbbe4023c62680efc8774831be
MD5 60d366f95b795f5359f705e5d6484a7c
BLAKE2b-256 252f15e20bbb5810365d9a02db3d16adac017b0ce3f07909a7f50788e6a8cd8c

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