Parallel computing
Parallel computing is the use of many processors at the same time to solve one problem. The problem is split into pieces of work that can be done at once, and each processor takes some of them.[1] The aim is to get an answer sooner, or to solve a problem too big for one processor.[1]
Nearly all stand-alone computers today are parallel inside, with several processor cores and other units that work side by side.[1] The largest supercomputers use millions of cores.[2] As a field of computer science, parallel computing studies this hardware, how to program it, and how much it can speed up a task.
The basic idea
A serial program runs on one processor, which carries out its instructions one after another. A parallel program splits the problem into separate parts that run at the same time on several processors.[1] The processors are usually the cores of one computer, or many computers joined by a network.[1]
Splitting a problem into parts is called decomposition, or partitioning.[1] For example, to reverse the colors of a black-and-white image, each processor can take its own part of the picture and work alone.[1] Problems like this, which need little or no communication between the parts, are called embarrassingly parallel.[1]
Parallelism is related to concurrency, but the two differ. Concurrency is the structuring of a program as independently running parts, while parallelism is the running of computations at the same time.[3]
Why it matters
Faster answers and larger problems
Parallel computing serves several practical needs.[1]
- Less waiting. Splitting the work cuts the time to a solution.
- Larger problems. Some problems are too large or complex for one computer, often because one computer has too little memory.
- Many events at once. The natural world has many related events happening together, and parallel computers suit models of such systems.
- High throughput. Web search engines and databases process millions of transactions every second.
The end of ever-faster single processors
For decades, chip designers sped up single processors by raising the clock frequency and by finding more instruction-level parallelism.[4] By the early 2000s, processors used so much power that they were hard to cool cheaply, and gains in single-processor speed slowed.[4] Air cooling limits a chip to about 130 W.[4]
The power problem comes from the energy needed to switch a logic gate:
Here is the energy of one switch, is the capacitance being charged, and is the supply voltage.[4] Under classic chip scaling, also called Dennard scaling, each new generation of chips could double in complexity and raise its clock speed at the same power.[4] From about the 130 nm generation, supply voltage stopped falling as fast, so the energy per switch fell more slowly.[4]
A group of Berkeley researchers called the result the power wall, in which a chip can hold more transistors than there is power to turn on.[5] In 2005, Intel followed IBM's Power4 and Sun's Niagara in announcing that its high-performance processors would rely on multiple cores.[5] The same group described increasing parallelism, not clock frequency, as the new main way to improve processor performance.[5]
Levels of parallelism
Parallelism appears at several levels, from the bits of one number to whole tasks on separate machines. The main levels are bit-level, instruction-level, data, and task parallelism.
| Level | What happens at the same time | Example |
|---|---|---|
| Bit level | The processor handles all bits of a word together; a wider word means fewer instructions[6] | Growth from 4-bit to 8-, 16-, 32-, and 64-bit processors[6] |
| Instruction level | Single machine operations, such as loads, adds, and multiplies, run in parallel[7] | Superscalar and VLIW processors[7] |
| Data | Tasks do the same operation on different parts of the data[1] | Adding 4 to every element of an array[1] |
| Task | Tasks do different parts of the work[1] | Tasks that run different programs at once[1] |
Bit-level and instruction-level parallelism happen inside a single processor. Rau and Fisher note that instruction-level techniques, unlike multiprocessor parallelism, are largely invisible to users.[7] Hardware gets this parallelism from several functional units that work side by side and from pipelining, as in superscalar and very long instruction word (VLIW) processors.[7]
Data and task parallelism
Above the single processor, programmers split work in two basic ways.[1] In domain decomposition, the data is divided and each task works on its own portion, often doing the same operation as the others.[1] In functional decomposition, the problem is divided by the kinds of work to be done, and each task does a different part of the job.[1]
Kinds of parallel computers
Flynn's taxonomy
Michael J. Flynn published a classification of fast computers in 1966, and it is still widely used.[8][1] Flynn's taxonomy sorts machines by how many instruction streams they run and how many data streams they work on. Each can be single or multiple, which gives four classes.[1]
| Class | Instruction streams | Data streams | Examples |
|---|---|---|---|
| SISD | Single | Single | Serial computers, such as older single-core PCs |
| SIMD | Single | Multiple | ILLIAC IV, Thinking Machines CM-2, Cray X-MP; SIMD units in modern cores and GPUs |
| MISD | Multiple | Single | Few, if any, have been built |
| MIMD | Multiple | Multiple | Multicore PCs, clusters, most supercomputers |
In SIMD machines, all processing units carry out the same instruction in lockstep, each on its own data, which suits regular work such as image processing.[1] Early examples include processor arrays such as ILLIAC IV and vector machines such as the Cray X-MP.[1] MIMD is the most common type of parallel computer today, and many MIMD machines also contain SIMD parts.[1]
Memory organization
How processors reach memory shapes both the hardware and the way it is programmed.[1]
- Shared memory. All processors can reach all memory as one global address space, so a change made by one processor is visible to the others. Shared-memory machines are grouped by memory access time into uniform memory access (UMA) and non-uniform memory access (NUMA) designs.[1]
- Distributed memory. Each processor has its own local memory and must use a network to reach memory on other machines. Memory grows with the number of processors, and there is no cost of keeping caches coherent across the whole machine.[1]
- Hybrid. Many shared-memory machines, often with GPUs, are joined by a network. This design is expected to keep dominating at the high end of computing.[1]
Common hardware
- Multi-core processors put several processor cores on one chip.[5]
- Graphics processing units (GPUs) are built to run thousands of threads in parallel, while a CPU runs a few tens. A GPU gives up single-thread speed for much greater total throughput.[9] NVIDIA introduced CUDA in 2006 so that any workload, not only graphics, could use this throughput, a practice known as general-purpose computing on GPUs.[9]
- Computer clusters link many ordinary computers with a network. The first Beowulf cluster, started in 1994, joined 16 DX4 processors with Ethernet as a low-cost alternative to large supercomputers.[10]
- Supercomputers combine huge numbers of processors over a fast interconnection network. Frontier, for example, pairs AMD EPYC CPUs with AMD Instinct MI250X accelerators over a Slingshot-11 network.[2]
Writing parallel programs
Programming models
A parallel programming model is the programmer's view of how tasks share data. Models sit above the hardware, and in principle any model can run on any hardware.[1] The common models are shared memory with threads, message passing, data parallel, and hybrid models.[1]
| Model | How tasks share data | Example tools |
|---|---|---|
| Threads | Threads read and write common memory and must synchronize so that two do not update the same place at once | OpenMP, POSIX threads |
| Message passing | Each task has its own memory; tasks send and receive messages, and each send needs a matching receive | MPI |
| Data parallel | Tasks do the same operation on different parts of one global data structure; also called the partitioned global address space (PGAS) model | Coarray Fortran, Unified Parallel C (UPC), Global Arrays, X10, Chapel |
| Hybrid | Message passing between machines, threads or GPU code within each machine | MPI with OpenMP; MPI with CUDA |
The table draws on the LLNL tutorial.[1] Most programs for multi-machine clusters use the single program, multiple data (SPMD) style.[1] Every task runs its own copy of the same program on different data, and branches let each task run only the parts meant for it.[1]
The Message Passing Interface (MPI) is the standard most used in practice for message passing.[1] It came from the MPI Forum, formed in 1992; its first part was released in 1994 and version 5.0 in June 2025.[1] OpenMP, the usual standard for the threads model, published its first specification, for Fortran, in October 1997.[1][11]
Communication
When tasks need each other's data, they must communicate, and this almost always costs time.[1] Two numbers describe a link: latency is the time to send a minimal, zero-byte message, and bandwidth is the amount of data sent per unit of time.[1] Sending many small messages lets latency dominate, so packing them into one larger message is often faster.[1]
Blocking (synchronous) communication makes tasks wait until a transfer is done. Non-blocking (asynchronous) communication lets a task keep working while data moves, so computation and communication overlap.[1]
Synchronization
Synchronization makes tasks wait for each other at the right moments, and that waiting can lengthen the run time.[1] Two common tools are barriers and locks.[1]
- A barrier stops each task that reaches it. Only when the last task arrives are all tasks in step again.
- A lock protects shared data or a section of code so that only one task at a time can use it. Other tasks that want the lock must wait until it is released.
Dependencies and race conditions
A dependence exists between two statements when the order in which they run changes the result.[1] Dependencies are one of the main obstacles to parallelism, because dependent steps cannot simply run at the same time.[1]
A data race happens when several threads use the same memory location without proper synchronization and at least one of them writes to it.[12] The figure shows how such a race can lose an update. Shared-memory programs use locks and similar tools to control access, prevent race conditions, and avoid deadlocks.[1]
Load balance and granularity
Load balancing means giving each task about the same amount of work, so that no task sits idle.[1] It matters because at a barrier the slowest task sets the pace for all of them.[1]
Granularity is the ratio of computation to communication.[1] Coarse-grained programs do a lot of work between communication events, while fine-grained programs do little.[1]
Measuring performance
Speedup and efficiency
Speedup compares the run time on one processor, , with the run time on processors, :[13]
The ideal is . Efficiency is the measured speedup divided by this ideal, , so perfect scaling gives .[13]
Parallel runs carry overhead that serial runs do not, such as starting tasks, communication, synchronization, and stopping tasks.[1] A program that runs for 1 hour on 8 processors uses 8 hours of total processor time.[1] For short runs, overhead can make the parallel version slower than the serial one, and past some point adding processors makes many programs slower, an effect called parallel slowdown.[1]
Amdahl's law
Gene Amdahl argued in 1967 that the part of a program that must run serially limits what parallel hardware can gain.[14] His short paper had no equations.[15] The argument is usually written as Amdahl's law:[14]
- is the fraction of the one-processor run time that is serial.
- is the fraction that can run in parallel.
- is the number of processors.
The law assumes a fixed problem size and a parallel part that divides perfectly among the processors.[1][14] As grows, goes to zero, so for any the speedup can never exceed .[14]
A program that is 95% parallel () reaches a speedup of about 19.6 on 1,000 processors and stays below 20 however many are added.[1] A program that is only half parallel never passes a speedup of 2.[1]
Gustafson's law
John Gustafson argued in 1988 that Amdahl's assumptions did not match how large parallel machines were used.[14] Given more processors, users grow the problem, with finer grids or more time steps, so the run time stays about fixed instead of the problem size.[14] He credited the resulting formula, now called Gustafson's law, to E. Barsis at Sandia National Laboratories:[14]
Here and are the serial and parallel fractions of the run time measured on the parallel machine, with .[14] With and , the scaled speedup is . On a 1024-processor machine at Sandia, applications with serial fractions of 0.4 to 0.8 percent reached speedups such as 1021 and 1020.[14]
The two laws match two ways of testing a program's scalability.[1]
- Strong scaling (Amdahl). The total problem size stays fixed as processors are added, and the goal is to solve the same problem faster.
- Weak scaling (Gustafson). The problem size per processor stays fixed, and the goal is to solve a larger problem in the same time.
The two laws do not contradict each other. If the serial run time is treated as a constant, Gustafson's law follows from Amdahl's in a few lines, and one analysis calls the popular claim that it overthrows Amdahl's law a mistake.[16]
Theory of parallel algorithms
Work and span
The analysis of parallel algorithms often models a computation as a directed acyclic graph of steps, where an arrow means one step must wait for another.[17] Two numbers describe the graph.[17]
- Work, , is the total number of steps. It equals the run time on one processor.
- Span, , is the number of steps on the longest chain of dependencies. It equals the run time on an unlimited number of processors.
No schedule on processors can beat both limits, because the work can at best be shared evenly and the longest chain must still run in order:[17]
The ratio is called the parallelism. It is the average work per step along the span, and roughly how many processors the algorithm can use well.[17]
A greedy scheduler runs any ready step whenever a processor is free. On an ideal parallel computer it finishes within a factor of two of the best possible time:[17]
Real schedulers are not fully greedy, and the bound ignores scheduling overhead and the cost of moving data.[17]
Abstract machines
Theorists study parallel algorithms on idealized models of parallel computation. The best known is the parallel random-access machine (PRAM), a set of processors that run in step and communicate through a shared memory.[18] It was introduced independently by Fortune and Wyllie and by Goldschlager.[18]
PRAM variants differ in whether processors may access the same memory cell at once.[18] They range from exclusive-read exclusive-write (EREW), where no two processors touch the same cell at once, to concurrent-read concurrent-write (CRCW), which needs a rule to settle clashing writes.[18]
Problems that may resist parallelism
The complexity class NC holds problems with feasible, highly parallel solutions. These take time polynomial in the logarithm of the input size while using a polynomial number of processors.[18]
P-complete problems are the hardest problems among those solvable in polynomial time, and no NC algorithm has been found for any of them.[18] An example is evaluating a Boolean circuit, the circuit value problem, which Ladner showed to be P-complete in 1975.[18] Whether NC equals P is an open question.[18]
History
Speeds of the largest machines are given in exaflop/s. An exaflop/s is floating-point operations per second.
- Flynn publishes his classification of high-speed computers.[8]
- Amdahl argues that serial work limits the gain from parallel processing.[15]
- ILLIAC IV, a SIMD machine with 64 processing elements, is shipped to NASA Ames Research Center.[19]
- Gustafson reports near-linear speedups on a 1024-processor machine and argues for scaled speedup.[14]
- The first OpenMP specification is published.[11]
- Intel announces that its high-performance processors will rely on multiple cores.[5]
- NVIDIA introduces CUDA for general-purpose GPU computing.[9]
- On the June TOP500 list, the top system, LineShine in China, reaches 2.198 exaflop/s using 13,789,440 cores.[20]
Open problems
- Programming difficulty. The Berkeley group warned that moving from sequential to parallel computing makes programming much harder.[5] A National Research Council report found that parallel hardware can succeed only if software can be written to use it well.[4]
- The memory wall. A processor can take 200 clock cycles to read main memory, while a floating-point multiply may take only four.[5]
- Power. Even chips with many simpler cores are expected to hit limits on total chip power.[4]
- Theory. Whether every problem solvable in polynomial time has a highly parallel solution, the question of whether NC equals P, remains unsolved.[18]
References
- Introduction to Parallel Computing Tutorial, Lawrence Livermore National Laboratory.
- June 2022 TOP500 list, TOP500, 2022.
- Concurrency is not parallelism, The Go Blog, 2013.
- Power Is Now Limiting Growth in Computing Performance, in The Future of Computing Performance, National Academies Press, 2011.
- The Landscape of Parallel Computing Research: A View from Berkeley, UC Berkeley EECS Technical Report, 2006.
- What is parallel computing?, IBM, 2024.
- Instruction-Level Parallel Processing: History, Overview and Perspective, B. R. Rau and J. A. Fisher, Hewlett-Packard Laboratories, 1992.
- Very High-Speed Computing Systems, M. J. Flynn, Proceedings of the IEEE, 1966.
- CUDA Programming Guide: Introduction, NVIDIA.
- Beowulf History, Beowulf.org.
- OpenMP Specifications, OpenMP Architecture Review Board.
- Data Race, Intel Inspector User Guide, Intel, 2022.
- Scalability: strong and weak scaling, PDC Center for High Performance Computing, KTH, 2018.
- Reevaluating Amdahl's Law, J. L. Gustafson, Communications of the ACM, 1988.
- Validity of the Single Processor Approach to Achieving Large Scale Computing Capabilities, G. M. Amdahl, AFIPS Conference Proceedings (reprinted in IEEE SSCS News, 2007), 1967.
- Amdahl's and Gustafson-Barsis laws revisited, arXiv, 2008.
- Cost Model: Work, Span, and Parallelism, Washington University in St. Louis, 2014.
- Limits to Parallel Computation: P-Completeness Theory, R. Greenlaw, H. J. Hoover, and W. L. Ruzzo, Oxford University Press, 1995.
- The History of Parallel Processing at Burroughs, Stokes, 1981.
- June 2026 TOP500 list, TOP500, 2026.
