2021-11-29 10:39:34 +01:00
|
|
|
subroutine set_multiple_levels_omp(activate)
|
2021-11-19 09:57:04 +01:00
|
|
|
|
2021-11-29 10:39:34 +01:00
|
|
|
BEGIN_DOC
|
|
|
|
! If true, activate OpenMP nested parallelism. If false, deactivate.
|
|
|
|
END_DOC
|
2021-11-19 09:57:04 +01:00
|
|
|
|
|
|
|
implicit none
|
2021-11-29 10:39:34 +01:00
|
|
|
logical, intent(in) :: activate
|
2021-11-19 09:57:04 +01:00
|
|
|
|
2021-11-29 10:39:34 +01:00
|
|
|
if (activate) then
|
2022-02-07 23:34:09 +01:00
|
|
|
call omp_set_max_active_levels(3)
|
2021-11-29 10:39:34 +01:00
|
|
|
|
|
|
|
IRP_IF SET_NESTED
|
|
|
|
call omp_set_nested(.True.)
|
|
|
|
IRP_ENDIF
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
call omp_set_max_active_levels(1)
|
|
|
|
|
|
|
|
IRP_IF SET_NESTED
|
|
|
|
call omp_set_nested(.False.)
|
|
|
|
IRP_ENDIF
|
|
|
|
end if
|
2021-11-19 09:57:04 +01:00
|
|
|
|
|
|
|
end
|