Skip to content

Commit e8c778e

Browse files
Added profiling and increased maximum num IBs to 1000
1 parent 0a304a2 commit e8c778e

5 files changed

Lines changed: 23 additions & 6 deletions

File tree

src/common/m_constants.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module m_constants
2222
integer, parameter :: fourier_rings = 5 !< Fourier filter ring limit
2323
integer, parameter :: num_fluids_max = 10 !< Maximum number of fluids in the simulation
2424
integer, parameter :: num_probes_max = 10 !< Maximum number of flow probes in the simulation
25-
integer, parameter :: num_patches_max = 10
25+
integer, parameter :: num_patches_max = 1000
2626
integer, parameter :: num_bc_patches_max = 10
2727
integer, parameter :: pathlen_max = 400
2828
integer, parameter :: nnode = 4 !< Number of QBMM nodes

src/simulation/m_ibm.fpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ contains
8484
integer :: i, j, k
8585
integer :: max_num_gps, max_num_inner_gps
8686

87+
call nvtxStartRange("SETUP-IBM-MODULE")
88+
8789
! do all set up for moving immersed boundaries
8890
moving_immersed_boundary_flag = .false.
8991
do i = 1, num_ibs
@@ -108,7 +110,7 @@ contains
108110
ib_markers%sf = 0._wp
109111
$:GPU_UPDATE(device='[ib_markers%sf]')
110112
call s_apply_ib_patches(ib_markers)
111-
! call s_populate_ib_buffers()
113+
call s_populate_ib_buffers()
112114
$:GPU_UPDATE(host='[ib_markers%sf]')
113115
do i = 1, num_ibs
114116
if (patch_ib(i)%moving_ibm /= 0) call s_compute_centroid_offset(i) ! offsets are computed after IB markers are generated
@@ -141,6 +143,8 @@ contains
141143
call s_compute_interpolation_coeffs(ghost_points)
142144
$:GPU_UPDATE(device='[ghost_points]')
143145

146+
call nvtxEndRange
147+
144148
end subroutine s_ibm_setup
145149

146150
subroutine s_populate_ib_buffers()
@@ -989,6 +993,8 @@ contains
989993
990994
integer :: i, ierr
991995
996+
call nvtxStartRange("UPDATE-MIB")
997+
992998
! Clears the existing immersed boundary indices
993999
ib_markers%sf = 0._wp
9941000
@@ -1002,9 +1008,12 @@ contains
10021008
$:GPU_UPDATE(device='[patch_ib]')
10031009
10041010
! recompute the new ib_patch locations and broadcast them.
1005-
$:GPU_UPDATE(device='[ib_markers%sf]')
1011+
call nvtxStartRange("COMPUTE-IB-MARKERS")
1012+
$:GPU_UPDATE(device='[ib_markers%sf]')
10061013
call s_apply_ib_patches(ib_markers)
1014+
call s_populate_ib_buffers()
10071015
$:GPU_UPDATE(host='[ib_markers%sf]')
1016+
call nvtxEndRange
10081017
10091018
! recalculate the ghost point locations and coefficients
10101019
call s_find_num_ghost_points(num_gps, num_inner_gps)
@@ -1013,15 +1022,19 @@ contains
10131022
call s_find_ghost_points(ghost_points, inner_points)
10141023
$:GPU_UPDATE(device='[ghost_points, inner_points]')
10151024
1025+
call nvtxStartRange("APPLY-LEVELSET")
10161026
call s_apply_levelset(ghost_points, num_gps)
10171027
$:GPU_UPDATE(device='[ghost_points]')
1028+
call nvtxEndRange
10181029
10191030
call s_compute_image_points(ghost_points)
10201031
$:GPU_UPDATE(device='[ghost_points]')
10211032
10221033
call s_compute_interpolation_coeffs(ghost_points)
10231034
$:GPU_UPDATE(device='[ghost_points]')
10241035
1036+
call nvtxEndRange
1037+
10251038
end subroutine s_update_mib
10261039
10271040
! compute the surface integrals of the IB via a volume integraion method described in

src/simulation/m_time_steppers.fpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,8 @@ contains
802802
integer :: i
803803
logical :: forces_computed
804804

805+
call nvtxStartRange("PROPAGATE-IMERSED-BOUNDARIES")
806+
805807
forces_computed = .false.
806808

807809
do i = 1, num_ibs
@@ -849,6 +851,8 @@ contains
849851

850852
call s_update_mib(num_ibs)
851853

854+
call nvtxEndRange
855+
852856
end subroutine s_propagate_immersed_boundaries
853857

854858
!> This subroutine saves the temporary q_prim_vf vector

toolchain/mfc/case_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ def check_ibm(self):
684684

685685
self.prohibit(ib and n <= 0,
686686
"Immersed Boundaries do not work in 1D (requires n > 0)")
687-
self.prohibit(ib and (num_ibs <= 0 or num_ibs > 10),
687+
self.prohibit(ib and (num_ibs <= 0 or num_ibs > 1000),
688688
"num_ibs must be between 1 and num_patches_max (10)")
689689
self.prohibit(not ib and num_ibs > 0,
690690
"num_ibs is set, but ib is not enabled")

toolchain/mfc/params/definitions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from .registry import REGISTRY
1212

1313
# Index limits
14-
NP, NF, NI, NA, NPR, NB = 10, 10, 10, 4, 10, 10 # patches, fluids, ibs, acoustic, probes, bc_patches
14+
NP, NF, NI, NA, NPR, NB = 10, 10, 1000, 4, 10, 10 # patches, fluids, ibs, acoustic, probes, bc_patches
1515

1616

1717
# =============================================================================
@@ -672,7 +672,7 @@ def get_value_label(param_name: str, value: int) -> str:
672672
# Counts (must be positive)
673673
"num_fluids": {"min": 1, "max": 10},
674674
"num_patches": {"min": 0, "max": 10},
675-
"num_ibs": {"min": 0, "max": 10},
675+
"num_ibs": {"min": 0, "max": 1000},
676676
"num_source": {"min": 1},
677677
"num_probes": {"min": 1},
678678
"num_integrals": {"min": 1},

0 commit comments

Comments
 (0)