-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeremy E Kozdon
committed
Jul 9, 2021
1 parent
d3f5d21
commit 827e7e1
Showing
8 changed files
with
73 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,5 +31,6 @@ include("matshell.jl") | |
include("ksp.jl") | ||
include("pc.jl") | ||
include("snes.jl") | ||
include("sys.jl") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
const CPetscObject = Ptr{Cvoid} | ||
|
||
@for_libpetsc begin | ||
function getcomm( | ||
obj::Union{ | ||
AbstractKSP{$PetscScalar}, | ||
AbstractMat{$PetscScalar}, | ||
AbstractVec{$PetscScalar}, | ||
}, | ||
) | ||
comm = MPI.Comm() | ||
@chk ccall( | ||
(:PetscObjectGetComm, $libpetsc), | ||
PetscErrorCode, | ||
(CPetscObject, Ptr{MPI.MPI_Comm}), | ||
obj, | ||
comm, | ||
) | ||
|
||
#XXX We should really increase the petsc reference counter. | ||
# But for for some reason the PETSc says that this communicator is | ||
# unknown | ||
#= | ||
# Call the PetscCommDuplicate to increase reference count | ||
@chk ccall( | ||
(:PetscCommDuplicate, $libpetsc), | ||
PetscErrorCode, | ||
(MPI.MPI_Comm, Ptr{MPI.MPI_Comm}, Ptr{Cvoid}), | ||
comm, | ||
comm, | ||
C_NULL, | ||
) | ||
# Register PetscCommDestroy to decriment the reference count | ||
finalizer(PetscCommDestroy, comm) | ||
=# | ||
|
||
return comm | ||
end | ||
end | ||
|
||
#= | ||
#XXX Not sure why this doesn't work | ||
@for_libpetsc begin | ||
function PetscCommDestroy( | ||
comm::MPI.Comm | ||
) | ||
@show comm.val | ||
@chk ccall( | ||
(:PetscCommDestroy, $libpetsc), | ||
PetscErrorCode, | ||
(Ptr{MPI.MPI_Comm},), | ||
comm, | ||
) | ||
return nothing | ||
end | ||
end | ||
=# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters