From fcaf9f3afebc69eb57c215b3dc4fd2e4a44d01b8 Mon Sep 17 00:00:00 2001 From: AdamOrmondroyd Date: Wed, 25 Oct 2023 01:04:36 +0100 Subject: [PATCH] remembered that nTotal isn't needed (hangover from another idea) --- src/polychord/generate.F90 | 4 ++-- src/polychord/mpi_utils.F90 | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/polychord/generate.F90 b/src/polychord/generate.F90 index 80440d97..78fbed26 100644 --- a/src/polychord/generate.F90 +++ b/src/polychord/generate.F90 @@ -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 @@ -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 diff --git a/src/polychord/mpi_utils.F90 b/src/polychord/mpi_utils.F90 index b8ee83eb..2100e3ad 100644 --- a/src/polychord/mpi_utils.F90 +++ b/src/polychord/mpi_utils.F90 @@ -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,&! @@ -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,&!