Site Tools


parallel-computing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
parallel-computing [June 15, 2026 at 09:32] Ivan Janevskiparallel-computing [August 22, 2026 at 15:22] (current) – external edit 127.0.0.1
Line 1: Line 1:
 # Parallel computing # Parallel computing
-**Parallel computing** is a style of programming where a computation is broken into parts that run simultaneously across multiple processors, cores, or machines. The motivation is straightforward: a single core has a clock speed ceiling, and modern CPUs gain performance by adding more cores rather than running each core faster. To take advantage of that, programs have to be written with parallelism in mind. 
  
-Not every program benefits equally. [[amdahls-law|Amdahl's law]] shows that the sequential fraction of program — the part that cannot be parallelized — sets a hard ceiling on speedup regardless of how many cores you add. [[gustafsons-law|Gustafson's law]] is the more optimistic counterpart: if you scale the problem size alongside the hardwarespeedup grows linearlyIn practiceHPC workloads follow Gustafson's regime — you buy more nodes to solve a bigger problem, not just to solve the same one faster.+**[Parallel computing](https://en.wikipedia.org/wiki/Parallel_computing)** is computational model where work is broken into parts that execute simultaneously across multiple processors, cores, or machinesModern CPUs gain performance through additional cores rather than clock speed increasesso exploiting parallelism is essential for performance.
  
-## Map of parallel computing+[[amdahls-law|Amdahl's law]] shows the sequential fraction limits speedup; [[gustafsons-law|Gustafson's law]] shows that scaling problem size with hardware yields near-linear speedup.
  
 +## Example
  
- 1. [[amdahls-law|Amdahl's law]] +This example shows a simple parallel computation using OpenMP.
- 2. [[gustafsons-law|Gustafson's law]] +
- 3. [[roofline-model|Roofline model]] +
- 4. [[openmp|OpenMP]] +
- 5. [[mpi|MPI]] +
- 6. [[saxpy|SAXPY]] +
- 7. [[semaphore|Semaphore]] +
- 8. [[lock-free-queue|Lock-free queue]] +
- 9. [[aba-problem|ABA problem]] +
- 10. [[trace-monoid|Trace monoid]] +
- 11[[numbers-every-programmer-should-know|Numbers every programmer should know]]+
  
 +```c
 +// compile: gcc -fopenmp -o parallel parallel.c
 +// run: ./parallel
 +// description: parallel loop computing array sum
 +
 +#include <omp.h>
 +#include <stdio.h>
 +
 +int main() {
 +    int arr[100];
 +    for (int i = 0; i < 100; i++) arr[i] = i;
 +    
 +    int sum = 0;
 +#pragma omp parallel for reduction(+:sum)
 +    for (int i = 0; i < 100; i++) {
 +        sum += arr[i];
 +    }
 +    
 +    printf("Sum: %d\n", sum);
 +    return 0;
 +}
 +```
  
parallel-computing.1781515969.md.gz · Last modified: by Ivan Janevski