Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue with LONG_INT #37

Merged
merged 1 commit into from
Nov 28, 2021
Merged
Changes from all commits
Commits
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
10 changes: 7 additions & 3 deletions src/initmpi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ subroutine initmpi(my_block,id_first,dims,cbc,bc,periods,lmin,lmax,gt,gr,lo,hi,n
integer :: i,j,k,idir,iidir,inb,irank
logical :: is_nb,found_friend
integer(i8) :: ntot,ntot_max,ntot_min,ntot_sum
integer :: isize
type(MPI_DATATYPE) :: MPI_INTEGER_I8
!
call MPI_COMM_SIZE(MPI_COMM_WORLD,nrank)
call MPI_COMM_SPLIT(MPI_COMM_WORLD,my_block,myid,comm_block)
Expand Down Expand Up @@ -169,9 +171,11 @@ subroutine initmpi(my_block,id_first,dims,cbc,bc,periods,lmin,lmax,gt,gr,lo,hi,n
! check distribution of grid points over the different tasks
!
ntot = product(hi(:)-lo(:)+1_i8)
call MPI_ALLREDUCE(ntot,ntot_min,1,MPI_LONG,MPI_MIN,MPI_COMM_WORLD)
call MPI_ALLREDUCE(ntot,ntot_max,1,MPI_LONG,MPI_MAX,MPI_COMM_WORLD)
call MPI_ALLREDUCE(ntot,ntot_sum,1,MPI_LONG,MPI_SUM,MPI_COMM_WORLD)
call MPI_SIZEOF(1_i8,isize)
call MPI_TYPE_MATCH_SIZE(MPI_TYPECLASS_INTEGER,isize,MPI_INTEGER_I8)
call MPI_ALLREDUCE(ntot,ntot_min,1,MPI_INTEGER_I8,MPI_MIN,MPI_COMM_WORLD)
call MPI_ALLREDUCE(ntot,ntot_max,1,MPI_INTEGER_I8,MPI_MAX,MPI_COMM_WORLD)
call MPI_ALLREDUCE(ntot,ntot_sum,1,MPI_INTEGER_I8,MPI_SUM,MPI_COMM_WORLD)
write(stdout,*) 'Maximum, minimum, average, and normalized average number of grid points for task ',myid, &
'(block',my_block,'): ',ntot_max, &
ntot_min, &
Expand Down