Skip to content

Commit 98b3811

Browse files
Guards to prevent seg faults in case optimization
1 parent a30d895 commit 98b3811

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/simulation/m_global_parameters.fpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,15 @@ module m_global_parameters
218218
!> (bc_x/y/z get overwritten with MPI neighbor ranks during decomposition)
219219
!> @{
220220
type(int_bounds_info) :: ib_bc_x, ib_bc_y, ib_bc_z
221-
$:GPU_DECLARE(create='[ib_bc_x, ib_bc_y, ib_bc_z]')
222-
!> @}ib_bc_z
221+
!> @}
223222
#if defined(MFC_OpenACC)
224223
$:GPU_DECLARE(create='[bc_x%vb1, bc_x%vb2, bc_x%vb3, bc_x%ve1, bc_x%ve2, bc_x%ve3]')
225224
$:GPU_DECLARE(create='[bc_y%vb1, bc_y%vb2, bc_y%vb3, bc_y%ve1, bc_y%ve2, bc_y%ve3]')
226225
$:GPU_DECLARE(create='[bc_z%vb1, bc_z%vb2, bc_z%vb3, bc_z%ve1, bc_z%ve2, bc_z%ve3]')
226+
$:GPU_DECLARE(create='[ib_bc_x%beg, ib_bc_y%beg, ib_bc_z%beg]')
227227
#elif defined(MFC_OpenMP)
228228
$:GPU_DECLARE(create='[bc_x, bc_y, bc_z]')
229+
$:GPU_DECLARE(create='[ib_bc_x, ib_bc_y, ib_bc_z]')
229230
#endif
230231
type(bounds_info) :: x_domain, y_domain, z_domain
231232
$:GPU_DECLARE(create='[x_domain, y_domain, z_domain]')

src/simulation/m_ibm.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ contains
8282
$:GPU_UPDATE(device='[patch_ib(1:num_ibs)]')
8383

8484
! GPU routines require updated cell centers
85-
$:GPU_UPDATE(device='[num_ibs, x_cc, y_cc, dx, dy, x_domain, y_domain, ib_bc_x, ib_bc_y]')
85+
$:GPU_UPDATE(device='[num_ibs, x_cc, y_cc, dx, dy, x_domain, y_domain, ib_bc_x%beg, ib_bc_y%beg]')
8686
if (p /= 0) then
87-
$:GPU_UPDATE(device='[z_cc, dz, z_domain, ib_bc_z]')
87+
$:GPU_UPDATE(device='[z_cc, dz, z_domain, ib_bc_z%beg]')
8888
end if
8989

9090
! allocate STL models

0 commit comments

Comments
 (0)