parallel-computing
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| parallel-computing [June 15, 2026 at 15:33] – Ivan Janevski | parallel-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: | ||
| - | Not every program benefits equally. [[amdahls-law|Amdahl' | + | **[Parallel computing](https:// |
| - | ## Map of parallel computing | + | [[amdahls-law|Amdahl' |
| + | ## Example | ||
| + | |||
| + | This example shows a simple parallel computation using OpenMP. | ||
| + | |||
| + | ```c | ||
| + | // compile: gcc -fopenmp -o parallel parallel.c | ||
| + | // run: ./parallel | ||
| + | // description: | ||
| + | |||
| + | #include < | ||
| + | #include < | ||
| + | |||
| + | int main() { | ||
| + | int arr[100]; | ||
| + | for (int i = 0; i < 100; i++) arr[i] = i; | ||
| + | | ||
| + | int sum = 0; | ||
| + | #pragma omp parallel for reduction(+: | ||
| + | for (int i = 0; i < 100; i++) { | ||
| + | sum += arr[i]; | ||
| + | } | ||
| + | | ||
| + | printf(" | ||
| + | return 0; | ||
| + | } | ||
| + | ``` | ||
| - | - [[introduction-to-parallel-computing]] | ||
| - | - [[saxpy]] | ||
| - | - [[synchronization-primitve]] | ||
| - | - [[sync-semaphore]] | ||
| - | - [[sync-mutex]] | ||
| - | - [[sync-monitor]] | ||
| - | - [[sync-linda]] | ||
| - | - [[sync-csp]] | ||
| - | - [[sync-mbox]] | ||
| - | - [[numbers-every-programmer-should-know]] | ||
| - | - [[amdahls-law]] | ||
| - | - [[gustafsons-law]] | ||
| - | - [[cache]] | ||
| - | - [[l1-cache]] | ||
| - | - [[l2-cache]] | ||
| - | - [[l3-cache]] | ||
| - | - [[cache-coherence]] | ||
| - | - [[cache-snoopy-protocols]] | ||
| - | - [[wti]] | ||
| - | - [[msi]] | ||
| - | - [[mesi]] | ||
| - | - [[moesi]] | ||
| - | - [[dragon]] | ||
| - | - [[firefly]] | ||
| - | - [[cache-directory-protocols]] | ||
| - | - [[cuda]] | ||
| - | - [[openmp]] | ||
| - | - [[mpi]] | ||
| - | - [[queuing-theory]] | ||
| - | - [[lock-free-queue]] | ||
| - | - [[numa]] | ||
| - | - [[false-sharing]] | ||
| - | - [[aba-problem]] | ||
| - | - [[trace-monoid]] | ||
| - | - [[hazard-pointer]] | ||
| - | - [[cache-coherence]] | ||
| - | - [[roofline-model]] | ||
| - | - [[numa]] | ||
| - | - [[embarrassingly-parallel]] | ||
| - | - [[fork-join-model]] | ||
| - | - [[rcu]] | ||
| - | - [[lock]] | ||
| - | - [[lock-convoy]] | ||
| - | - [[lock-contention]] | ||
| - | - [[spinlock]] | ||
| - | - [[smp]] | ||
| - | - [[memory-order]] | ||
| - | - [[cas]] | ||
| - | - [[treiber-stack]] | ||
| - | - [[cas]] | ||
| - | - [[michael-scott-queue]] | ||
| - | - [[bespoke-algorithm]] | ||
parallel-computing.1781537624.md.gz · Last modified: by Ivan Janevski
