2024-04-16 08:59:23 -07:00

23 lines
768 B
TeX

\pagebreak
\section{A Simple Parallel Loop}
\label{sec:ploop}
\index{combined constructs!parallel worksharing-loop}
\index{constructs!parallel@\kcode{parallel}}
\index{parallel construct@\kcode{parallel} construct}
\index{worksharing-loop constructs!for@\kcode{for}}
\index{worksharing-loop constructs!do@\kcode{do}}
\index{constructs!for@\kcode{for}}
\index{constructs!do@\kcode{do}}
\index{for construct@\kcode{for} construct}
\index{do construct@\kcode{do} construct}
The following example demonstrates how to parallelize a simple loop
using the \kcode{parallel} worksharing-loop
construct. The loop iteration variable is private by default, so it is not
necessary to specify it explicitly in a \kcode{private} clause.
\cexample{ploop}{1}
\fexample{ploop}{1}