MutiGPU (OpenMP) - Tasks runs in series several times. Using OpenMP to run in 2 GPUs. Parallel secti

Hi everyone,

I’m using OpenMP to run 2 threads in 2GPU’s (580GTX). The parallel section is inside of a loop and it works fine. However, in some iterations, the code runs in series. I don’t know why this is happening.

About 20% of iterations, the parallel section runs in series.

Does anyone know what could be happening?

Thank you External Image

[...]

for(int i = 0; i < nsteps; ++i){

#pragma omp parallel num_threads(2)

			{

#pragma omp sections

				{

#pragma omp section

					{

						cutilSafeCall( cudaSetDevice(1) );

						task1();

						// MemcpyToHost --> h_data[1]

					}

#pragma omp section

					{

						cutilSafeCall( cudaSetDevice(0));

						task0();

						// MemcpyToHost --> h_data[0]

						// ThreadSync

					}

				}

			}

[...]

[...]

}

[...]