Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
file: lcov.info
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
docs:
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/ci_extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
arch:
- x64
petsc_version:
- '3.23.0'
- '3.23.4'
steps:
- uses: actions/checkout@v4
- name: Cache petsc
Expand All @@ -29,13 +29,12 @@ jobs:
restore-keys: |
${{ runner.os }}-build-${{ env.JULIA_PETSC_LIBRARY }}-
${{ runner.os }}-build-
${{ runner.os }}-
${{ runner.os }}-
- name: Install petsc dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget gfortran g++ openmpi-bin libopenmpi-dev
sudo apt-get update
sudo apt-get install -y wget gfortran g++ openmpi-bin libopenmpi-dev
- name: Install petsc
##if: steps.cache-petsc.outputs.cache-hit != 'true'
run: |
CURR_DIR=$(pwd)
PACKAGE=petsc
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ LocalPreferences.toml
/dev/
/docs/build/
/docs/site/
deps/build.log
deps/build.log
deps/deps.jl
deps/PetscDataTypes.jl
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

## Documentation

Take a look at this [tutorial](https://gridap.github.io/Tutorials/dev/pages/t016_poisson_distributed/#Tutorial-16:-Poisson-equation-on-parallel-distributed-memory-computers-1) for learning how to use `GridapPETSc` in distributed-memory simulations of PDEs.
Take a look at this [tutorial](https://gridap.github.io/Tutorials/dev/pages/t016_poisson_distributed/#Tutorial-16:-Poisson-equation-on-parallel-distributed-memory-computers-1) for learning how to use `GridapPETSc` in distributed-memory simulations of PDEs.

It can also be used in the serial case, as shown in this [test](https://github.com/gridap/GridapPETSc.jl/blob/master/test/sequential/PoissonDriver.jl).

## Installation

`GridapPETSc` julia package requires the `PETSC` library ([Portable, Extensible Toolkit for Scientific Computation](https://www.mcs.anl.gov/petsc/)) and `MPI` to work correctly. You have two main options to install these dependencies.
`GridapPETSc` julia package requires the `PETSC` library ([Portable, Extensible Toolkit for Scientific Computation](https://www.mcs.anl.gov/petsc/)) and `MPI` to work correctly. You have two main options to install these dependencies.

- **Do nothing [recommended in most cases].** Use the default precompiled `MPI` installation provided by [`MPI.jl`](https://github.com/JuliaParallel/MPI.jl) and the pre-compiled `PETSc` library provided by [`PETSc_jll`](https://github.com/JuliaBinaryWrappers/PETSc_jll.jl). This will happen under the hood when you install `GridapPETSc`. In the case of `GridapPETSc`, you can also force the installation of these default dependencies by setting the environment variable `JULIA_PETSC_LIBRARY` to an empty value.

Expand All @@ -27,5 +27,5 @@ It can also be used in the serial case, as shown in this [test](https://github.c
## Notes

* `GridapPETSc` default sparse matrix format is 0-based compressed sparse row. This type of sparse matrix storage format can be described by the `SparseMatrixCSR{0,PetscReal,PetscInt}` and `SymSparseMatrixCSR{0,PetscReal,PetscInt}` Julia types as implemented in the [SparseMatricesCSR](https://gridap.github.io/SparseMatricesCSR.jl/stable/) Julia package.
* **When running in MPI parallel mode** (i.e., with a MPI communicator different from `MPI.COMM_SELF`), `GridapPETSc` implements a sort of limited garbage collector in order to automatically deallocate PETSc objects. This garbage collector can be manually triggered by a call to the function `GridapPETSc.gridap_petsc_gc()`. `GridapPETSc` automatically calls this function inside at different strategic points, and **this will be sufficient for most applications**. However, for some applications, with a very frequent allocation of PETSc objects, it might be needed to call this function from application code. This need will be signaled by PETSc via the following internal message error `PETSC ERROR: No more room in array, limit 256
* **When running in MPI parallel mode** (i.e., with a MPI communicator different from `MPI.COMM_SELF`), `GridapPETSc` implements a sort of limited garbage collector in order to automatically deallocate PETSc objects. This garbage collector can be manually triggered by a call to the function `GridapPETSc.gridap_petsc_gc()`. `GridapPETSc` automatically calls this function inside at different strategic points, and **this will be sufficient for most applications**. However, for some applications, with a very frequent allocation of PETSc objects, it might be needed to call this function from application code. This need will be signaled by PETSc via the following internal message error `PETSC ERROR: No more room in array, limit 256
recompile src/sys/objects/destroy.c with larger value for MAXREGDESOBJS`
6 changes: 3 additions & 3 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,19 @@ open(joinpath(@__DIR__,"PetscDataTypes.jl"),"w") do f
println(f)
println(f,:("\"\"\""))
println(f, "Julia alias for `PetscReal` C type.\n")
println(f, "See [PETSc manual](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscReal.html).")
println(f, "See [PETSc manual](https://petsc.org/release/manualpages/Sys/PetscReal/).")
println(f,:("\"\"\""))
println(f,:(const PetscReal = $(PetscReal)))
println(f)
println(f,:("\"\"\""))
println(f, "Julia alias for `PetscScalar` C type.\n")
println(f, "See [PETSc manual](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscScalar.html).")
println(f, "See [PETSc manual](https://petsc.org/release/manualpages/Sys/PetscScalar/).")
println(f,:("\"\"\""))
println(f,:(const PetscScalar = $(PetscScalar)))
println(f)
println(f,:("\"\"\""))
println(f, "Julia alias for `PetscInt` C type.\n")
println(f, "See [PETSc manual](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html).")
println(f, "See [PETSc manual](https://petsc.org/release/manualpages/Sys/PetscInt/).")
println(f,:("\"\"\""))
println(f,:(const PetscInt = $(PetscInt)))
end
Expand Down
10 changes: 5 additions & 5 deletions src/Config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
"""
Julia alias to `PetscErrorCode` C type.

See [PETSc manual](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscErrorCode.html).
See [PETSc manual](https://petsc.org/release/manualpages/Sys/PetscErrorCode/).
"""
const PetscErrorCode = Cint

"""
Julia alias to `PetscBool` C enum.

See [PETSc manual](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscBool.html).
See [PETSc manual](https://petsc.org/release/manualpages/Sys/PetscBool/).
"""
@enum PetscBool PETSC_FALSE PETSC_TRUE

"""
Julia alias to `PetscDataType` C enum.

See [PETSc manual](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscDataType.html).
See [PETSc manual](https://petsc.org/release/manualpages/Sys/PetscDataType/).
"""
@enum PetscDataType begin
PETSC_DATATYPE_UNKNOWN = 0
Expand All @@ -42,7 +42,7 @@ end
"""
PetscDataTypeFromString(name,ptype,found)

See [PETSc manual](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscDataTypeFromString.html).
See [PETSc manual](https://petsc.org/release/manualpages/Sys/PetscDataTypeFromString/).
"""
function PetscDataTypeFromString(name,ptype,found)
ccall(
Expand All @@ -54,7 +54,7 @@ end
"""
PetscDataTypeGetSize(ptype,size)

See [PETSc manual](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscDataTypeGetSize.html).
See [PETSc manual](https://petsc.org/release/manualpages/Sys/PetscDataTypeGetSize/).
"""
function PetscDataTypeGetSize(ptype,size)
ccall(
Expand Down
6 changes: 4 additions & 2 deletions src/GridapPETSc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,19 @@ end
include("PETSC.jl")

using GridapPETSc.PETSC: @check_error_code
using GridapPETSc.PETSC: PetscBool, PetscInt, PetscReal, PetscScalar, Vec, Mat, KSP, PC, SNES
#export PETSC
using GridapPETSc.PETSC: PetscBool, PetscInt, PetscReal, PetscScalar, Vec, Mat, KSP, PC, SNES, IS

export @check_error_code
export PetscBool, PetscInt, PetscReal, PetscScalar, Vec, Mat, KSP, PC, SNES

include("Environment.jl")

export PETScVector
export PETScMatrix
export PETScIndexSet
export petsc_sparse
include("PETScArrays.jl")
include("PETScIndexSets.jl")
include("PartitionedArrays.jl")

export PETScLinearSolver
Expand Down
Loading