#pragma omp parallel
{
// Code inside this region runs in parallel.
printf("Hello!\n");
}
Is it nornally true that the number within the team of threads created by OpenMP equals the number of cores? So if I execute this programme on a single core computer, does it print "Hello!" exactly once?
You can override the default by setting environment variable OMP_NUM_THREADS.
(I did just test that with values 1 and 60 and my cores are something in between.)
The pragmas seem to allow a num_threads clause.
There might be a function to change number of threads (size of pool) at start of program so that you could use command line parameter rather than environment variable.