Skip to content

Commit 6339c43

Browse files
authored
Merge branch 'MFlowCode:master' into source
2 parents 03f320e + a79e2e0 commit 6339c43

File tree

6 files changed

+106
-70
lines changed

6 files changed

+106
-70
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
@@ -865,6 +867,7 @@ contains
865867
866868
#ifdef MFC_MPI
867869
870+
call nvtxStartRange("RHS-COMM-PACKBUF")
868871
!$acc update device(v_size)
869872
870873
if (qbmm .and. .not. polytropic) then
@@ -1057,6 +1060,7 @@ contains
10571060
#:endif
10581061
end if
10591062
#:endfor
1063+
call nvtxEndRange ! Packbuf
10601064
10611065
! Send/Recv
10621066
#:for rdma_mpi in [False, True]
@@ -1066,26 +1070,34 @@ contains
10661070
#:if rdma_mpi
10671071
!$acc data attach(p_send, p_recv)
10681072
!$acc host_data use_device(p_send, p_recv)
1073+
call nvtxStartRange("RHS-COMM-SENDRECV-RDMA")
10691074
#:else
1075+
call nvtxStartRange("RHS-COMM-DEV2HOST")
10701076
!$acc update host(q_cons_buff_send, ib_buff_send)
1077+
call nvtxEndRange
1078+
call nvtxStartRange("RHS-COMM-SENDRECV-NO-RMDA")
10711079
#:endif
10721080
10731081
call MPI_SENDRECV( &
10741082
p_send, buffer_count, MPI_DOUBLE_PRECISION, dst_proc, send_tag, &
10751083
p_recv, buffer_count, MPI_DOUBLE_PRECISION, src_proc, recv_tag, &
10761084
MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
1085+
call nvtxEndRange ! RHS-MPI-SENDRECV-(NO)-RDMA
10771086
10781087
#:if rdma_mpi
10791088
!$acc end host_data
10801089
!$acc end data
10811090
!$acc wait
10821091
#:else
1092+
call nvtxStartRange("RHS-COMM-HOST2DEV")
10831093
!$acc update device(q_cons_buff_recv)
1094+
call nvtxEndRange
10841095
#:endif
10851096
end if
10861097
#:endfor
10871098
10881099
! Unpack Received Buffer
1100+
call nvtxStartRange("RHS-COMM-UNPACKBUF")
10891101
#:for mpi_dir in [1, 2, 3]
10901102
if (mpi_dir == ${mpi_dir}$) then
10911103
#:if mpi_dir == 1
@@ -1254,6 +1266,7 @@ contains
12541266
#:endif
12551267
end if
12561268
#:endfor
1269+
call nvtxEndRange
12571270
12581271
#endif
12591272

src/simulation/m_rhs.fpp

Lines changed: 63 additions & 51 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 ======================
@@ -669,7 +669,7 @@ contains
669669
gm_alpha_qp%vf)
670670
call nvtxEndRange
671671

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

@@ -683,21 +683,25 @@ contains
683683

684684
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)
685685

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

698-
call nvtxStartRange("Surface_Tension")
699-
if (surface_tension) call s_get_capilary(q_prim_qp%vf)
700-
call nvtxEndRange
700+
if (surface_tension) then
701+
call nvtxStartRange("RHS-SURFACE-TENSION")
702+
call s_get_capilary(q_prim_qp%vf)
703+
call nvtxEndRange
704+
end if
701705
! Dimensional Splitting Loop =======================================
702706

703707
do id = 1, num_dims
@@ -777,7 +781,7 @@ contains
777781
irx%end = m; iry%end = n; irz%end = p
778782
! ===============================================================
779783

780-
call nvtxStartRange("RHS_riemann_solver")
784+
call nvtxStartRange("RHS-RIEMANN-SOLVER")
781785

782786
! Computing Riemann Solver Flux and Source Flux =================
783787

@@ -801,7 +805,7 @@ contains
801805
! Additional physics and source terms ==============================
802806

803807
! RHS addition for advection source
804-
call nvtxStartRange("RHS_advection_source")
808+
call nvtxStartRange("RHS-ADVECTION-SRC")
805809
call s_compute_advection_source_term(id, &
806810
rhs_vf, &
807811
q_cons_qp, &
@@ -810,50 +814,54 @@ contains
810814
call nvtxEndRange
811815

812816
! RHS additions for hypoelasticity
813-
call nvtxStartRange("RHS_Hypoelasticity")
817+
call nvtxStartRange("RHS-HYPOELASTICITY")
814818
if (hypoelasticity) call s_compute_hypoelastic_rhs(id, &
815819
q_prim_qp%vf, &
816820
rhs_vf)
817821
call nvtxEndRange
818822

819823
! RHS additions for viscosity
820-
call nvtxStartRange("RHS_add_phys")
821824
if (viscous .or. surface_tension) then
825+
call nvtxStartRange("RHS-ADD-PHYSICS")
822826
call s_compute_additional_physics_rhs(id, &
823827
q_prim_qp%vf, &
824828
rhs_vf, &
825829
flux_src_n(id)%vf, &
826830
dq_prim_dx_qp(1)%vf, &
827831
dq_prim_dy_qp(1)%vf, &
828832
dq_prim_dz_qp(1)%vf)
833+
call nvtxEndRange
829834
end if
830-
call nvtxEndRange
831835

832836
! 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
837+
if (bubbles) then
838+
call nvtxStartRange("RHS-BUBBLES-COMPUTE")
839+
call s_compute_bubbles_rhs(id, q_prim_qp%vf)
840+
call nvtxEndRange
841+
end if
837842

838843
! 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
844+
845+
if (qbmm) then
846+
call nvtxStartRange("RHS-QBMM")
847+
call s_compute_qbmm_rhs(id, &
848+
q_cons_qp%vf, &
849+
q_prim_qp%vf, &
850+
rhs_vf, &
851+
flux_n(id)%vf, &
852+
pb, &
853+
rhs_pb, &
854+
mv, &
855+
rhs_mv)
856+
call nvtxEndRange
857+
end if
850858
! END: Additional physics and source terms =========================
851859

852860
end do
853861
! END: Dimensional Splitting Loop =================================
854862

855863
if (chemistry) then
856-
call nvtxStartRange("RHS_Chem_Advection")
864+
call nvtxStartRange("RHS-CHEM-ADVECTION")
857865
call s_compute_chemistry_advection_flux(flux_n, rhs_vf)
858866
call nvtxEndRange
859867
end if
@@ -875,25 +883,29 @@ contains
875883

876884
! Additional Physics and Source Temrs ==================================
877885
! 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
886+
if (acoustic_source) then
887+
call nvtxStartRange("RHS-ACOUSTIC-SRC")
888+
call s_acoustic_src_calculations(q_cons_qp%vf(1:sys_size), &
889+
q_prim_qp%vf(1:sys_size), &
890+
t_step, &
891+
rhs_vf)
892+
call nvtxEndRange
893+
end if
884894

885895
! 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
896+
if (bubbles .and. (.not. adap_dt) .and. (.not. qbmm)) then
897+
call nvtxStartRange("RHS-BUBBLES-SRC")
898+
call s_compute_bubble_source( &
899+
q_cons_qp%vf(1:sys_size), &
900+
q_prim_qp%vf(1:sys_size), &
901+
t_step, &
902+
rhs_vf)
903+
call nvtxEndRange
904+
end if
893905

894906
if (chemistry) then
895907
if (chem_params%reactions) then
896-
call nvtxStartRange("RHS_Chem_Reactions")
908+
call nvtxStartRange("RHS-CHEM-REACTIONS")
897909
call s_compute_chemistry_reaction_flux(rhs_vf, q_cons_qp%vf, q_prim_qp%vf)
898910
call nvtxEndRange
899911
end if

src/simulation/m_start_up.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ contains
13521352
integer :: save_count
13531353

13541354
call cpu_time(start)
1355-
! call nvtxStartRange("I/O")
1355+
call nvtxStartRange("SAVE-DATA")
13561356
do i = 1, sys_size
13571357
!$acc update host(q_cons_ts(1)%vf(i)%sf)
13581358
do l = 0, p
@@ -1380,7 +1380,7 @@ contains
13801380

13811381
call s_write_data_files(q_cons_ts(1)%vf, q_prim_vf, save_count)
13821382

1383-
! call nvtxEndRange
1383+
call nvtxEndRange
13841384
call cpu_time(finish)
13851385
if (cfl_dt) then
13861386
nt = mytime/t_save

0 commit comments

Comments
 (0)