I have the following code:
#pragma omp parallel for schedule(static,1)
for (int i=first_i; i<=last_i; i++)
where first_i is 0, and last_i is 3. I run on a 4-cores machine.
Sometimes parallelization doesn't happen, and omp_get_max_threads() returns 1. I don't have any OMP-related environment variable, and don't call omp_set_num_threads(). If I call omp_set_num_threads(4) before the #pragma region, the parallelization does happen.
The problem occurs only when the OpenMP code is run on a server (which is run by a Windows service).
Why OpenMP decides that it has 1 thread available?
Thank you very much,