parallel-python

Guide Python parallelism worker sizing for Slurm HPC workloads.

5|1|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/yale-som-hpc/claude-code-marketplace --skill parallel-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: parallel-python
Source: https://github.com/yale-som-hpc/claude-code-marketplace/tree/main/plugins/hpc/skills/parallel-python
Command: npx skills add https://github.com/yale-som-hpc/claude-code-marketplace --skill parallel-python

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you optimize Python parallelism in HPC workloads by selecting the right parallelism model and sizing workers to SLURM resources, preventing oversubscription and underutilization.

Core Features & Use Cases

  • Recommend the main parallelism layer (process pool, threads, Slurm arrays) based on workload.
  • Provide guidance on start methods for multiprocessing contexts and safe parallelism practices.
  • Advise on dynamic load balancing, Slurm arrays, and avoiding nested parallelism for stable performance.
  • Real-world scenario: CPU-bound workloads benefit from one main layer with appropriate BLAS threading controls.

Quick Start

Configure your job to run with one main parallelism layer and set SLURM_CPUS_PER_TASK to size workers, then run a small benchmark.

Frequently Asked Questions about parallel-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I size Python multiprocessing workers for a Slurm HPC workload?

Size Python multiprocessing workers by matching the process count directly to the SLURM_CPUS_PER_TASK environment variable. This prevents CPU oversubscription and underutilization on the HPC cluster.

When should I use Slurm arrays instead of Python multiprocessing for parallel tasks?

Use Slurm arrays instead of Python multiprocessing when your tasks are embarrassingly parallel. Slurm arrays handle independent workloads more efficiently by distributing jobs across the cluster natively.

What is the best way to manage BLAS threading with Python multiprocessing on HPC?

The best way to manage BLAS threading is maintaining a single main parallelism layer. Control BLAS thread counts explicitly to prevent nested parallelism from causing performance degradation and oversubscription.

How do I choose a multiprocessing start method for uneven Python workloads?

Choose a multiprocessing start method based on workload characteristics and apply dynamic load balancing to handle uneven tasks. This ensures stable performance and prevents workers from idling.

Can I mix threading and multiprocessing in a Python HPC job?

Mixing threading and multiprocessing is discouraged because it creates nested parallelism. You should select one main parallelism layer—either threads for I/O-bound tasks or processes for CPU-bound tasks—to maintain stable performance.

Does Python threading work for CPU-bound tasks on HPC clusters?

Python threading does not work well for CPU-bound tasks due to the Global Interpreter Lock. For CPU-bound workloads on HPC clusters, use multiprocessing or Slurm arrays to achieve true parallelism.