On Tue, Feb 2, 2016 at 10:32 AM, Clemens Ladisch <clemens at ladisch.de> wrote:

> Vin?cius da Silva wrote:
> >                     #pragma omp parallel for
> >                     for( int i = 0; i < dispatchedThreads; ++i )
>
> Does OMP guarantee that there is exactly one thread for each
> loop iteration?
>

Yes, OpenMP will execute each *iteration* in a single thread.
The set of iterations will be spread on 1 or more thread, depending
on OMP_NUM_THREADS.
Default is to evenly divide the [0, dispatchedThreads) range into
per-thread ranges, and run each iteration-range on a single thread. --DD

Reply via email to