9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-10-12 10:51:31 +02:00
qp2/src/utils/set_multiple_levels_omp.irp.f

27 lines
452 B
Fortran
Raw Normal View History

2021-11-29 10:39:34 +01:00
subroutine set_multiple_levels_omp(activate)
2021-11-29 10:39:34 +01:00
BEGIN_DOC
! If true, activate OpenMP nested parallelism. If false, deactivate.
END_DOC
implicit none
2021-11-29 10:39:34 +01:00
logical, intent(in) :: activate
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
end