From 0573e5cd3e62fa331769e7f6cf59539e5522e1b3 Mon Sep 17 00:00:00 2001 From: Max Hawkins Date: Thu, 17 Oct 2024 11:07:29 -0400 Subject: [PATCH] Standardize timing ranges --- src/common/m_mpi_common.fpp | 4 ++++ src/simulation/m_mpi_proxy.fpp | 1 - src/simulation/m_rhs.fpp | 40 ++++++++++++++++++++++++---------- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/src/common/m_mpi_common.fpp b/src/common/m_mpi_common.fpp index 42748e57b..8cdf8bd1a 100644 --- a/src/common/m_mpi_common.fpp +++ b/src/common/m_mpi_common.fpp @@ -16,6 +16,8 @@ module m_mpi_common use m_derived_types !< Definitions of the derived types use m_global_parameters !< Definitions of the global parameters + + use m_nvtx ! ========================================================================== implicit none @@ -239,6 +241,7 @@ contains #ifdef MFC_SIMULATION #ifdef MFC_MPI + call nvtxStartRange("TSTEP-RUNTIME-INFO-REDUCE-CRIT") ! Reducing local extrema of ICFL, VCFL, CCFL and Rc numbers to their ! global extrema and bookkeeping the results on the rank 0 processor call MPI_REDUCE(icfl_max_loc, icfl_max_glb, 1, & @@ -253,6 +256,7 @@ contains MPI_DOUBLE_PRECISION, MPI_MIN, 0, & MPI_COMM_WORLD, ierr) end if + call nvtxEndRange #else diff --git a/src/simulation/m_mpi_proxy.fpp b/src/simulation/m_mpi_proxy.fpp index d393aaf4e..2c1e50d23 100644 --- a/src/simulation/m_mpi_proxy.fpp +++ b/src/simulation/m_mpi_proxy.fpp @@ -1078,7 +1078,6 @@ contains call nvtxStartRange("RHS-COMM-SENDRECV-NO-RMDA") #:endif - call nvtxStartRange("RHS-MPI-SENDRECV") call MPI_SENDRECV( & p_send, buffer_count, MPI_DOUBLE_PRECISION, dst_proc, send_tag, & p_recv, buffer_count, MPI_DOUBLE_PRECISION, src_proc, recv_tag, & diff --git a/src/simulation/m_rhs.fpp b/src/simulation/m_rhs.fpp index f0b50f441..aef388094 100644 --- a/src/simulation/m_rhs.fpp +++ b/src/simulation/m_rhs.fpp @@ -682,7 +682,7 @@ contains gm_alpha_qp%vf) call nvtxEndRange - call nvtxStartRange("RHS-COMM") + call nvtxStartRange("RHS-COMMUNICATION") call s_populate_variables_buffers(q_prim_qp%vf, pb, mv) call nvtxEndRange @@ -866,6 +866,26 @@ contains end if ! END: Additional physics and source terms ========================= + #:if chemistry + if (chem_params%advection) then + call nvtxStartRange("RHS-CHEM-ADVECTION") + + #:for NORM_DIR, XYZ in [(1, 'x'), (2, 'y'), (3, 'z')] + + if (id == ${NORM_DIR}$) then + call s_compute_chemistry_rhs_${XYZ}$ ( & + flux_n, & + rhs_vf, & + flux_src_n(${NORM_DIR}$)%vf, & + q_prim_vf) + end if + + #:endfor + + call nvtxEndRange + end if + #:endif + end do ! END: Dimensional Splitting Loop ================================= @@ -902,20 +922,18 @@ contains end if ! Add bubles source term - if (bubbles .and. (.not. adap_dt) .and. (.not. qbmm)) then - call nvtxStartRange("RHS-BUBBLES-SOURCE") - call s_compute_bubble_source( & - q_cons_qp%vf(1:sys_size), & - q_prim_qp%vf(1:sys_size), & - t_step, & - rhs_vf) - call nvtxEndRange - end if + call nvtxStartRange("RHS-BUBBLES-SRC") + if (bubbles .and. (.not. adap_dt) .and. (.not. qbmm)) call s_compute_bubble_source( & + q_cons_qp%vf(1:sys_size), & + q_prim_qp%vf(1:sys_size), & + t_step, & + rhs_vf) + call nvtxEndRange if (chemistry) then if (chem_params%reactions) then call nvtxStartRange("RHS-CHEM-REACTIONS") - call s_compute_chemistry_reaction_flux(rhs_vf, q_cons_qp%vf, q_prim_qp%vf) + call s_compute_chemistry_reaction_flux(rhs_vf, q_cons_vf, q_prim_qp%vf) call nvtxEndRange end if end if