Skip to content

Commit 56539b5

Browse files
authored
Merge pull request #10 from fverdugo/quickfix
Bugfix in MatCreateMPIAIJWithSplitArrays
2 parents 265b2dd + 62a6563 commit 56539b5

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.1.2] - 2024-05-18
9+
10+
### Fixed
11+
12+
- Bug in `MatCreateMPIAIJWithSplitArrays_args`.
13+
814
## [0.1.1] - 2024-02-28
915

1016
### Fixed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PetscCall"
22
uuid = "1194c000-87c4-4102-b4a0-a6217ec4849e"
33
authors = ["Francesc Verdugo <[email protected]> and contributors"]
4-
version = "0.1.1"
4+
version = "0.1.2"
55

66
[deps]
77
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

src/ksp.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,12 @@ function MatCreateMPIAIJWithSplitArrays_args(a::PSparseMatrix,petsc_comm,cols=re
274274
end
275275
end
276276
if ! issorted
277-
sort!(view(oj,pini:pend))
277+
# TODO a more efficient way of doing this, or avoiding the need to sort
278+
viewj = view(oj,pini:pend)
279+
viewv = view(ov,pini:pend)
280+
perm = sortperm(viewj) # Allocation here
281+
viewj .= viewj[perm]
282+
viewv .= viewv[perm]
278283
end
279284
end
280285
(petsc_comm,m,n,M,N,i,j,v,oi,oj,ov)

0 commit comments

Comments
 (0)