Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/post_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
integer :: i, j, fac

! Setting m_root equal to m in the case of a 1D serial simulation
if (num_procs > 1 .and. n == 0) m_root = m_glb
if (n == 0) m_root = m_glb

! Gamma/Pi_inf Model
if (model_eqns == 1) then
Expand Down Expand Up @@ -932,7 +932,7 @@
if (n > 0) then
deallocate (y_cc, y_cb, dy)
if (p > 0) then
deallocate (z_cc, z_cb, dz)

Check warning on line 935 in src/post_process/m_global_parameters.fpp

View check run for this annotation

Codecov / codecov/patch

src/post_process/m_global_parameters.fpp#L935

Added line #L935 was not covered by tests
end if
else
! Deallocating the grid variables, only used for the 1D simulations,
Expand Down
2 changes: 2 additions & 0 deletions src/simulation/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
& (max(m, n) + 2*gp_layers + 1)
end if
else
i_halo_size = -1 + gp_layers

Check warning on line 71 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L71

Added line #L71 was not covered by tests
end if

!$acc update device(i_halo_size)
@:ALLOCATE(ib_buff_send(0:i_halo_size), ib_buff_recv(0:i_halo_size))

Check warning on line 75 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L75

Added line #L75 was not covered by tests
end if
#endif

Expand Down Expand Up @@ -235,7 +235,7 @@

end subroutine s_mpi_bcast_user_inputs

subroutine s_mpi_sendrecv_ib_buffers(ib_markers, mpi_dir, pbc_loc)

Check warning on line 238 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L238

Added line #L238 was not covered by tests

type(integer_field), intent(inout) :: ib_markers

Expand All @@ -257,18 +257,18 @@

#ifdef MFC_MPI

call nvtxStartRange("RHS-COMM-PACKBUF")

Check warning on line 260 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L260

Added line #L260 was not covered by tests

buffer_counts = (/ &
gp_layers*(n + 1)*(p + 1), &
gp_layers*(m + 2*gp_layers + 1)*(p + 1), &
gp_layers*(m + 2*gp_layers + 1)*(n + 2*gp_layers + 1) &
/)

Check warning on line 266 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L266

Added line #L266 was not covered by tests

buffer_count = buffer_counts(mpi_dir)
boundary_conditions = (/bc_x, bc_y, bc_z/)
beg_end = (/boundary_conditions(mpi_dir)%beg, boundary_conditions(mpi_dir)%end/)
beg_end_geq_0 = beg_end(max(pbc_loc, 0) - pbc_loc + 1) >= 0

Check warning on line 271 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L268-L271

Added lines #L268 - L271 were not covered by tests

! Implements:
! pbc_loc bc_x >= 0 -> [send/recv]_tag [dst/src]_proc
Expand All @@ -277,22 +277,22 @@
! +1 (=1) 0 -> [0,1] [1,1] | 1 0 [0,1] [end,end]
! +1 (=1) 1 -> [1,1] [0,1] | 1 1 [1,1] [beg,end]

send_tag = f_logical_to_int(.not. f_xor(beg_end_geq_0, pbc_loc == 1))
recv_tag = f_logical_to_int(pbc_loc == 1)

Check warning on line 281 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L280-L281

Added lines #L280 - L281 were not covered by tests

dst_proc = beg_end(1 + f_logical_to_int(f_xor(pbc_loc == 1, beg_end_geq_0)))
src_proc = beg_end(1 + f_logical_to_int(pbc_loc == 1))

Check warning on line 284 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L283-L284

Added lines #L283 - L284 were not covered by tests

grid_dims = (/m, n, p/)

Check warning on line 286 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L286

Added line #L286 was not covered by tests

pack_offset = 0
if (f_xor(pbc_loc == 1, beg_end_geq_0)) then
pack_offset = grid_dims(mpi_dir) - gp_layers + 1

Check warning on line 290 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L290

Added line #L290 was not covered by tests
end if

unpack_offset = 0
if (pbc_loc == 1) then
unpack_offset = grid_dims(mpi_dir) + gp_layers + 1

Check warning on line 295 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L295

Added line #L295 was not covered by tests
end if

! Pack Buffer to Send
Expand All @@ -300,43 +300,43 @@
if (mpi_dir == ${mpi_dir}$) then
#:if mpi_dir == 1
!$acc parallel loop collapse(3) gang vector default(present) private(r)
do l = 0, p
do k = 0, n
do j = 0, gp_layers - 1
r = (j + gp_layers*(k + (n + 1)*l))
ib_buff_send(r) = ib_markers%sf(j + pack_offset, k, l)

Check warning on line 307 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L303-L307

Added lines #L303 - L307 were not covered by tests
end do
end do
end do
#:elif mpi_dir == 2
!$acc parallel loop collapse(3) gang vector default(present) private(r)
do l = 0, p
do k = 0, gp_layers - 1
do j = -gp_layers, m + gp_layers

Check warning on line 315 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L313-L315

Added lines #L313 - L315 were not covered by tests
r = ((j + gp_layers) + (m + 2*gp_layers + 1)* &
(k + gp_layers*l))
ib_buff_send(r) = ib_markers%sf(j, k + pack_offset, l)

Check warning on line 318 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L317-L318

Added lines #L317 - L318 were not covered by tests
end do
end do
end do
#:else
!$acc parallel loop collapse(3) gang vector default(present) private(r)
do l = 0, gp_layers - 1
do k = -gp_layers, n + gp_layers
do j = -gp_layers, m + gp_layers

Check warning on line 326 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L324-L326

Added lines #L324 - L326 were not covered by tests
r = ((j + gp_layers) + (m + 2*gp_layers + 1)* &
((k + gp_layers) + (n + 2*gp_layers + 1)*l))
ib_buff_send(r) = ib_markers%sf(j, k, l + pack_offset)

Check warning on line 329 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L328-L329

Added lines #L328 - L329 were not covered by tests
end do
end do
end do
#:endif
end if
#:endfor
call nvtxEndRange ! Packbuf

Check warning on line 336 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L336

Added line #L336 was not covered by tests

p_i_send => ib_buff_send(0)
p_i_recv => ib_buff_recv(0)

Check warning on line 339 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L338-L339

Added lines #L338 - L339 were not covered by tests

! Send/Recv
#:for rdma_mpi in [False, True]
Expand All @@ -344,75 +344,75 @@
#:if rdma_mpi
!$acc data attach(p_i_send, p_i_recv)
!$acc host_data use_device(p_i_send, p_i_recv)
call nvtxStartRange("RHS-COMM-SENDRECV-RDMA")

Check warning on line 347 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L347

Added line #L347 was not covered by tests
#:else
call nvtxStartRange("RHS-COMM-DEV2HOST")

Check warning on line 349 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L349

Added line #L349 was not covered by tests
!$acc update host(ib_buff_send)
call nvtxEndRange
call nvtxStartRange("RHS-COMM-SENDRECV-NO-RMDA")

Check warning on line 352 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L351-L352

Added lines #L351 - L352 were not covered by tests
#:endif

call MPI_SENDRECV( &
p_i_send, buffer_count, MPI_INTEGER, dst_proc, send_tag, &
p_i_recv, buffer_count, MPI_INTEGER, src_proc, recv_tag, &
MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)

Check warning on line 358 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L358

Added line #L358 was not covered by tests

call nvtxEndRange ! RHS-MPI-SENDRECV-(NO)-RDMA

Check warning on line 360 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L360

Added line #L360 was not covered by tests

#:if rdma_mpi
!$acc end host_data
!$acc end data
!$acc wait
#:else
call nvtxStartRange("RHS-COMM-HOST2DEV")

Check warning on line 367 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L367

Added line #L367 was not covered by tests
!$acc update device(ib_buff_recv)
call nvtxEndRange

Check warning on line 369 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L369

Added line #L369 was not covered by tests
#:endif
end if
#:endfor

! Unpack Received Buffer
call nvtxStartRange("RHS-COMM-UNPACKBUF")

Check warning on line 375 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L375

Added line #L375 was not covered by tests
#:for mpi_dir in [1, 2, 3]
if (mpi_dir == ${mpi_dir}$) then
#:if mpi_dir == 1
!$acc parallel loop collapse(3) gang vector default(present) private(r)
do l = 0, p
do k = 0, n
do j = -gp_layers, -1
r = (j + gp_layers*((k + 1) + (n + 1)*l))
ib_markers%sf(j + unpack_offset, k, l) = ib_buff_recv(r)

Check warning on line 384 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L380-L384

Added lines #L380 - L384 were not covered by tests
end do
end do
end do
#:elif mpi_dir == 2
!$acc parallel loop collapse(3) gang vector default(present) private(r)
do l = 0, p
do k = -gp_layers, -1
do j = -gp_layers, m + gp_layers

Check warning on line 392 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L390-L392

Added lines #L390 - L392 were not covered by tests
r = ((j + gp_layers) + (m + 2*gp_layers + 1)* &
((k + gp_layers) + gp_layers*l))
ib_markers%sf(j, k + unpack_offset, l) = ib_buff_recv(r)

Check warning on line 395 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L394-L395

Added lines #L394 - L395 were not covered by tests
end do
end do
end do
#:else
! Unpacking buffer from bc_z%beg
!$acc parallel loop collapse(3) gang vector default(present) private(r)
do l = -gp_layers, -1
do k = -gp_layers, n + gp_layers
do j = -gp_layers, m + gp_layers

Check warning on line 404 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L402-L404

Added lines #L402 - L404 were not covered by tests
r = ((j + gp_layers) + (m + 2*gp_layers + 1)* &
((k + gp_layers) + (n + 2*gp_layers + 1)* &
(l + gp_layers)))
ib_markers%sf(j, k, l + unpack_offset) = ib_buff_recv(r)

Check warning on line 408 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L407-L408

Added lines #L407 - L408 were not covered by tests
end do
end do
end do
#:endif
end if
#:endfor
call nvtxEndRange

Check warning on line 415 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L415

Added line #L415 was not covered by tests
#endif

end subroutine s_mpi_sendrecv_ib_buffers
Expand All @@ -429,9 +429,11 @@

subroutine s_finalize_mpi_proxy_module()

#ifdef MFC_MPI
if (ib) then
@:DEALLOCATE(ib_buff_send, ib_buff_recv)

Check warning on line 434 in src/simulation/m_mpi_proxy.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_mpi_proxy.fpp#L434

Added line #L434 was not covered by tests
end if
#endif

end subroutine s_finalize_mpi_proxy_module

Expand Down
Loading