p-costa / SNaC

A multi-block solver for massively parallel direct numerical simulations (DNS) of fluid flows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

avoid integer overflow

p-costa opened this issue · comments

the following lines under initmpi.f90 may result in an integer overflow for very large systems, especially ntot_sum. The overflow has no major consequences for the calculation, since it is just used to log information about the load distribution).

    ntot = product(hi(:)-lo(:)+1)
    call MPI_ALLREDUCE(ntot,ntot_min,1,MPI_INTEGER,MPI_MIN,MPI_COMM_WORLD)
    call MPI_ALLREDUCE(ntot,ntot_max,1,MPI_INTEGER,MPI_MAX,MPI_COMM_WORLD)
    call MPI_ALLREDUCE(ntot,ntot_sum,1,MPI_INTEGER,MPI_SUM,MPI_COMM_WORLD)