diff --git a/src/common/m_mpi_common.fpp b/src/common/m_mpi_common.fpp index b509e1f6ea..dca722a616 100644 --- a/src/common/m_mpi_common.fpp +++ b/src/common/m_mpi_common.fpp @@ -367,13 +367,13 @@ contains !> Reduce a local integer value to its global sum across all MPI ranks. impure subroutine s_mpi_allreduce_integer_sum(var_loc, var_glb) - integer, intent(in) :: var_loc - integer, intent(out) :: var_glb + integer(kind=8), intent(in) :: var_loc + integer(kind=8), intent(out) :: var_glb #ifdef MFC_MPI integer :: ierr !< Generic flag used to identify and report MPI errors - call MPI_ALLREDUCE(var_loc, var_glb, 1, MPI_INTEGER, MPI_SUM, MPI_COMM_WORLD, ierr) + call MPI_ALLREDUCE(var_loc, var_glb, 1, MPI_INTEGER8, MPI_SUM, MPI_COMM_WORLD, ierr) #else var_glb = var_loc #endif diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index 18eebf998e..cb206905d4 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -72,8 +72,8 @@ contains !> Initializes the values of various IBM variables, such as ghost points and image points. impure subroutine s_ibm_setup() - integer :: i, j, k - integer :: max_num_gps + integer :: i, j, k + integer(kind=8) :: max_num_gps call nvtxStartRange("SETUP-IBM-MODULE") @@ -119,10 +119,10 @@ contains ! find the number of ghost points and set them to be the maximum total across ranks call s_find_num_ghost_points(num_gps) if (moving_immersed_boundary_flag) then - call s_mpi_allreduce_integer_sum(num_gps, max_num_gps) - max_num_gps = min(max_num_gps*2, (m + 1)*(n + 1)*(p + 1)) + call s_mpi_allreduce_integer_sum(int(num_gps, 8), max_num_gps) + max_num_gps = min(max_num_gps*2_8, int(m + 1, 8)*int(n + 1, 8)*int(p + 1, 8)) else - max_num_gps = num_gps + max_num_gps = int(num_gps, 8) end if ! set the size of the ghost point arrays to be the amount of points total, plus a factor of 2 buffer @@ -1071,7 +1071,8 @@ contains subroutine s_compute_centroid_offset(ib_marker) integer, intent(in) :: ib_marker - integer :: i, j, k, num_cells, num_cells_local, decoded_gbl_id + integer :: i, j, k, num_cells_local, decoded_gbl_id + integer(kind=8) :: num_cells real(wp), dimension(1:3) :: center_of_mass, center_of_mass_local ! Offset only needs to be computes for specific geometries @@ -1098,7 +1099,7 @@ contains end do ! reduce the mass contribution over all MPI ranks and compute COM - call s_mpi_allreduce_integer_sum(num_cells_local, num_cells) + call s_mpi_allreduce_integer_sum(int(num_cells_local, 8), num_cells) if (num_cells /= 0) then call s_mpi_allreduce_sum(center_of_mass_local(1), center_of_mass(1)) call s_mpi_allreduce_sum(center_of_mass_local(2), center_of_mass(2))