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

Parallel kslice #106

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
31 changes: 31 additions & 0 deletions src/postw90/comms.F90
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ module w90_comms
interface comms_gatherv
! module procedure comms_gatherv_int ! to be done
module procedure comms_gatherv_real
module procedure comms_gatherv_logical
! module procedure comms_gatherv_cmplx
end interface comms_gatherv

Expand Down Expand Up @@ -846,6 +847,36 @@ subroutine comms_gatherv_real(array,localcount,rootglobalarray,counts,displs)

end subroutine comms_gatherv_real

subroutine comms_gatherv_logical(array,localcount,rootglobalarray,counts,displs)
!! Gather real data to root node
implicit none

logical, intent(inout) :: array
!! local array for sending data
integer, intent(in) :: localcount
!! localcount elements will be sent to the root node
logical, intent(inout) :: rootglobalarray
!! array on the root node to which data will be sent
integer, dimension(num_nodes), intent(in) :: counts
!! how data should be partitioned, see MPI documentation or
!! function comms_array_split
integer, dimension(num_nodes), intent(in) :: displs

#ifdef MPI
integer :: error

call MPI_gatherv(array,localcount,MPI_logical,rootglobalarray,counts,&
displs,MPI_logical,root_id,mpi_comm_world,error)

if(error.ne.MPI_success) then
call io_error('Error in comms_gatherv_logical')
end if
#else
! rootglobalarray(1:localcount)=array(1:localcount)
#endif

end subroutine comms_gatherv_logical

subroutine comms_scatterv_real(array,localcount,rootglobalarray,counts,displs)
!! Scatter data from root node
implicit none
Expand Down
Loading