skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
smp
This page is read only. You can view the source, but not change it.
# SMP **[SMP](https://en.wikipedia.org/wiki/Symmetric_multiprocessing)** (Symmetric Multiprocessing) describes a system where multiple identical cores share a single main memory and OS instance, with every core equally capable of running any task. The OS scheduler treats all cores interchangeably. "Symmetric" refers to core equivalence, not memory access cost—caches and coherence still create latency variation within a single socket, and NUMA breaks it further across sockets. SMP is the standard architecture for multi-core desktops and single-socket servers, contrasting with distributed-memory clusters using MPI. ## Example This example uses all cores in an SMP system for parallel work. ```c // compile: gcc -fopenmp -O2 -o smp smp.c // run: ./smp // description: utilize all SMP cores for parallel reduction #include <stdio.h> #include <omp.h> int main() { int n = 10000000; int sum = 0; #pragma omp parallel for reduction(+:sum) for (int i = 0; i < n; i++) { sum += i % 1000; } printf("Cores: %d, Sum: %d\n", omp_get_num_procs(), sum); return 0; } ```
Page Tools
Show pagesource
Backlinks
Back to top