Hai
Will the thread be distributed to the blocks inside the sections or each thread will be assigned to each sections because when i execute the below code
NUMBER OF THREADS IS 3
pragma omp sections
{ #pragma omp section { printf ("id = %d, \n", omp_get_thread_num()); }
#pragma omp section
{
printf ("id = %d, \n", omp_get_thread_num());
}
}
OUTPUT:
id=1
id=1
BUT WHEN I EXECUTE THE FOLLOWING CODE
pragma omp sections
{ #pragma omp section { printf ("id = %d, \n", omp_get_thread_num()); }
#pragma omp section
{
printf ("id = %d, \n", omp_get_thread_num());
}
}
pragma omp sections
{ #pragma omp section { printf ("id = %d, \n", omp_get_thread_num()); }
#pragma omp section
{
printf ("id = %d, \n", omp_get_thread_num());
}
}
OUTPUT:
id=1 id=1
id=2 id=2
From these output i couldn't understand what the concept of sections in openmp.
Thank You.