Is it possible to use all available threads for OMP on a region where only master MPI is active?. I mean something like this:
START
|
MPI-I --------- MPI-II
(master)
| |
omp1-omp2 -skip- REGION1
omp3-omp4 -skip-
| |
omp1-omp2 omp3-omp4 REGION2
| |
-----------------
|
END
Where nr. total threads available*** is 4 (2 are used for mpi, 4 used by MPI1 -master- on Region1, and 2 used by each MPI on Region2).
It looks like this is only working on Windows*, not on Linux**. On Linux, omp_get_num_procs() seems to detect that threads are being used by other mpi procs. and retrieves a different number -lower- than that Windows does (which gives all available*** ones, irrespective whether they are currently occupied by other mpi active procs.)
On Linux even using explicitly the following clause !$OMP &num_threads(Max_OMP_usage), with Max_OMP_usage equal to the total number of threads available***, within the OMP DO construct has no effect.
*Windows: Intel ifort, MSMPI
**Linux: Intel ifort, MPI OneApi2021.
***By total nr. of threads available I mean the ones "lscpu" retrieves for example, this is, the ones present physically (and not the one omp_get_num_procs() may retrieve).