Skip to content

Commit

Permalink
remembered that nTotal isn't needed (hangover from another idea)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamOrmondroyd committed Oct 25, 2023
1 parent dcdaa1a commit fcaf9f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/polychord/generate.F90
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function prior(cube) result(theta)
end if


call scatter_points(live_points,live_point,mpi_information,settings%nTotal)
call scatter_points(live_points,live_point,mpi_information)

! if live points have been set to -1 then exit loop
if (any(live_point<0)) exit
Expand All @@ -212,7 +212,7 @@ function prior(cube) result(theta)
if(live_point(settings%l0)>settings%logzero) total_time = total_time + time1-time0


call gather_points(live_points,live_point,mpi_information,settings%nTotal)
call gather_points(live_points,live_point,mpi_information)
! Recieve a point from any worker

if (is_root(mpi_information)) then
Expand Down
14 changes: 6 additions & 8 deletions src/polychord/mpi_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -383,20 +383,19 @@ end subroutine throw_point
!!
!! This a process by which a worker node 'throws' a point to the root

subroutine scatter_points(live_points,live_point,mpi_information,nTotal)
subroutine scatter_points(live_points,live_point,mpi_information)
implicit none

real(dp),intent(in),dimension(:) :: live_points !> live points to throw
real(dp),intent(out),dimension(:) :: live_point !> live point to catch
type(mpi_bundle), intent(in) :: mpi_information
integer, intent(in) :: nTotal

call MPI_SCATTER( &!
live_points, &!
nTotal, &!
size(live_point), &!
MPI_DOUBLE_PRECISION, &!
live_point, &!
nTotal, &!
size(live_point), &!
MPI_DOUBLE_PRECISION, &!
mpi_information%root, &!
mpi_information%communicator,&!
Expand All @@ -412,20 +411,19 @@ end subroutine scatter_points
!! all points to the root.


subroutine gather_points(live_points,live_point,mpi_information,nTotal)
subroutine gather_points(live_points,live_point,mpi_information)
implicit none

real(dp),intent(in),dimension(:) :: live_point !> live point to throw
real(dp),intent(out),dimension(:) :: live_points !> live points to catch
type(mpi_bundle), intent(in) :: mpi_information
integer, intent(in) :: nTotal

call MPI_GATHER( &!
live_point, &!
nTotal, &!
size(live_point), &!
MPI_DOUBLE_PRECISION, &!
live_points, &!
nTotal, &!
size(live_point), &!
MPI_DOUBLE_PRECISION, &!
mpi_information%root, &!
mpi_information%communicator,&!
Expand Down

0 comments on commit fcaf9f3

Please sign in to comment.