Skip to content

Commit 3317dcb

Browse files
committed
Fixing call to Gatherv!
1 parent a203a50 commit 3317dcb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mpi_array.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,10 @@ end
296296
function 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
321323
end

0 commit comments

Comments
 (0)