Skip to content

Commit

Permalink
updates to perf_mod to partially address threading issues with ESMF
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariana Vertenstein committed Jan 3, 2020
1 parent 9898562 commit 990e3a9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions share/timing/perf_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,9 @@ subroutine t_startf(event, handle)
#endif
perf_timing_ovhd = perf_timing_ovhd - ovhd_start
endif
#ifndef NUOPC_INTERFACE
!$OMP END MASTER
#endif
if ((perf_add_detail) .AND. (cur_timing_detail < 100)) then
write(cdetail,'(i2.2)') cur_timing_detail
str_length = min(SHR_KIND_CM-3,len_trim(event))
Expand All @@ -742,7 +744,9 @@ subroutine t_startf(event, handle)
str_length = min(SHR_KIND_CM,len_trim(event))
TIMERSTART(event(1:str_length))
endif
#ifndef NUOPC_INTERFACE
!$OMP MASTER
#endif
if (perf_ovhd_measurement) then
#ifdef HAVE_MPI
ovhd_stop = mpi_wtime()
Expand Down Expand Up @@ -797,12 +801,12 @@ subroutine t_stopf(event, handle)
#endif
perf_timing_ovhd = perf_timing_ovhd - ovhd_start
endif
!$OMP END MASTER
#ifdef NUOPC_INTERFACE
cur_timing_depth = cur_timing_depth - 1
if(cur_timing_depth >= timer_depth_limit) return
#else
!$OMP END MASTER
#endif

if ((perf_add_detail) .AND. (cur_timing_detail < 100)) then
write(cdetail,'(i2.2)') cur_timing_detail
str_length = min(SHR_KIND_CM-3,len_trim(event))
Expand All @@ -811,8 +815,9 @@ subroutine t_stopf(event, handle)
str_length = min(SHR_KIND_CM,len_trim(event))
TIMERSTOP(event(1:str_length))
endif

#ifndef NUOPC_INTERFACE
!$OMP MASTER
#endif
if (perf_ovhd_measurement) then
#ifdef HAVE_MPI
ovhd_stop = mpi_wtime()
Expand Down

0 comments on commit 990e3a9

Please sign in to comment.