Skip to content

Commit 265b2dd

Browse files
authored
Merge pull request #9 from fverdugo/sort_ghost_cols
Sorting ghost col ids in own_ghost block according global ids
2 parents 44b5f4c + 7887c8d commit 265b2dd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/ksp.jl

+14
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,20 @@ function MatCreateMPIAIJWithSplitArrays_args(a::PSparseMatrix,petsc_comm,cols=re
263263
oj .-= u
264264
m = own_length(rows)
265265
n = own_length(cols)
266+
for i in 1:(length(oi)-1)
267+
pini = oi[i]+1
268+
pend = oi[i+1]
269+
issorted = true
270+
for p in pini:(pend-1)
271+
if oj[p+1] < oj[p]
272+
issorted = false
273+
break
274+
end
275+
end
276+
if ! issorted
277+
sort!(view(oj,pini:pend))
278+
end
279+
end
266280
(petsc_comm,m,n,M,N,i,j,v,oi,oj,ov)
267281
end
268282
args = map(setup,partition(a),rows,cols)

0 commit comments

Comments
 (0)