Site Tools


collapse-openmp

Differences

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

Link to this comparison view

collapse-openmp [June 11, 2026 at 07:42] – created - external edit 127.0.0.1collapse-openmp [June 11, 2026 at 09:18] (current) Ivan Janevski
Line 1: Line 1:
 # Collapse (OpenMP) # Collapse (OpenMP)
-**Collapse** is an OpenMP clause that merges multiple perfectly-nested loops into a single flat iteration space before distributing work across threads. When a loop nest has too few outer iterations to keep all threads busy, distributing only the outer loop leaves most threads idle. `collapse(N)` multiplies the available parallelism by treating the combined iteration space as one loop. "Perfectly nested" means no statements appear between the loop headers.+**Collapse** is an OpenMP clause that merges multiple perfectly-nested loops into a single flat iteration space before distributing work across threads. 
 + 
 +When a loop nest has too few outer iterations to keep all threads busy, distributing only the outer loop leaves most threads idle. `collapse(N)` multiplies the available parallelism by treating the combined iteration space as one loop. "Perfectly nested" means no statements appear between the loop headers.
  
 ```c ```c
collapse-openmp.1781163760.txt.gz · Last modified: by 127.0.0.1