diff --git a/src/polychord/generate.F90 b/src/polychord/generate.F90 index 5900f988..3bc0decc 100644 --- a/src/polychord/generate.F90 +++ b/src/polychord/generate.F90 @@ -69,7 +69,7 @@ subroutine GenerateLivePoints(loglikelihood,prior,settings,RTI,mpi_information) use array_module, only: add_point use abort_module #ifdef MPI - use mpi_module, only: mpi_bundle,is_root,linear_mode,throw_point,catch_point,more_points_needed,sum_integers,sum_doubles,request_point,no_more_points,request_this_point,point_needed + use mpi_module, only: mpi_bundle,is_root,linear_mode,throw_point,catch_point,more_points_needed,sum_integers,sum_doubles,request_point,no_more_points,request_live_point,live_point_needed #else use mpi_module, only: mpi_bundle,is_root,linear_mode #endif @@ -198,7 +198,7 @@ function prior(cube) result(theta) ! use the time as an ordering identifier, cheat by using the birth contour live_point(settings%b0) = ngenerated ngenerated = ngenerated+1 - call request_this_point(live_point,mpi_information,worker_id) + call request_live_point(live_point,mpi_information,worker_id) end do do while(active_workers>0) @@ -229,7 +229,7 @@ function prior(cube) result(theta) ! use the time as a unique identifier, cheat by using the birth contour live_point(settings%b0) = ngenerated ngenerated = ngenerated+1 - call request_this_point(live_point,mpi_information,worker_id) + call request_live_point(live_point,mpi_information,worker_id) else call no_more_points(mpi_information,worker_id) ! Otherwise, send a signal to stop active_workers=active_workers-1 ! decrease the active worker counter @@ -248,7 +248,7 @@ function prior(cube) result(theta) ! The workers simply generate and send points until they're told to stop by the administrator - do while(point_needed(live_point,mpi_information)) + do while(live_point_needed(live_point,mpi_information)) time0 = time() call calculate_point( loglikelihood, prior, live_point, settings,nlike) ! Compute physical coordinates, likelihoods and derived parameters ndiscarded=ndiscarded+1 diff --git a/src/polychord/mpi_utils.F90 b/src/polychord/mpi_utils.F90 index 4e6632ab..03d7315e 100644 --- a/src/polychord/mpi_utils.F90 +++ b/src/polychord/mpi_utils.F90 @@ -695,22 +695,22 @@ end function more_points_needed !> Request specific live points ! administrator ----> worker - ! request_this_point(live_point) point_needed -> true + ! request_live_point(live_point) point_needed -> true ! no_more_points (defined above) point_needed -> false ! - !> Request this point + !> Request live point !! !! This subroutine is used by the root node to request a specific live point - subroutine request_this_point(live_point,mpi_information,worker_id) + subroutine request_live_point(live_point,mpi_information,worker_id) implicit none type(mpi_bundle), intent(in) :: mpi_information integer, intent(in) :: worker_id !> Worker to request a new point from real(dp), intent(in), dimension(:) :: live_point !> The live point to be sent - call MPI_SEND( & - live_point, &! not sending anything + call MPI_SEND( &! + live_point, &! live point being sent size(live_point), &! MPI_DOUBLE_PRECISION, &! sending doubles worker_id, &! process id to send to @@ -719,12 +719,12 @@ subroutine request_this_point(live_point,mpi_information,worker_id) mpierror &! error flag ) - end subroutine request_this_point + end subroutine request_live_point !> See if another point is needed !! !! This subroutine is used by the root node to request a specific live point - function point_needed(live_point,mpi_information) + function live_point_needed(live_point,mpi_information) use abort_module implicit none type(mpi_bundle), intent(in) :: mpi_information @@ -732,29 +732,29 @@ function point_needed(live_point,mpi_information) integer, dimension(MPI_STATUS_SIZE) :: mpistatus ! status identifier - logical :: point_needed !> Whether we need more points or not + logical :: live_point_needed !> Whether we need more points or not call MPI_RECV( &! - live_point, &! + live_point, &! live point recieved size(live_point), &! - MPI_DOUBLE_PRECISION, &! - mpi_information%root, &! - MPI_ANY_TAG, &! - mpi_information%communicator,&! - mpistatus, &! - mpierror &! + MPI_DOUBLE_PRECISION, &! receiving doubles + mpi_information%root, &! root node + MPI_ANY_TAG, &! mpi tag + mpi_information%communicator,&! mpi handle + mpistatus, &! status identifier + mpierror &! error flag ) ! If we've recieved a kill signal, then exit this loop if(mpistatus(MPI_TAG) == tag_gen_stop ) then - point_needed = .false. + live_point_needed = .false. else if(mpistatus(MPI_TAG) == tag_gen_request) then - point_needed = .true. + live_point_needed = .true. else call halt_program('generate error: unrecognised tag') end if - end function point_needed + end function live_point_needed #endif