From 85f060123cf695adcf8e44e2f24c20949360b0b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20M=C3=B8yner?= Date: Wed, 24 May 2023 10:47:59 +0200 Subject: [PATCH] Fix to MPI PArray copy --- src/HYPRE.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/HYPRE.jl b/src/HYPRE.jl index de77439..3c665b5 100644 --- a/src/HYPRE.jl +++ b/src/HYPRE.jl @@ -459,15 +459,16 @@ function Internals.get_proc_rows(A::Union{PSparseMatrix, PVector}) end ilower::HYPRE_BigInt = typemax(HYPRE_BigInt) iupper::HYPRE_BigInt = typemin(HYPRE_BigInt) - low_high = map(r) do a + map(r) do a + # This is a map over the local process' owned indices. For MPI it will + # be a single value but for DebugArray / Array it will have multiple + # values. o_to_g = own_to_global(a) ilower_part = o_to_g[1] iupper_part = o_to_g[end] - return ilower_part, iupper_part + ilower = min(ilower, convert(HYPRE_BigInt, ilower_part)) + iupper = max(iupper, convert(HYPRE_BigInt, iupper_part)) end - low, high = tuple_of_arrays(low_high) - ilower = convert(HYPRE_BigInt, reduce(min, low)) - iupper = convert(HYPRE_BigInt, reduce(max, high)) return ilower, iupper end @@ -553,7 +554,6 @@ function Base.copy!(dst::PVector, src::HYPREVector) iu_src_part = o_to_g[end] nvalues = HYPRE_Int(iu_src_part - il_src_part + 1) indices = collect(HYPRE_BigInt, il_src_part:iu_src_part) - values = collect(HYPRE_Complex, ov) if subarray_unsafe_supported() values = ov else