The purpose of this project is to demonstrate different ways to parallelize a simple tasks that require no communication between the parallel processes, i.e. embarrassingly parallel tasks.
The slurm directory contains a simple example of how to submit a job to a SLURM managed cluster to perform an embarrassingly parallel task.
slurm/job_array.sbatchis a SLURM script that submits a job array to the cluster to parallelize tasks.slurm/two_process_example.sbatchis a SLURM script that submits a singular job to the cluster to parallelize tasks using two cores. This file also allows for one task to be started first.
The python directory contains a simple example of how to parallelize a task using the multiprocessing and mpi4py modules in Python, and does not require a SLURM managed cluster.
python/examples.pyis a Python script shows how the below two files can be used to parallelize code.python/parmap.pyis a Python script that demonstrates how to parallelize a task using themultiprocessingmodule, and has aparmapfunction that is similar to themapfunction in Python which can be easily imported into other codes. This script is designed to be run on a single node or a local environment.python/mpimap.pyis a Python script that demonstrates how to parallelize a task using thempi4pymodule. This script is designed to be run using thempiruncommand (e.g.mpirun python examples.py), and can be used to parallelize a task across multiple nodes.