296296function gather_impl! (
297297 rcv:: MPIArray , snd:: MPIArray ,
298298 destination, :: Type{T} ) where T <: AbstractVector
299+ Tv = eltype (snd. item)
299300 @assert rcv. comm === snd. comm
300301 @assert isa (rcv. item,JaggedArray)
302+ @assert eltype (eltype (rcv. item)) == Tv
301303 comm = snd. comm
302304 if isa (destination,Integer)
303305 root = destination- 1
@@ -308,14 +310,14 @@ function gather_impl!(
308310 rcv_buffer = MPI. VBuffer (rcv. item. data,counts)
309311 MPI. Gatherv! (MPI. IN_PLACE,rcv_buffer,root,comm)
310312 else
311- MPI. Gatherv! (snd. item,nothing ,root,comm)
313+ MPI. Gatherv! (convert (Vector{Tv}, snd. item) ,nothing ,root,comm)
312314 end
313315 else
314316 @assert destination === :all
315317 @assert length (rcv. item) == MPI. Comm_size (comm)
316318 counts = ptrs_to_counts (rcv. item. ptrs)
317319 rcv_buffer = MPI. VBuffer (rcv. item. data,counts)
318- MPI. Allgatherv! (snd. item,rcv_buffer,comm)
320+ MPI. Allgatherv! (convert (Vector{Tv}, snd. item) ,rcv_buffer,comm)
319321 end
320322 rcv
321323end
@@ -541,18 +543,18 @@ function exchange_impl!(
541543end
542544
543545# This should go eventually into MPI.jl!
544- Issend (data, comm:: MPI.Comm , req:: MPI.AbstractRequest = MPI. Request (); dest:: Integer , tag:: Integer = 0 ) =
546+ Issend (data, comm:: MPI.Comm , req= MPI. Request (); dest:: Integer , tag:: Integer = 0 ) =
545547 Issend (data, dest, tag, comm, req)
546548
547- function Issend (buf:: MPI.Buffer , dest:: Integer , tag:: Integer , comm:: MPI.Comm , req:: MPI.AbstractRequest = MPI. Request ())
549+ function Issend (buf:: MPI.Buffer , dest:: Integer , tag:: Integer , comm:: MPI.Comm , req= MPI. Request ())
548550 @assert MPI. isnull (req)
549551 # int MPI_Issend(const void* buf, int count, MPI_Datatype datatype, int dest,
550552 # int tag, MPI_Comm comm, MPI_Request *request)
551553 MPI. API. MPI_Issend (buf. data, buf. count, buf. datatype, dest, tag, comm, req)
552554 MPI. setbuffer! (req, buf)
553555 return req
554556end
555- Issend (data, dest:: Integer , tag:: Integer , comm:: MPI.Comm , req:: MPI.AbstractRequest = MPI. Request ()) =
557+ Issend (data, dest:: Integer , tag:: Integer , comm:: MPI.Comm , req= MPI. Request ()) =
556558 Issend (MPI. Buffer_send (data), dest, tag, comm, req)
557559
558560
0 commit comments