ppft: Parallel Python Framework

1.7.8 · active · verified Sun Mar 29

ppft is a friendly fork of Parallel Python (pp), designed to provide distributed and parallel Python capabilities on Symmetric Multi-Processing (SMP) systems and clusters. It offers an easier installation process and enhanced serialization through the optional `dill` library. Currently at version 1.7.8, ppft maintains an active development and release cadence, with recent updates focused on Python 3 compatibility and dropping support for older Python versions.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a local `pp.Server`, submit a simple function for parallel execution, and collect the results. The server automatically manages worker processes.

import pp
import math

def my_function(a, b):
    return math.sqrt(a**2 + b**2)

# Create a job server
# The number of workers can be specified, e.g., pp.Server(4)
job_server = pp.Server()

# Submit jobs
jobs = []
for i in range(10):
    jobs.append(job_server.submit(my_function, (i, i+1), ())) # func, args, modules

# Retrieve results
results = [job() for job in jobs]
print(f"Calculated results: {results}")

# Destroy the job server
job_server.destroy()

view raw JSON →