From 894305a29035a8cf3b6840bbcdc32b7aeec493df Mon Sep 17 00:00:00 2001 From: jop611 Date: Fri, 2 Aug 2024 21:05:21 +0200 Subject: [PATCH 1/7] petsccall stuff --- src/api.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api.jl b/src/api.jl index 4b9e7b4..503c11a 100644 --- a/src/api.jl +++ b/src/api.jl @@ -542,6 +542,12 @@ Base.unsafe_convert(::Type{Ptr{Cvoid}},v::Mat) = v.ptr @wrapper(:MatMPIAIJSetPreallocation,PetscErrorCode,(Mat,PetscInt,Ptr{PetscInt},PetscInt,Ptr{PetscInt}),(B,d_nz,d_nnz,o_nz,o_nnz),"/Mat/MatMPIAIJSetPreallocation.html") @wrapper(:MatSetFromOptions,PetscErrorCode,(Mat,),(mat,),"/Mat/MatSetFromOptions.html") +# New +@wrapper(:MatMPIAIJGetLocalMat,PetscErrorCode,(Mat,MatReuse,Ptr{Mat}), (A,scall,A_local),"Mat/MatMPIAIJGetLocalMat.html") +@wrapper(:MatGetRowIJ,PetscErrorCode,(Mat, PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscBool}), (A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatGetRowIJ/") +@wrapper(:MatSeqAIJGetArrayRead, PetscErrorCode,(Mat, Ptr{Ptr{PetscScalar}}), (A, array),"Mat/MatSeqAIJGetArrayRead/") + + # Matrix products related """ From 492428bfdc154884daa66fa988af5758c29cbe56 Mon Sep 17 00:00:00 2001 From: jop611 Date: Tue, 6 Aug 2024 18:17:27 +0200 Subject: [PATCH 2/7] change some paths --- src/PetscCall.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PetscCall.jl b/src/PetscCall.jl index e19f5e1..6e78295 100644 --- a/src/PetscCall.jl +++ b/src/PetscCall.jl @@ -7,10 +7,10 @@ using SparseArrays using SparseMatricesCSR using PartitionedArrays -include("preferences_head.jl") -include("api.jl") -include("preferences_tail.jl") -include("environment.jl") -include("ksp.jl") +include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/preferences_head.jl") +include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/api.jl") +include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/preferences_tail.jl") +include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/environment.jl") +include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/ksp.jl") end # module From b61186191aee2ec032500e28a0425a7511e31bcc Mon Sep 17 00:00:00 2001 From: jop611 Date: Tue, 6 Aug 2024 19:22:30 +0200 Subject: [PATCH 3/7] revert path changes --- src/PetscCall.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PetscCall.jl b/src/PetscCall.jl index 6e78295..e19f5e1 100644 --- a/src/PetscCall.jl +++ b/src/PetscCall.jl @@ -7,10 +7,10 @@ using SparseArrays using SparseMatricesCSR using PartitionedArrays -include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/preferences_head.jl") -include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/api.jl") -include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/preferences_tail.jl") -include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/environment.jl") -include("/home/ppp23034/MscThesisJopMeijer/PetscCall.jl/src/ksp.jl") +include("preferences_head.jl") +include("api.jl") +include("preferences_tail.jl") +include("environment.jl") +include("ksp.jl") end # module From 91742db3d98e29c19d5249d8625f9a7f1a0c73c3 Mon Sep 17 00:00:00 2001 From: jop611 Date: Tue, 6 Aug 2024 21:36:44 +0200 Subject: [PATCH 4/7] added MatRestoreRowIJ wrapper, changed some petsc urls. --- src/api.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api.jl b/src/api.jl index 503c11a..7499426 100644 --- a/src/api.jl +++ b/src/api.jl @@ -544,8 +544,9 @@ Base.unsafe_convert(::Type{Ptr{Cvoid}},v::Mat) = v.ptr # New @wrapper(:MatMPIAIJGetLocalMat,PetscErrorCode,(Mat,MatReuse,Ptr{Mat}), (A,scall,A_local),"Mat/MatMPIAIJGetLocalMat.html") -@wrapper(:MatGetRowIJ,PetscErrorCode,(Mat, PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscBool}), (A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatGetRowIJ/") -@wrapper(:MatSeqAIJGetArrayRead, PetscErrorCode,(Mat, Ptr{Ptr{PetscScalar}}), (A, array),"Mat/MatSeqAIJGetArrayRead/") +@wrapper(:MatGetRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatGetRowIJ.html") +@wrapper(:MatRestoreRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatRestoreRowIJ.html") +@wrapper(:MatSeqAIJGetArrayRead, PetscErrorCode,(Mat, Ptr{Ptr{PetscScalar}}), (A, array),"Mat/MatSeqAIJGetArrayRead.html") # Matrix products related From 5ec120a19ddfa699f3fdebbaf894f456ca6b0e25 Mon Sep 17 00:00:00 2001 From: jop611 Date: Tue, 6 Aug 2024 22:13:36 +0200 Subject: [PATCH 5/7] added MatRestoreRowIJ wrapper, changed some petsc urls. --- src/api.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api.jl b/src/api.jl index 7499426..e4fda8a 100644 --- a/src/api.jl +++ b/src/api.jl @@ -544,8 +544,9 @@ Base.unsafe_convert(::Type{Ptr{Cvoid}},v::Mat) = v.ptr # New @wrapper(:MatMPIAIJGetLocalMat,PetscErrorCode,(Mat,MatReuse,Ptr{Mat}), (A,scall,A_local),"Mat/MatMPIAIJGetLocalMat.html") -@wrapper(:MatGetRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatGetRowIJ.html") -@wrapper(:MatRestoreRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatRestoreRowIJ.html") +@wrapper(:MatGetRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{Ptr{PetscInt}},Ptr{Ptr{PetscInt}},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatGetRowIJ.html") +@wrapper(:MatRestoreRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{Ptr{PetscInt}},Ptr{Ptr{PetscInt}},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatRestoreRowIJ.html") +# @wrapper(:MatRestoreRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatRestoreRowIJ.html") @wrapper(:MatSeqAIJGetArrayRead, PetscErrorCode,(Mat, Ptr{Ptr{PetscScalar}}), (A, array),"Mat/MatSeqAIJGetArrayRead.html") From 9a1954db6a1ce2f8f214c268f694fcfa4e0d89e5 Mon Sep 17 00:00:00 2001 From: jop611 Date: Wed, 7 Aug 2024 10:38:37 +0200 Subject: [PATCH 6/7] Added restore function wrappers, and added MatMPIAIJGetSeqAIJ --- src/api.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/api.jl b/src/api.jl index e4fda8a..80263bb 100644 --- a/src/api.jl +++ b/src/api.jl @@ -543,12 +543,16 @@ Base.unsafe_convert(::Type{Ptr{Cvoid}},v::Mat) = v.ptr @wrapper(:MatSetFromOptions,PetscErrorCode,(Mat,),(mat,),"/Mat/MatSetFromOptions.html") # New -@wrapper(:MatMPIAIJGetLocalMat,PetscErrorCode,(Mat,MatReuse,Ptr{Mat}), (A,scall,A_local),"Mat/MatMPIAIJGetLocalMat.html") +#include "petscmat.h" +# PetscErrorCode MatMPIAIJGetSeqAIJ(Mat A, Mat *Ad, Mat *Ao, const PetscInt *colmap[]) +@wrapper(:MatMPIAIJGetSeqAIJ,PetscErrorCode,(Mat,Ptr{Mat},Ptr{Mat},Ptr{Ptr{PetscInt}}),(A,Ad,Ao,colmap),"Mat/MatMPIAIJGetSeqAIJ.html") +@wrapper(:MatMPIAIJGetLocalMat,PetscErrorCode,(Mat,MatReuse,Ptr{Mat}),(A,scall,A_local),"Mat/MatMPIAIJGetLocalMat.html") @wrapper(:MatGetRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{Ptr{PetscInt}},Ptr{Ptr{PetscInt}},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatGetRowIJ.html") @wrapper(:MatRestoreRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{Ptr{PetscInt}},Ptr{Ptr{PetscInt}},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatRestoreRowIJ.html") -# @wrapper(:MatRestoreRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscInt},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatRestoreRowIJ.html") -@wrapper(:MatSeqAIJGetArrayRead, PetscErrorCode,(Mat, Ptr{Ptr{PetscScalar}}), (A, array),"Mat/MatSeqAIJGetArrayRead.html") - +@wrapper(:MatSeqAIJGetArray,PetscErrorCode,(Mat,Ptr{Ptr{PetscScalar}}),(A,array),"Mat/MatSeqAIJGetArrayRead.html") +@wrapper(:MatSeqAIJRestoreArray,PetscErrorCode,(Mat,Ptr{Ptr{PetscScalar}}),(A,array),"Mat/MatSeqAIJRestoreArray.html") +@wrapper(:MatSeqAIJGetArrayRead,PetscErrorCode,(Mat,Ptr{Ptr{PetscScalar}}),(A,array),"Mat/MatSeqAIJGetArrayRead.html") +@wrapper(:MatSeqAIJRestoreArrayRead,PetscErrorCode,(Mat,Ptr{Ptr{PetscScalar}}),(A,array),"Mat/MatSeqAIJRestoreArrayRead.html") # Matrix products related From a15d5c8b4df5c255e9692dab5eb7a0035d073ab6 Mon Sep 17 00:00:00 2001 From: jop611 Date: Wed, 7 Aug 2024 10:39:01 +0200 Subject: [PATCH 7/7] Removed commented line --- src/api.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/api.jl b/src/api.jl index 80263bb..a2cc2b6 100644 --- a/src/api.jl +++ b/src/api.jl @@ -543,8 +543,6 @@ Base.unsafe_convert(::Type{Ptr{Cvoid}},v::Mat) = v.ptr @wrapper(:MatSetFromOptions,PetscErrorCode,(Mat,),(mat,),"/Mat/MatSetFromOptions.html") # New -#include "petscmat.h" -# PetscErrorCode MatMPIAIJGetSeqAIJ(Mat A, Mat *Ad, Mat *Ao, const PetscInt *colmap[]) @wrapper(:MatMPIAIJGetSeqAIJ,PetscErrorCode,(Mat,Ptr{Mat},Ptr{Mat},Ptr{Ptr{PetscInt}}),(A,Ad,Ao,colmap),"Mat/MatMPIAIJGetSeqAIJ.html") @wrapper(:MatMPIAIJGetLocalMat,PetscErrorCode,(Mat,MatReuse,Ptr{Mat}),(A,scall,A_local),"Mat/MatMPIAIJGetLocalMat.html") @wrapper(:MatGetRowIJ,PetscErrorCode,(Mat,PetscInt,PetscBool,PetscBool,Ptr{PetscInt},Ptr{Ptr{PetscInt}},Ptr{Ptr{PetscInt}},Ptr{PetscBool}),(A,shift,symmetric,inodecompressed,n,ia,ja,done),"Mat/MatGetRowIJ.html")