Parallel Computing Fundamentals
Welcome
This workshop introduces you to parallel computing concepts and practical techniques for scaling your research computations from single-core to multi-core and multi-node environments. Whether you’re running parameter sweeps, processing large datasets, or solving computationally intensive problems, this material will help you understand when and how to parallelize your work.
What You’ll Learn
By the end of this workshop, you will:
- Understand the fundamental concepts of parallel computing and when parallelism helps your research
- Distinguish between different types of parallelism (embarrassingly parallel, shared-memory, and distributed-memory)
- Write and submit SLURM job arrays for parameter sweeps and batch processing
- Use shared-memory parallelism with Python and R on a single node
- Understand distributed computing concepts and when MPI is appropriate
- Choose the right parallelization strategy for your specific problem
Target Audience
This workshop is designed for researchers and students who:
- Currently run mostly single-core jobs
- Want to scale up their computations
- Have basic Linux command-line knowledge
- Are interested in practical, hands-on applications
No prior parallel computing experience is required.
Workshop Structure
This workshop consists of 12 episodes covering:
- Why Go Parallel?: Understanding speedup, efficiency, and when parallelism helps
- Types of Parallelism: Shared-memory vs distributed-memory vs embarrassingly parallel
- Embarrassingly Parallel Problems: Recognizing and exploiting independent tasks
- Running Job Arrays in SLURM: Practical parameter sweeps and batch processing
- Shared-Memory Parallelism: Threading and multiprocessing on a single node
- Distributed Computing with MPI: Multi-node computing and message passing basics
- Choosing Your Strategy: Decision-making framework and avoiding premature optimization
Prerequisites
- Access to Sagehen HPC cluster (or equivalent SLURM-based system)
- SSH client for terminal access
- Text editor of your choice
- Basic Linux command-line experience (cd, ls, cat, mkdir, etc.)
- Familiarity with submitting simple batch jobs (optional but helpful)
The Sagehen HPC Cluster
Examples in this workshop use the Sagehen HPC cluster at Pomona College:
- 12 AMD EPYC nodes with 128 cores each (1,536 total cores)
- InfiniBand 100Gb/s interconnect for fast communication between nodes
- SLURM job scheduler for resource allocation and job management
- Lustre parallel file system for high-performance I/O
Concepts are universal: While we use Sagehen for examples, the parallel computing principles and SLURM syntax apply to nearly all modern HPC clusters. Adapt syntax and job parameters to your specific cluster’s configuration.
Open Science Commitment
This workshop is open and community-contributable. We encourage:
- Bug reports and feature requests
- Content improvements and clarifications
- Additional examples and use cases
- Translations and adaptations for other clusters
See Contributing below.
Quick Start
- Log into Sagehen:
ssh <username>@sagehen.hpc.pomona.edu - Go through the episodes in order
- Complete the exercises and code-alongs
- Refer to the reference section for syntax reference
Acknowledgments
This workshop was developed with support from the High-Performance Computing team at Pomona College. Special thanks to the Carpentries community for providing the workshop template and pedagogical framework.
License
This work is licensed under a Creative Commons Attribution 4.0 International License (CC-BY 4.0).
You are free to: - Share: copy and redistribute the material - Adapt: remix, transform, and build upon the material
For any use, you must give appropriate credit and indicate if changes were made.
Contributing
We welcome contributions! To contribute:
- Fork the repository: https://github.com/Pomona-College/hpc-parallel-computing
- Create a branch for your changes
- Make edits and test locally
- Submit a pull request with a clear description of changes
See the Instructor Notes for guidance on workshop structure and pedagogy.
Current Status: Pre-alpha
Last Updated: March 6, 2026
Contact: Andrew Wilson (andrew.wilson@pomona.edu)
Acknowledgments
Developed by Andrew Wilson, Director of Research Computing and Digital Scholarship at Pomona College, with Andrei Motchenko, who tested, edited and produced screenshots for the workshop series.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. Why Parallel Computing? |
When should I parallelize my code? What is speedup and how do I measure it? What is the difference between wall clock time and CPU time? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 00h 20m | 2. Amdahl’s Law and Speedup |
What factors limit how much parallelism can help? How do I predict maximum speedup? How do I measure if parallelism is working? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 00h 40m | 3. Types of Parallelism |
What is the difference between shared memory and distributed
memory? What is data parallelism vs task parallelism? How does Sagehen HPC’s architecture combine both? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 01h 00m | 4. Embarrassingly Parallel Problems |
How do I know if my problem is embarrassingly parallel? What are common embarrassingly parallel patterns? How do I convert serial code to run in parallel? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 01h 20m | 5. GNU Parallel and Shell Parallelism |
How do I run many independent commands in parallel from the
shell? What does parallel do that a for
loop with & cannot?How do I throttle concurrency, capture output, and resume a failed batch? When should I move from shell parallelism to SLURM job arrays? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 02h 10m | 6. SLURM Job Arrays |
How do I submit many jobs at once with SLURM? What is SLURM_ARRAY_TASK_ID and how do I use it? How do I map array indices to my parameters? How do I avoid hammering SLURM with thousands of tiny tasks? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 02h 55m | 7. Advanced Job Arrays |
How do I map array indices to multiple parameters? How do I use argparse with job arrays? What are performance considerations for large arrays? How do I gather and verify results from a sweep? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 03h 30m | 8. Shared Memory with OpenMP |
How do I use multiple cores on a single node? What is the difference between threads and processes? How do I request multiple cores in SLURM? Why does Python’s threading module not give parallelism? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 04h 10m | 9. Threading in Python and R Parallelism |
When should I use threading instead of multiprocessing in
Python? How do I parallelize R code? What are common shared-memory patterns for research computing? What performance tips should I follow? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 04h 45m | 10. Distributed Computing Concepts |
When do I need distributed-memory computing? What is MPI and how does it work? How do I run MPI programs on Sagehen HPC? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 05h 00m | 11. MPI Basics |
How do I write and run MPI programs in Python? How do I distribute data across ranks? What are common MPI patterns? When is MPI worth the complexity over simpler approaches? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 05h 50m | 12. Choosing the Right Approach |
How do I know which parallelization technique to use? How do I measure if parallelization is helping? What is the simplest approach that will work? :::::::::::::::::::::::::::::::::::::::::::::::: |
| Duration: 06h 15m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Prerequisites
This workshop assumes you have:
- Access to Sagehen HPC cluster (or equivalent SLURM-based system)
- An SSH client installed on your local machine
- Basic Linux command-line experience
- A text editor of your choice
Getting Access
If you don’t have an account on Sagehen:
- Contact its-hpc@pomona.edu
- Include your department and research advisor
- Wait for account activation (1-2 business days)
Connecting to Sagehen
From your local machine:
Creating Your Working Directory
On Sagehen:
Required Software
Already installed on Sagehen:
- Python 3.9+ with NumPy, SciPy
- R 4.0+ with parallel package
- SLURM job scheduler
- mpi4py for MPI support
- GCC compiler
Verify:
SLURM Commands to Test
Text Editor Options
- nano (simplest)
- vim (powerful)
- VS Code with remote SSH extension
Example: Create Your First Job Script
BASH
cat > ~/parallel-computing-workshop/hello.sh << 'SCRIPT'
#!/bin/bash
#SBATCH --job-name=hello
#SBATCH --time=00:01:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=1G
echo "Hello from Sagehen!"
hostname
date
SCRIPT
Submit it:
Getting Help
- SLURM help: man sbatch
- HPC support: its-hpc@pomona.edu
Ready to go!