Skip to content

Commit 6dcf4fd

Browse files
committed
Improve performance of copyto! for PVector objects.
1 parent 95604fd commit 6dcf4fd

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/p_vector.jl

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -803,13 +803,14 @@ function Base.copy!(a::PVector,b::PVector)
803803
end
804804

805805
function Base.copyto!(a::PVector,b::PVector)
806-
if partition(axes(a,1)) === partition(axes(b,1))
807-
map(copy!,partition(a),partition(b))
808-
elseif matching_own_indices(axes(a,1),axes(b,1))
809-
map(copy!,own_values(a),own_values(b))
810-
else
811-
error("Trying to copy a PVector into another one with a different data layout. This case is not implemented yet. It would require communications.")
812-
end
806+
map(copy!,own_values(a),own_values(b))
807+
#if partition(axes(a,1)) === partition(axes(b,1))
808+
# map(copy!,partition(a),partition(b))
809+
#elseif matching_own_indices(axes(a,1),axes(b,1))
810+
# map(copy!,own_values(a),own_values(b))
811+
#else
812+
# error("Trying to copy a PVector into another one with a different data layout. This case is not implemented yet. It would require communications.")
813+
#end
813814
a
814815
end
815816

0 commit comments

Comments
 (0)