diff --git a/CHANGELOG.md b/CHANGELOG.md index 62c19ef..1501da9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.2] - 2024-05-18 + +### Fixed + +- Bug in `MatCreateMPIAIJWithSplitArrays_args`. + ## [0.1.1] - 2024-02-28 ### Fixed diff --git a/Project.toml b/Project.toml index 8aad9e9..673cd86 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PetscCall" uuid = "1194c000-87c4-4102-b4a0-a6217ec4849e" authors = ["Francesc Verdugo and contributors"] -version = "0.1.1" +version = "0.1.2" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" diff --git a/src/ksp.jl b/src/ksp.jl index f76b466..e76d18f 100644 --- a/src/ksp.jl +++ b/src/ksp.jl @@ -274,7 +274,12 @@ function MatCreateMPIAIJWithSplitArrays_args(a::PSparseMatrix,petsc_comm,cols=re end end if ! issorted - sort!(view(oj,pini:pend)) + # TODO a more efficient way of doing this, or avoiding the need to sort + viewj = view(oj,pini:pend) + viewv = view(ov,pini:pend) + perm = sortperm(viewj) # Allocation here + viewj .= viewj[perm] + viewv .= viewv[perm] end end (petsc_comm,m,n,M,N,i,j,v,oi,oj,ov)