Skip to content

Commit 987105d

Browse files
NVHPC newer than 23.11 appears to have an issue with cycle vs exit for named loops in GPU regions, causing a hang. It also was defaulting the z bounds to int max, forcing the periodic collision check loop to cycle for over 30 min.
1 parent bd5fe04 commit 987105d

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/simulation/m_collisions.fpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ contains
350350
do pid1 = 1, num_ibs - 1
351351
centroid_1 = [patch_ib(pid1)%x_centroid, patch_ib(pid1)%y_centroid, 0._wp]
352352
if (num_dims == 3) centroid_1(3) = patch_ib(pid1)%z_centroid
353-
collision_partner_loop: do pid2 = pid1 + 1, num_ibs
354-
do xp = xp_lower, xp_upper
353+
do pid2 = pid1 + 1, num_ibs
354+
periodic_search: do xp = xp_lower, xp_upper
355355
do yp = yp_lower, yp_upper
356356
do zp = zp_lower, zp_upper
357357
centroid_2(1) = patch_ib(pid2)%x_centroid + real(xp, wp)*(x_domain%end - x_domain%beg)
@@ -372,12 +372,12 @@ contains
372372
collision_lookup(current_collisions, 2) = pid2
373373
collision_lookup(current_collisions, 3) = patch_ib(pid1)%gbl_patch_id
374374
collision_lookup(current_collisions, 4) = encoded_pid2
375-
cycle collision_partner_loop
375+
exit periodic_search
376376
end if
377377
end do
378378
end do
379-
end do
380-
end do collision_partner_loop
379+
end do periodic_search
380+
end do
381381
end do
382382
$:END_GPU_PARALLEL_LOOP()
383383

src/simulation/m_ib_patches.fpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,14 +679,17 @@ contains
679679
#:endfor
680680
681681
! z only if 3D
682-
if (present(zp_lower) .and. p /= 0) then
682+
if (present(zp_lower) .and. num_dims == 3) then
683683
if (ib_bc_z%beg == BC_PERIODIC) then
684684
zp_lower = -1
685685
zp_upper = 1
686686
else
687687
zp_lower = 0
688688
zp_upper = 0
689689
end if
690+
else if (present(zp_lower)) then
691+
zp_lower = 0
692+
zp_upper = 0
690693
end if
691694
692695
end subroutine s_get_periodicities

0 commit comments

Comments
 (0)