Skip to content

Commit 0dbc33b

Browse files
committed
Renaming PETSC.jl -> PetscCall.jl
1 parent 7abfff2 commit 0dbc33b

17 files changed

+106
-106
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "PETSC"
1+
name = "PetscCall"
22
uuid = "1194c000-87c4-4102-b4a0-a6217ec4849e"
33
authors = ["Francesc Verdugo <[email protected]> and contributors"]
44
version = "0.1.0"

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
# PETSC
1+
# PetscCall
22

33
This package provides easy access to PETSc solvers in sequential and parallel Julia computations.
44

55

66
| **Documentation** |
77
|:------------ |
8-
| [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://fverdugo.github.io/PETSC.jl/stable/) |
9-
| [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://fverdugo.github.io/PETSC.jl/dev/) |
8+
| [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://fverdugo.github.io/PetscCall.jl/stable/) |
9+
| [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://fverdugo.github.io/PetscCall.jl/dev/) |
1010
|**Build Status** |
11-
[![Build Status](https://github.com/fverdugo/PETSC.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/fverdugo/PETSC.jl/actions/workflows/CI.yml?query=branch%3Amain) |
11+
[![Build Status](https://github.com/fverdugo/PetscCall.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/fverdugo/PetscCall.jl/actions/workflows/CI.yml?query=branch%3Amain) |
1212
|**Coverage** |
13-
| [![Coverage](https://codecov.io/gh/fverdugo/PETSC.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/fverdugo/PETSC.jl) |
13+
| [![Coverage](https://codecov.io/gh/fverdugo/PetscCall.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/fverdugo/PetscCall.jl) |
1414

1515
## Documentation
1616

17-
- [**STABLE**](https://fverdugo.github.io/PETSC.jl/stable) &mdash; **Documentation for the most recently tagged version.**
18-
- [**LATEST**](https://fverdugo.github.io/PETSC.jl/dev) &mdash; *Documentation for the in-development version.*
17+
- [**STABLE**](https://fverdugo.github.io/PetscCall.jl/stable) &mdash; **Documentation for the most recently tagged version.**
18+
- [**LATEST**](https://fverdugo.github.io/PetscCall.jl/dev) &mdash; *Documentation for the in-development version.*
1919

2020
## Help and discussion
2121

22-
- You can open a new discussion to ask questions [here](https://github.com/fverdugo/PETSC.jl/discussions).
23-
- If you have found a bug, open an issue [here](https://github.com/fverdugo/PETSC.jl/issues). Do not forget to include a (minimal) reproducer.
22+
- You can open a new discussion to ask questions [here](https://github.com/fverdugo/PetscCall.jl/discussions).
23+
- If you have found a bug, open an issue [here](https://github.com/fverdugo/PetscCall.jl/issues). Do not forget to include a (minimal) reproducer.
2424

2525
## Contributing
2626

2727
This package is under active development and there are several ways to contribute:
2828

2929
- by enhancing the documentation (e.g., fixing typos, enhancing doc strings, adding examples).
30-
- by addressing one of the [issues waiting for help](https://github.com/fverdugo/PETSC.jl/labels/help%20wanted).
30+
- by addressing one of the [issues waiting for help](https://github.com/fverdugo/PetscCall.jl/labels/help%20wanted).
3131
- by adding more tests to increase the code coverage.
32-
- by extending the current functionality. In this case, open a discussion [here](https://github.com/fverdugo/PETSC.jl/discussions) to coordinate with the package maintainers before proposing significant changes.
32+
- by extending the current functionality. In this case, open a discussion [here](https://github.com/fverdugo/PetscCall.jl/discussions) to coordinate with the package maintainers before proposing significant changes.

docs/Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3-
PETSC = "1194c000-87c4-4102-b4a0-a6217ec4849e"
3+
PetscCall = "1194c000-87c4-4102-b4a0-a6217ec4849e"
44
PartitionedArrays = "5a9dfac6-5c52-46f7-8278-5e2210713be9"

docs/make.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
using PETSC
1+
using PetscCall
22
using Documenter
33

4-
DocMeta.setdocmeta!(PETSC, :DocTestSetup, :(using PETSC); recursive=true)
4+
DocMeta.setdocmeta!(PetscCall, :DocTestSetup, :(using PetscCall); recursive=true)
55

66
makedocs(;
7-
modules=[PETSC],
8-
sitename="PETSC.jl",
7+
modules=[PetscCall],
8+
sitename="PetscCall.jl",
99
format=Documenter.HTML(;
1010
prettyurls=get(ENV, "CI", "false") == "true",
11-
canonical="https://fverdugo.github.io/PETSC.jl",
11+
canonical="https://fverdugo.github.io/PetscCall.jl",
1212
edit_link="main",
1313
assets=String[],
1414
),
@@ -22,6 +22,6 @@ makedocs(;
2222
)
2323

2424
deploydocs(;
25-
repo="github.com/fverdugo/PETSC.jl",
25+
repo="github.com/fverdugo/PetscCall.jl",
2626
devbranch="main",
2727
)

docs/src/advanced.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Advanced API
33

44
```@autodocs
5-
Modules = [PETSC]
5+
Modules = [PetscCall]
66
Pages = ["api.jl"]
77
```
88

docs/src/config.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ This packages uses Preferences.jl for its configuration.
66

77
To use the petsc installation provided by BinaryBuilder.jl run these commands:
88

9-
using PETSC
10-
PETSC.use_petsc_jll()
9+
using PetscCall
10+
PetscCall.use_petsc_jll()
1111
# Restart Julia now
1212

1313
You can also specify the integer and scalar types to use:
1414

15-
using PETSC
16-
PETSC.use_petsc_jll(PetscInt=Int32,PetscScalar=Float32)
15+
using PetscCall
16+
PetscCall.use_petsc_jll(PetscInt=Int32,PetscScalar=Float32)
1717
# Restart Julia now
1818

1919
## Use a system binary
2020

2121
To use PETSc installed in your system:
2222

23-
using PETSC
24-
PETSC.use_system_petsc()
23+
using PetscCall
24+
PetscCall.use_system_petsc()
2525
# Restart Julia now
2626

2727
This will look in `LD_LIBRARY_PATH` for a file called `libpetsc.so`.
2828

2929
You can also provide the full path to `libpetsc.so`.
3030

31-
using PETSC
32-
PETSC.use_system_petsc(;libpetsc_path=path/to/libpetsc.so)
31+
using PetscCall
32+
PetscCall.use_system_petsc(;libpetsc_path=path/to/libpetsc.so)
3333
# Restart Julia now
3434

docs/src/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
```@meta
2-
CurrentModule = PETSC
2+
CurrentModule = PetscCall
33
```
44

5-
# PETSC
5+
# PetscCall
66

7-
Documentation for [PETSC](https://github.com/fverdugo/PETSC.jl).
7+
Documentation for [PetscCall](https://github.com/fverdugo/PetscCall.jl).
88

99
## What
1010

docs/src/reference.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
## Configuration
55

66
```@autodocs
7-
Modules = [PETSC]
7+
Modules = [PetscCall]
88
Pages = ["preferences_tail.jl"]
99
```
1010

1111
## Environment
1212

1313
```@autodocs
14-
Modules = [PETSC]
14+
Modules = [PetscCall]
1515
Pages = ["environment.jl"]
1616
```
1717

1818
## Linear solvers (KSP)
1919

2020
```@autodocs
21-
Modules = [PETSC]
21+
Modules = [PetscCall]
2222
Pages = ["ksp.jl"]
2323
```
2424

docs/src/usage.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
using SparseArrays
77
using Test
8-
using PETSC
8+
using PetscCall
99
using LinearAlgebra
1010

1111
# Create a spare matrix and a vector in Julia
@@ -18,41 +18,41 @@
1818
x = ones(m)
1919
b = A*x
2020

21-
# PETSC options
21+
# PetscCall options
2222
options = "-ksp_type gmres -ksp_monitor -pc_type ilu"
23-
PETSC.init(args=split(options))
23+
PetscCall.init(args=split(options))
2424

2525
# Say, we want to solve A*x=b
2626
x2 = similar(x); x2 .= 0
27-
setup = PETSC.ksp_setup(x2,A,b)
28-
results = PETSC.ksp_solve!(x2,setup,b)
27+
setup = PetscCall.ksp_setup(x2,A,b)
28+
results = PetscCall.ksp_solve!(x2,setup,b)
2929
@test x ≈ x2
3030

3131
# Info about the solution process
3232
@show results
3333

3434
# Now with the same matrix, but a different rhs
3535
b = 2*b
36-
results = PETSC.ksp_solve!(x2,setup,b)
36+
results = PetscCall.ksp_solve!(x2,setup,b)
3737
@test 2*x ≈ x2
3838

3939
# Now with a different matrix, but reusing as much as possible
4040
# from the previous solve.
4141
A = 2*A
42-
PETSC.ksp_setup!(setup,A)
43-
results = PETSC.ksp_solve!(x2,setup,b)
42+
PetscCall.ksp_setup!(setup,A)
43+
results = PetscCall.ksp_solve!(x2,setup,b)
4444
@test x ≈ x2
4545

4646
# The user needs to explicitly destroy
4747
# the setup object. This cannot be hidden in
4848
# Julia finalizers since destructors in petsc are
4949
# collective operations (in parallel runs).
5050
# Julia finalizers do not guarantee this.
51-
PETSC.ksp_finalize!(setup)
51+
PetscCall.ksp_finalize!(setup)
5252

5353
# The setup object cannot be used anymore.
5454
# This now would be provably a code dump:
55-
# PETSC.ksp_solve!(x2,setup,b)
55+
# PetscCall.ksp_solve!(x2,setup,b)
5656

5757
## Parallel example
5858

@@ -61,7 +61,7 @@ First write the parallel code in a function in a file `demo.jl`.
6161
# File demo.jl
6262
using SparseArrays
6363
using Test
64-
using PETSC
64+
using PetscCall
6565
using PartitionedArrays
6666

6767
function ksp_tests(distribute)
@@ -94,22 +94,22 @@ First write the parallel code in a function in a file `demo.jl`.
9494

9595
# Now solve the system with petsc
9696
options = "-ksp_type gmres -pc_type jacobi -ksp_rtol 1.0e-12"
97-
PETSC.init(;args = split(options))
97+
PetscCall.init(;args = split(options))
9898

9999
x2 = similar(x); x2 .= 0
100-
setup = PETSC.ksp_setup(x2,A,b)
101-
results = PETSC.ksp_solve!(x2,setup,b)
100+
setup = PetscCall.ksp_setup(x2,A,b)
101+
results = PetscCall.ksp_solve!(x2,setup,b)
102102
@test x ≈ x2
103103

104104
b = 2*b
105-
results = PETSC.ksp_solve!(x2,setup,b)
105+
results = PetscCall.ksp_solve!(x2,setup,b)
106106
@test 2*x ≈ x2
107107

108-
PETSC.ksp_setup!(setup,A)
109-
results = PETSC.ksp_solve!(x2,setup,b)
108+
PetscCall.ksp_setup!(setup,A)
109+
results = PetscCall.ksp_solve!(x2,setup,b)
110110
@test 2*x ≈ x2
111111

112-
PETSC.ksp_finalize!(setup)
112+
PetscCall.ksp_finalize!(setup)
113113
end
114114

115115
Then, test your code with the debug back-end of PartitionedArrays.jl

src/PETSC.jl renamed to src/PetscCall.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module PETSC
1+
module PetscCall
22

33
using Preferences
44
using Libdl

src/api.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ macro wrapper(fn,rt,argts,args,url)
4545
end
4646
if isempty(rstrip(url))
4747
str = """
48-
PETSC.$(fn.value)$(sargs)
48+
PetscCall.$(fn.value)$(sargs)
4949
"""
5050
else
5151
str = """
52-
PETSC.$(fn.value)$(sargs)
52+
PetscCall.$(fn.value)$(sargs)
5353
5454
See [PETSc manual]($url).
5555
"""

src/environment.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
"""
3-
PETSC.init(:kwargs...)
3+
PetscCall.init(:kwargs...)
44
55
Document me!
66
"""
@@ -12,14 +12,14 @@ function init(;args=String[],file="",help="",finalize_atexit=true)
1212
atexit(finalize)
1313
end
1414
finalize()
15-
new_args = ["PETSC"]
15+
new_args = ["PetscCall"]
1616
append!(new_args,args)
1717
@check_error_code PetscInitializeNoPointers(length(new_args),new_args,file,help)
1818
nothing
1919
end
2020

2121
"""
22-
PETSC.initialized()
22+
PetscCall.initialized()
2323
2424
Document me!
2525
"""
@@ -30,7 +30,7 @@ function initialized()
3030
end
3131

3232
"""
33-
PETSC.finalize()
33+
PetscCall.finalize()
3434
3535
Document me!
3636
"""
@@ -42,7 +42,7 @@ function finalize()
4242
end
4343

4444
"""
45-
PETSC.with(f;kwargs...)
45+
PetscCall.with(f;kwargs...)
4646
4747
Document me!
4848
"""

0 commit comments

Comments
 (0)