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
0 commit comments