Dominique Devienne wrote:
> 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.

If i and omp_get_thread_num() are not the same, the code breaks.


Regards,
Clemens

Reply via email to