Skip to content

Commit

Permalink
fix serial compile errors
Browse files Browse the repository at this point in the history
amend previous commit
bugfix: missing nprocs import
amend previous commit
  • Loading branch information
conradtchan committed Mar 11, 2022
1 parent a39c846 commit 25e4434
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions src/main/mpi_balance.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ module mpibalance
!
! :Runtime parameters: None
!
! :Dependencies: dim, io, mpi, mpiutils, part, timing
! :Dependencies: allocutils, io, mpi, mpiutils, part, timing
!
#ifdef MPI
use mpi
use io, only:id,nprocs
use io, only:id
use mpiutils, only:mpierr,status,MPI_DEFAULT_REAL,reduceall_mpi, &
comm_balance,comm_balancecount
use part, only:ipartbufsize
#endif
use io, only:nprocs

implicit none

Expand All @@ -32,22 +33,22 @@ module mpibalance
private

#ifdef MPI
real, dimension(ipartbufsize) :: xsendbuf,xbuffer
integer, dimension(1) :: irequestrecv,irequestsend
integer(kind=8) :: ntot_start
real, dimension(ipartbufsize) :: xsendbuf,xbuffer
integer, dimension(1) :: irequestrecv,irequestsend
integer(kind=8) :: ntot_start
integer :: npartnew, ncomplete
#endif
integer,allocatable :: nsent(:),nexpect(:),nrecv(:)
integer,allocatable :: countrequest(:)
integer :: npartnew, ncomplete
#endif

contains

subroutine allocate_balance_arrays
use allocutils, only:allocate_array
call allocate_array('nsent', nsent, nprocs)
call allocate_array('nexpect', nexpect, nprocs)
call allocate_array('nrecv', nrecv, nprocs)
call allocate_array('countrequest',countrequest,nprocs)
use allocutils, only:allocate_array
call allocate_array('nsent', nsent, nprocs)
call allocate_array('nexpect', nexpect, nprocs)
call allocate_array('nrecv', nrecv, nprocs)
call allocate_array('countrequest',countrequest,nprocs)
end subroutine allocate_balance_arrays

!----------------------------------------------------------------
Expand Down Expand Up @@ -239,7 +240,7 @@ end subroutine recv_part
!+
!-----------------------------------------------------------------------
subroutine send_part(i,newproc,replace)
use io, only:fatal,nprocs
use io, only:fatal
use part, only:fill_sendbuf,kill_particle
integer, intent(in) :: i,newproc
logical, intent(in), optional :: replace
Expand Down Expand Up @@ -279,7 +280,7 @@ end subroutine send_part
!+
!----------------------------------------------------------------
subroutine balance_finish(npart,replace)
use io, only:id,nprocs,fatal,iverbose
use io, only:id,fatal,iverbose
use part, only:recount_npartoftype
integer, intent(out) :: npart
logical, intent(in), optional :: replace
Expand Down
2 changes: 1 addition & 1 deletion src/main/mpi_derivs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ module mpiderivs
integer :: dtype_cellforce

integer :: globallevel
#endif
integer,allocatable :: comm_cofm(:) ! only comms up to globallevel are used
integer,allocatable :: comm_owner(:) ! only comms up to globallevel are used

Expand All @@ -88,7 +89,6 @@ module mpiderivs
integer,allocatable :: nrecv(:) ! counter for number of cells received from i

integer,allocatable :: countrequest(:)
#endif

contains

Expand Down

0 comments on commit 25e4434

Please sign in to comment.