Types of Parallelism
Last updated on 2026-08-27 | Edit this page
Overview
Questions
- 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?
Objectives
- Understand shared-memory and distributed-memory parallelism
- Learn the difference between task parallelism and data parallelism
- Understand Sagehen’s hybrid architecture
Shared-Memory vs. Distributed-Memory
Shared-Memory Parallelism
Multiple processors access the same memory space:
Shared Memory (RAM)
|
_______________|_______________
| | |
Core 0 Core 1 Core 2
Advantages: Easy communication, low latency, good for single-node work. Challenges: Race conditions, limited to single-node memory. Examples: OpenMP, Python multiprocessing, R parallel package.
Distributed-Memory Parallelism
Each processor has its own memory. Data sharing requires explicit message passing:
Node 1 Node 2 Node 3
Memory Memory Memory
| | |
Core 0 Core 1 Core 2
Communication: explicit send/receive messages
Advantages: Scales to many nodes, simpler synchronization. Challenges: Higher latency, explicit communication code. Examples: MPI, Spark, distributed databases.

Shared memory keeps everything in one address
space; distributed memory makes you send data across the network
yourself.
Data Parallelism vs. Task Parallelism
Comparison: Which Type of Parallelism?
| Scenario | Best Approach | Why |
|---|---|---|
| 100 independent simulations | Job arrays | No communication needed |
| Processing 10,000 images | Job arrays | Independent files |
| Single simulation on 4 cores | multiprocessing | Shared memory |
| Large dataset analysis | Data parallelism | Divide data, apply function |
| Tightly-coupled physics | MPI | Needs frequent communication |
Challenge
Categorizing Problems
For each, identify: is it data parallel, task parallel, or tightly coupled?
- Analyzing 1,000 gene sequences independently
- Simulating fluid flow where each grid point depends on neighbors
- Training 3 different ML algorithms on the same data
- Task parallel / embarrassingly parallel – each sequence is independent. Use job arrays.
- Tightly coupled – spatial dependencies between grid points. Use shared-memory or MPI.
- Task parallel – each algorithm trains independently. Use job arrays (only 3 tasks though).
- Shared-memory parallelism works within a node; distributed-memory across nodes
- Data parallelism applies the same operation to different data
- Task parallelism runs different tasks in parallel
- Most research problems are embarrassingly parallel at some level