I have a small loop of not more than three passes where each pass is highly CPU intensive and no index cross talk is required. I have learned that the main thread takes on a pass so I at most need two more threads. What is the most efficient way to tell OpenMP what I want?
I have experimented a little but not really knowing what I am doing and how it may affect my other uses of OpenMP. I would appreciate a knowledgeable review.
- Code: Select all
//#pragma omp parallel num_threads(2), default(shared)
//#pragma omp for private(i), schedule(dynamic, 1)
#pragma omp parallel for
for(i=0; i<notMoreThan3; ++i)