Skip to content

Commit

Permalink
int overflow fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand authored and Anand committed Feb 21, 2025
1 parent 2cb2dff commit 0da1c77
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/simulation/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,11 @@ contains
if (qbmm .and. .not. polytropic) then
if (n > 0) then
if (p > 0) then
halo_size = -1 + buff_size*(sys_size + 2*nb*4)* &
halo_size = NINT(-1d0 + 1d0 * buff_size*(sys_size + 2*nb*4)* &
& (m + 2*buff_size + 1)* &
& (n + 2*buff_size + 1)* &
& (p + 2*buff_size + 1)/ &
& (min(m, n, p) + 2*buff_size + 1)
& (p + 2*buff_size + 1)/ &
& (min(m, n, p) + 2*buff_size + 1))
else
halo_size = -1 + buff_size*(sys_size + 2*nb*4)* &
& (max(m, n) + 2*buff_size + 1)
Expand All @@ -114,11 +113,11 @@ contains
if (n > 0) then
if (p > 0) then
halo_size = -1 + buff_size*sys_size* &
halo_size = NINT(-1d0 + 1d0 * buff_size*sys_size* &
& (m + 2*buff_size + 1)* &
& (n + 2*buff_size + 1)* &
& (p + 2*buff_size + 1)/ &
& (min(m, n, p) + 2*buff_size + 1)
& (p + 2*buff_size + 1)/ &
& (min(m, n, p) + 2*buff_size + 1))
else
halo_size = -1 + buff_size*sys_size* &
& (max(m, n) + 2*buff_size + 1)
Expand Down

0 comments on commit 0da1c77

Please sign in to comment.