Skip to content

Commit 7afc810

Browse files
committed
merged latest changes
2 parents e853852 + 6339c43 commit 7afc810

File tree

6 files changed

+107
-69
lines changed

6 files changed

+107
-69
lines changed

.github/codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ coverage:
44
default:
55
target: 1%
66
threshold: 1%
7+
patch:
8+
default:
9+
target: 1%
10+
threshold: 1%

src/simulation/m_mpi_proxy.fpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ module m_mpi_proxy
2727
2828
use m_mpi_common
2929
30+
use m_nvtx
31+
3032
use ieee_arithmetic
3133
! ==========================================================================
3234
@@ -900,6 +902,7 @@ contains
900902
901903
#ifdef MFC_MPI
902904
905+
call nvtxStartRange("RHS-COMM-PACKBUF")
903906
!$acc update device(v_size)
904907
905908
if (qbmm .and. .not. polytropic) then
@@ -1092,6 +1095,7 @@ contains
10921095
#:endif
10931096
end if
10941097
#:endfor
1098+
call nvtxEndRange ! Packbuf
10951099
10961100
! Send/Recv
10971101
#:for rdma_mpi in [False, True]
@@ -1101,26 +1105,34 @@ contains
11011105
#:if rdma_mpi
11021106
!$acc data attach(p_send, p_recv)
11031107
!$acc host_data use_device(p_send, p_recv)
1108+
call nvtxStartRange("RHS-COMM-SENDRECV-RDMA")
11041109
#:else
1110+
call nvtxStartRange("RHS-COMM-DEV2HOST")
11051111
!$acc update host(q_cons_buff_send, ib_buff_send)
1112+
call nvtxEndRange
1113+
call nvtxStartRange("RHS-COMM-SENDRECV-NO-RMDA")
11061114
#:endif
11071115
11081116
call MPI_SENDRECV( &
11091117
p_send, buffer_count, MPI_DOUBLE_PRECISION, dst_proc, send_tag, &
11101118
p_recv, buffer_count, MPI_DOUBLE_PRECISION, src_proc, recv_tag, &
11111119
MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
1120+
call nvtxEndRange ! RHS-MPI-SENDRECV-(NO)-RDMA
11121121
11131122
#:if rdma_mpi
11141123
!$acc end host_data
11151124
!$acc end data
11161125
!$acc wait
11171126
#:else
1127+
call nvtxStartRange("RHS-COMM-HOST2DEV")
11181128
!$acc update device(q_cons_buff_recv)
1129+
call nvtxEndRange
11191130
#:endif
11201131
end if
11211132
#:endfor
11221133
11231134
! Unpack Received Buffer
1135+
call nvtxStartRange("RHS-COMM-UNPACKBUF")
11241136
#:for mpi_dir in [1, 2, 3]
11251137
if (mpi_dir == ${mpi_dir}$) then
11261138
#:if mpi_dir == 1
@@ -1289,6 +1301,7 @@ contains
12891301
#:endif
12901302
end if
12911303
#:endfor
1304+
call nvtxEndRange
12921305
12931306
#endif
12941307

src/simulation/m_rhs.fpp

Lines changed: 63 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ contains
622622
real(kind(0d0)) :: t_start, t_finish
623623
integer :: i, j, k, l, id !< Generic loop iterators
624624

625-
call nvtxStartRange("Compute_RHS")
625+
call nvtxStartRange("COMPUTE-RHS")
626626

627627
call cpu_time(t_start)
628628
! Association/Population of Working Variables ======================
@@ -668,7 +668,7 @@ contains
668668
gm_alpha_qp%vf)
669669
call nvtxEndRange
670670

671-
call nvtxStartRange("RHS-MPI")
671+
call nvtxStartRange("RHS-COMMUNICATION")
672672
call s_populate_variables_buffers(q_prim_qp%vf, pb, mv)
673673
call nvtxEndRange
674674

@@ -686,21 +686,25 @@ contains
686686

687687
if (qbmm) call s_mom_inv(q_cons_qp%vf, q_prim_qp%vf, mom_sp, mom_3d, pb, rhs_pb, mv, rhs_mv, idwbuff(1), idwbuff(2), idwbuff(3), nbub)
688688

689-
call nvtxStartRange("Viscous")
690-
if (viscous) call s_get_viscous(qL_rsx_vf, qL_rsy_vf, qL_rsz_vf, &
691-
dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n, &
692-
qL_prim, &
693-
qR_rsx_vf, qR_rsy_vf, qR_rsz_vf, &
694-
dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n, &
695-
qR_prim, &
696-
q_prim_qp, &
697-
dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp, &
698-
idwbuff(1), idwbuff(2), idwbuff(3))
699-
call nvtxEndRange
689+
if (viscous) then
690+
call nvtxStartRange("RHS-VISCOUS")
691+
call s_get_viscous(qL_rsx_vf, qL_rsy_vf, qL_rsz_vf, &
692+
dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n, &
693+
qL_prim, &
694+
qR_rsx_vf, qR_rsy_vf, qR_rsz_vf, &
695+
dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n, &
696+
qR_prim, &
697+
q_prim_qp, &
698+
dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp, &
699+
idwbuff(1), idwbuff(2), idwbuff(3))
700+
call nvtxEndRange
701+
end if
700702

701-
call nvtxStartRange("Surface_Tension")
702-
if (surface_tension) call s_get_capilary(q_prim_qp%vf)
703-
call nvtxEndRange
703+
if (surface_tension) then
704+
call nvtxStartRange("RHS-SURFACE-TENSION")
705+
call s_get_capilary(q_prim_qp%vf)
706+
call nvtxEndRange
707+
end if
704708
! Dimensional Splitting Loop =======================================
705709

706710
do id = 1, num_dims
@@ -779,6 +783,7 @@ contains
779783
end if
780784
irx%end = m; iry%end = n; irz%end = p
781785
! ===============================================================
786+
782787
! Computing Riemann Solver Flux and Source Flux =================
783788
call nvtxStartRange("RHS_riemann_solver")
784789
call s_riemann_solver(qR_rsx_vf, qR_rsy_vf, qR_rsz_vf, &
@@ -801,7 +806,7 @@ contains
801806
! ===============================================================
802807
! Additional physics and source terms ===========================
803808
! RHS addition for advection source
804-
call nvtxStartRange("RHS_advection_source")
809+
call nvtxStartRange("RHS-ADVECTION-SRC")
805810
call s_compute_advection_source_term(id, &
806811
rhs_vf, &
807812
q_cons_qp, &
@@ -810,50 +815,54 @@ contains
810815
call nvtxEndRange
811816

812817
! RHS additions for hypoelasticity
813-
call nvtxStartRange("RHS_Hypoelasticity")
818+
call nvtxStartRange("RHS-HYPOELASTICITY")
814819
if (hypoelasticity) call s_compute_hypoelastic_rhs(id, &
815820
q_prim_qp%vf, &
816821
rhs_vf)
817822
call nvtxEndRange
818823

819824
! RHS additions for viscosity
820-
call nvtxStartRange("RHS_add_phys")
821825
if (viscous .or. surface_tension) then
826+
call nvtxStartRange("RHS-ADD-PHYSICS")
822827
call s_compute_additional_physics_rhs(id, &
823828
q_prim_qp%vf, &
824829
rhs_vf, &
825830
flux_src_n(id)%vf, &
826831
dq_prim_dx_qp(1)%vf, &
827832
dq_prim_dy_qp(1)%vf, &
828833
dq_prim_dz_qp(1)%vf)
834+
call nvtxEndRange
829835
end if
830-
call nvtxEndRange
831836

832837
! RHS additions for sub-grid bubbles
833-
call nvtxStartRange("RHS_bubbles")
834-
if (bubbles) call s_compute_bubbles_rhs(id, &
835-
q_prim_qp%vf)
836-
call nvtxEndRange
838+
if (bubbles) then
839+
call nvtxStartRange("RHS-BUBBLES-COMPUTE")
840+
call s_compute_bubbles_rhs(id, q_prim_qp%vf)
841+
call nvtxEndRange
842+
end if
837843

838844
! RHS additions for qbmm bubbles
839-
call nvtxStartRange("RHS_qbmm")
840-
if (qbmm) call s_compute_qbmm_rhs(id, &
841-
q_cons_qp%vf, &
842-
q_prim_qp%vf, &
843-
rhs_vf, &
844-
flux_n(id)%vf, &
845-
pb, &
846-
rhs_pb, &
847-
mv, &
848-
rhs_mv)
849-
call nvtxEndRange
845+
846+
if (qbmm) then
847+
call nvtxStartRange("RHS-QBMM")
848+
call s_compute_qbmm_rhs(id, &
849+
q_cons_qp%vf, &
850+
q_prim_qp%vf, &
851+
rhs_vf, &
852+
flux_n(id)%vf, &
853+
pb, &
854+
rhs_pb, &
855+
mv, &
856+
rhs_mv)
857+
call nvtxEndRange
858+
end if
850859
! END: Additional physics and source terms =========================
851860

852861
end do
853862
! END: Dimensional Splitting Loop =================================
854863

855864
if (chemistry) then
856-
call nvtxStartRange("RHS_Chem_Advection")
865+
call nvtxStartRange("RHS-CHEM-ADVECTION")
857866
call s_compute_chemistry_advection_flux(flux_n, rhs_vf)
858867
call nvtxEndRange
859868
end if
@@ -875,25 +884,29 @@ contains
875884

876885
! Additional Physics and Source Temrs ==================================
877886
! Additions for acoustic_source
878-
call nvtxStartRange("RHS_acoustic_src")
879-
if (acoustic_source) call s_acoustic_src_calculations(q_cons_qp%vf(1:sys_size), &
880-
q_prim_qp%vf(1:sys_size), &
881-
t_step, &
882-
rhs_vf)
883-
call nvtxEndRange
887+
if (acoustic_source) then
888+
call nvtxStartRange("RHS-ACOUSTIC-SRC")
889+
call s_acoustic_src_calculations(q_cons_qp%vf(1:sys_size), &
890+
q_prim_qp%vf(1:sys_size), &
891+
t_step, &
892+
rhs_vf)
893+
call nvtxEndRange
894+
end if
884895

885896
! Add bubles source term
886-
call nvtxStartRange("RHS_bubbles")
887-
if (bubbles .and. (.not. adap_dt) .and. (.not. qbmm)) call s_compute_bubble_source( &
888-
q_cons_qp%vf(1:sys_size), &
889-
q_prim_qp%vf(1:sys_size), &
890-
t_step, &
891-
rhs_vf)
892-
call nvtxEndRange
897+
if (bubbles .and. (.not. adap_dt) .and. (.not. qbmm)) then
898+
call nvtxStartRange("RHS-BUBBLES-SRC")
899+
call s_compute_bubble_source( &
900+
q_cons_qp%vf(1:sys_size), &
901+
q_prim_qp%vf(1:sys_size), &
902+
t_step, &
903+
rhs_vf)
904+
call nvtxEndRange
905+
end if
893906

894907
if (chemistry) then
895908
if (chem_params%reactions) then
896-
call nvtxStartRange("RHS_Chem_Reactions")
909+
call nvtxStartRange("RHS-CHEM-REACTIONS")
897910
call s_compute_chemistry_reaction_flux(rhs_vf, q_cons_qp%vf, q_prim_qp%vf)
898911
call nvtxEndRange
899912
end if

src/simulation/m_start_up.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ contains
13561356
integer :: save_count
13571357

13581358
call cpu_time(start)
1359-
! call nvtxStartRange("I/O")
1359+
call nvtxStartRange("SAVE-DATA")
13601360
do i = 1, sys_size
13611361
!$acc update host(q_cons_ts(1)%vf(i)%sf)
13621362
do l = 0, p
@@ -1384,7 +1384,7 @@ contains
13841384

13851385
call s_write_data_files(q_cons_ts(1)%vf, q_prim_vf, save_count)
13861386

1387-
! call nvtxEndRange
1387+
call nvtxEndRange
13881388
call cpu_time(finish)
13891389
if (cfl_dt) then
13901390
nt = mytime/t_save

0 commit comments

Comments
 (0)