Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md with more details #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The different modes in AMGX are available as:
- `AMGX.dDFI`
- `AMGX.dFFI`

Here, d/h is short for running AMGX on device/host, and the next pair of letters refer to matrix and vector precision (F for float/Float32, D for double/Float64). Julia native inputs to the matrix and vector constructors should match that specified in the mode, e.g. `Vector{Float64}` for D and `Vector{Float32}` for F.

### `Vector`

Expand Down Expand Up @@ -147,12 +148,6 @@ These arrays can also be uploaded from `CuArrays` already residing on the GPU.

Alternatively, a `CUDA.CUSPARSE.CuSparseMatrixCSR` can be directly uploaded.

The non zero values can be replaced:

```julia
AMGX.replace_coefficients!(matrix, [3.0, 2.0, 1.0])
```

### `Solver`

A solver is created from a `Resources`, a `Mode`, and a `Config`:
Expand All @@ -178,10 +173,10 @@ Vector(x)

After a solve, the status can be retrieved using `AMGX.get_status(solver)`. It is of type `AMGX.SolverStatus` and can be either:

- `AMGX.SUCCESS`
- `AMGX.FAILED`
- `AMGX.DIVERGED`
- `AMGX.NOT_CONVERGED`
- `AMGX.SUCCESS`: Solver converged to within the tolerances.
- `AMGX.FAILED`: Solver failed due to internal error.
- `AMGX.DIVERGED`: Solver ran without error, but residual increased during the solution process.
- `AMGX.NOT_CONVERGED`: Solver did not converge, but the residual was reduced.

The total number of iterations can be retrieved with `AMGX.get_iterations_number(solver)`.

Expand All @@ -192,6 +187,18 @@ AMGX.get_iteration_residual(solver)
AMGX.get_iteration_residual(solver, 0)
```

If the sparsity structure of the matrix is fixed, but the matrix coefficients change, the non zero values can be replaced:

```julia
AMGX.replace_coefficients!(matrix, [3.0, 2.0, 1.0])
```

If a solve was performed for `matrix` before the non zero values were updated, the setup cost can be significantly reduced for the updated matrix:

```julia
AMGX.resetup!(solver, matrix)
```

### Utilities

#### Version information
Expand Down