Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfonba committed Mar 9, 2025
1 parent 2422b29 commit e63a112
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
16 changes: 12 additions & 4 deletions src/common/m_mpi_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,19 +649,23 @@ contains
call nvtxStartRange("RHS-COMM-PACKBUF")
!$acc update device(v_size)
#ifdef MFC_SIMULATION
if (qbmm .and. .not. polytropic) then
buffer_counts = (/ &
buff_size*(sys_size + 2*nb*4)*(n + 1)*(p + 1), &
buff_size*(sys_size + 2*nb*4)*(m + 2*buff_size + 1)*(p + 1), &
buff_size*v_size*(m + 2*buff_size + 1)*(n + 2*buff_size + 1) &
/)
else
#endif
buffer_counts = (/ &
buff_size*sys_size*(n + 1)*(p + 1), &
buff_size*sys_size*(m + 2*buff_size + 1)*(p + 1), &
buff_size*v_size*(m + 2*buff_size + 1)*(n + 2*buff_size + 1) &
/)
#ifdef MFC_SIMULATION
end if
#endif
buffer_count = buffer_counts(mpi_dir)
boundary_conditions = (/bc_x, bc_y, bc_z/)
Expand Down Expand Up @@ -850,8 +854,8 @@ contains
p_send => q_prims_buff_send(0)
p_recv => q_prims_buff_recv(0)
#ifdef MFC_SIMULATION
! Send/Recv
#ifdef MFC_SIMULATION
#:for rdma_mpi in [False, True]
if (rdma_mpi .eqv. ${'.true.' if rdma_mpi else '.false.'}$) then
#:if rdma_mpi
Expand All @@ -864,14 +868,13 @@ contains
call nvtxEndRange
call nvtxStartRange("RHS-COMM-SENDRECV-NO-RMDA")
#:endif
#endif MFC_SIMULATION
call MPI_SENDRECV( &
p_send, buffer_count, mpi_p, dst_proc, send_tag, &
p_recv, buffer_count, mpi_p, src_proc, recv_tag, &
MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
#ifdef MFC_SIMULATION
call nvtxEndRange ! RHS-MPI-SENDRECV-(NO)-RDMA
#:if rdma_mpi
Expand All @@ -885,7 +888,12 @@ contains
#:endif
end if
#:endfor
#endif MFC_SIMULATION
#else
call MPI_SENDRECV( &
p_send, buffer_count, mpi_p, dst_proc, send_tag, &
p_recv, buffer_count, mpi_p, src_proc, recv_tag, &
MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr)
#endif
! Unpack Received Buffer
call nvtxStartRange("RHS-COMM-UNPACKBUF")
Expand Down
12 changes: 6 additions & 6 deletions src/post_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,31 +787,31 @@ contains

! Allocating single precision grid variables if needed
if (precision == 1) then
allocate (x_cb_s(-1:m))
allocate (x_cb_s(-1 - offset_x%beg:m + offset_x%end))
if (n > 0) then
allocate (y_cb_s(-1:n))
allocate (y_cb_s(-1 - offset_y%beg:n + offset_y%end))
if (p > 0) then
allocate (z_cb_s(-1:m))
allocate (z_cb_s(-1 - offset_z%beg:p + offset_z%end))
end if
end if
else
allocate (x_cc_s(-buff_size:m + buff_size))
end if

! Allocating the grid variables in the x-coordinate direction
allocate (x_cb(-1:m))
allocate (x_cb(-1 - offset_x%beg:m + offset_x%end))
allocate (x_cc(-buff_size:m + buff_size))
allocate (dx(-buff_size:m + buff_size))

! Allocating grid variables in the y- and z-coordinate directions
if (n > 0) then

allocate (y_cb(-1:n))
allocate (y_cb(-1 - offset_y%beg:n + offset_y%end))
allocate (y_cc(-buff_size:n + buff_size))
allocate (dy(-buff_size:n + buff_size))

if (p > 0) then
allocate (z_cb(-1:p))
allocate (z_cb(-1 - offset_z%beg:p + offset_z%end))
allocate (z_cc(-buff_size:p + buff_size))
allocate (dz(-buff_size:p + buff_size))
end if
Expand Down

0 comments on commit e63a112

Please sign in to comment.