Skip to main content

Many independent tasks

Many tasks that need nothing from each other, run as many at a time as there are cores: on one node with GNU parallel or a pool of processes in Python, and over many nodes with job arrays, mpi4py.futures and DragonHPC.

This section is about the most common kind of parallel: many tasks that need nothing from each other, such as the same analysis on many input files, or a simulation over many parameters. It starts with which way to run them, and then goes through each, first on one node, then over many.

Title Description
Which way to run many tasks? Many independent tasks, each its own process, and the ways to run them side by side: GNU parallel and a pool of processes in Python on one node, a job array, mpi4py.futures and DragonHPC over many; what the tasks can be, what each needs, how a failed task shows and is rerun, the load on the scheduler, and which to reach for first.
GNU parallel Running many independent tasks at once inside one job with GNU parallel: a task list, a job log and resuming what failed, and its citation notice.
A pool of processes in Python Running many Python tasks at once inside one job, on a pool of processes with concurrent.futures, and what it takes for an exception in a task to reach your script.
Job arrays Many independent tasks beyond one node, as a Slurm job array: –array, throttling with %, the task ID and the output names, a reduce job that waits with –dependency=afterok, the load arrays put on the scheduler, and an array whose every task runs GNU parallel on a whole node.
Python tasks over many nodes with mpi4py.futures A pool of worker processes that spans the nodes of a job, from one Python script: MPIPoolExecutor launched with srun python -m mpi4py.futures, rank 0 as the controller and every other rank a worker, how to size –ntasks for it, and what happens when a task fails.
DragonHPC: multiprocessing over many nodes DragonHPC, a runtime that makes Python’s multiprocessing span every node of a job: Monte Carlo π on a Pool over 2 nodes, installing it, how it launches under Slurm, threads in each worker, a distributed dictionary for big results, and its limits: Python 3.11 to 3.13, PyPI only, and a fast transport that is not open source.
No matching items