From 990e3a9d2f0afe43c4ee4e091636245064d815f1 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Fri, 3 Jan 2020 14:48:36 -0700 Subject: [PATCH] updates to perf_mod to partially address threading issues with ESMF --- share/timing/perf_mod.F90 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/share/timing/perf_mod.F90 b/share/timing/perf_mod.F90 index 0801ebb73bba..6a49f1ff4e1d 100644 --- a/share/timing/perf_mod.F90 +++ b/share/timing/perf_mod.F90 @@ -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)) @@ -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() @@ -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)) @@ -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()