10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-12-21 20:03:33 +01:00

Bug with openmp corrected

This commit is contained in:
Anthony Scemama 2015-04-12 00:08:03 +02:00
parent 66c2934d6d
commit 6aa8f2d4a1

View File

@ -55,11 +55,12 @@ subroutine irp_enter(irp_where)
integer :: ithread integer :: ithread
character*(*) :: irp_where character*(*) :: irp_where
""" """
if do_openmp: if not do_openmp:
txt += """ txt += """
integer, external :: omp_get_thread_num !$ integer, external :: omp_get_thread_num
integer, external :: omp_get_num_threads !$ integer, external :: omp_get_num_threads
ithread = omp_get_thread_num() ithread = 0
!$ ithread = omp_get_thread_num()
if (ithread /= 0) then if (ithread /= 0) then
print *, 'Error: Provider is called by thread', ithread print *, 'Error: Provider is called by thread', ithread
call irp_trace call irp_trace
@ -68,7 +69,9 @@ endif
""" """
else: else:
txt += """ txt += """
ithread = 0 integer, external :: omp_get_thread_num
integer, external :: omp_get_num_threads
ithread = omp_get_thread_num()
""" """
txt += "$1" txt += "$1"
@ -137,6 +140,8 @@ $1
print *, 'Allocating irp_cpu(',STACKMAX,',',nthread,')' print *, 'Allocating irp_cpu(',STACKMAX,',',nthread,')'
print *, 'Allocating stack_index(',nthread,')' print *, 'Allocating stack_index(',nthread,')'
endif endif
"""
txt += """
$2 $2
end subroutine end subroutine