I have a piece of code :
void open_mp_number_thread_test()
{
#pragma omp parallel
{
omp_set_num_threads(4);
#pragma omp for
for(int i=1; i<4; ++i)
{
}
omp_set_num_threads(6);
#pragma omp for
for(int i=1; i<6; ++i)
{
}
}
}
Is this a good idea or practical to change the number of threads in the openmp code in order to adapt the maximal iterations in the for-loops ?