Skip to main content

Libpipe

Common pipeline framework and library

Installation

libpipe can be installed via pip:

$ pip install libpipe

and requires Python 3.10 or higher.

Worker pools on a Slurm cluster

A WorkerPool runs its tasks locally, on other hosts over SSH, or through Slurm with the host slurm: each task is then started with srun, as a job of its own when the pool runs on a login node, as a job step inside an allocation (salloc, sbatch).

pool = worker.WorkerPool(['slurm'], name='Imaging', max_tasks_per_worker=8,
                         slurm_options='-p regular --mem=200G --time=24:00:00')

max_tasks_per_worker is the number of jobs in flight. The srun options (partition, account, resources) come from slurm_options, or from the LIBPIPE_SLURM_OPTIONS environment variable; max_time becomes the job time limit when the options set none. Host constraints (run_on_host) do not apply: Slurm places the tasks, so the data must be on a file system shared with the compute nodes.

With slurm_nodes, a pool on a login node requests one allocation of up to that many nodes when its first task starts, runs each task as a job step in it (srun --jobid --exact), and releases it at the end, or after 10 minutes without step. slurm_nodes='2-10' starts it as soon as 2 nodes are free, with up to 10 of them, as many as free at that moment. Slurm packs the steps on the nodes from their CPUs and memory, given by the category of the task; a step starts when the allocation has its CPUs free, so that no srun waits polling the controller:

pool = worker.WorkerPool(['slurm'], name='Cubes', slurm_nodes=4,
                         resources={'heavy': {'cpus': 12, 'mem': '40GB'}})
pool.add('pstool gen_vis_cube ...', category='small', label='gen_vis_cube')

The categories (DEFAULT_RESOURCES) are small (1 CPU, 2 GB), medium (4, 8 GB), high_mem (2, 16 GB), cpu (12, 8 GB) and heavy (12, 40 GB, the default), the others capped at heavy; a step also gets the matching OMP_NUM_THREADS. The options apply to the jobs and the allocation, not to the steps. Inside an allocation started by hand, the tasks are job steps with these resources as well.

Slurm does not necessarily limit the memory of a job step: the memory of a category must stay above the peak memory of its tasks. The local and Slurm pools measure each task (wall time, CPU time, peak RSS, in its log file), and WorkerPoolReport.usage_lines() summarises them per task type (label).

Metadata

Release files for libpipe 0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libpipe 0.12
File Size Uploaded Provenance Actions
libpipe-0.12.tar.gz 37.1 kB Without provenance Details for libpipe-0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for libpipe 0.12
File Interpreter ABI Platform Actions
libpipe-0.12-py3-none-any.whl Python 3 none any Details for libpipe-0.12-py3-none-any.whl

Total release size: 76.5 kB

Release files / libpipe-0.12.tar.gz

Download URL libpipe-0.12.tar.gz
Size 37.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ca10d77173fef78f4ac9df4dc9fc9020b34ab757e9b0e63860fcc58aac4f2216
BLAKE2b-256 checksum
How to use checksums
da2604d3b81440fa76d90bc423771695a38ebbbcede26b7492618ff41b540204
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.4 Linux/7.3.0-10-generic

Release files / libpipe-0.12-py3-none-any.whl

Download URL libpipe-0.12-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a146381559835fccdc97a4383d433c14a1dc89f37a183aefe3e9a69cb5770d29
BLAKE2b-256 checksum
How to use checksums
2a85e3539a392fa747ed3577315ffa13c604b6d33fee4bdf497f8801c94e9a2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.14.4 Linux/7.3.0-10-generic

Security for libpipe 0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page