Skip to content

Commit

Permalink
Remove all Evaluators from ExaPF (#191)
Browse files Browse the repository at this point in the history
* remove Evaluators from ExaPF
* LS: add explicit rdiv! for transpose solve on GPU
* update documentation and remove deprecated scripts
* remove cusolverRF from tests
  • Loading branch information
frapac authored Jul 23, 2021
1 parent 6637886 commit f256744
Show file tree
Hide file tree
Showing 41 changed files with 66 additions and 4,328 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- run: julia --project deps/deps.jl
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest

Expand All @@ -44,6 +43,5 @@ jobs:
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- run: julia --project deps/deps.jl
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
Metis = "2679e427-3c69-5b7f-982b-ece356f1e94b"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Expand All @@ -27,7 +26,6 @@ ForwardDiff = "0.10"
KernelAbstractions = "0.6, 0.7"
Krylov = "~0.7.3"
LightGraphs = "1.3"
MathOptInterface = "0.9"
Metis = "1"
SparseDiffTools = "1"
TimerOutputs = "0.5"
Expand Down
45 changes: 1 addition & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ExaPF

[![][docs-latest-img]][docs-latest-url] ![CI](https://github.com/exanauts/ExaPF.jl/workflows/Run%20tests/badge.svg?branch=master)
[![][docs-latest-img]][docs-latest-url] ![CI](https://github.com/exanauts/ExaPF.jl/workflows/Run%20tests/badge.svg?branch=master)

[docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg
[docs-latest-url]: https://exanauts.github.io/ExaPF.jl/
Expand Down Expand Up @@ -49,49 +49,6 @@ Iteration 4. Residual norm: 3.9111e-12.
ExaPF.ConvergenceStatus(true, 4, 3.911102241031109e-12, 0)
```

### How to solve the optimal power flow in the reduced space?

ExaPF implements a wrapper to [MathOptInterface](https://github.com/jump-dev/MathOptInterface.jl)
that allows to solve the optimal power flow problem directly in the reduced space
induced by the power flow equations:

```julia
julia> case = "case57.m"
# Instantiate a ReducedSpaceEvaluator object
julia> nlp = ExaPF.ReducedSpaceEvaluator(datafile)
# MOI optimizer
julia> optimizer = Ipopt.Optimizer()
# Use LBFGS algorithm, as reduced Hessian is not available by default!
julia> MOI.set(optimizer, MOI.RawParameter("hessian_approximation"), "limited-memory")
julia> MOI.set(optimizer, MOI.RawParameter("tol"), 1e-4)
julia> solution = ExaPF.optimize!(optimizer, nlp)
Total number of variables............................: 10
variables with only lower bounds: 0
variables with lower and upper bounds: 10
variables with only upper bounds: 0
Total number of equality constraints.................: 0
Total number of inequality constraints...............: 58
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 58
inequality constraints with only upper bounds: 0


Number of Iterations....: 9

(scaled) (unscaled)
Objective...............: 1.9630480251946040e+03 3.7589338203438238e+04
Dual infeasibility......: 2.5545890554923290e-05 4.8916435433709606e-04
Constraint violation....: 4.7695181137896725e-13 4.7695181137896725e-13
Complementarity.........: 1.0270912626531211e-11 1.9667211572084318e-10
Overall NLP error.......: 2.5545890554923290e-05 4.8916435433709606e-04

[...]
Total CPU secs in IPOPT (w/o function evaluations) = 0.049
Total CPU secs in NLP function evaluations = 0.023

EXIT: Optimal Solution Found.
```

## Development

We welcome any contribution to ExaPF! Bug fixes or feature requests
Expand Down
87 changes: 0 additions & 87 deletions benchmark/batch_hessian.jl

This file was deleted.

19 changes: 11 additions & 8 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,18 @@ function run_benchmark(datafile, device, linsolver)

algo = linsolver(J; P=precond)
powerflow_solver = NewtonRaphson(tol=ntol)
nlp = ExaPF.ReducedSpaceEvaluator(polar;
powerflow_solver=powerflow_solver)
nlp.linear_solver = algo
convergence = ExaPF.update!(nlp, u0)
ExaPF.reset!(nlp)
convergence = ExaPF.update!(nlp, u0)
ExaPF.reset!(nlp)

# Init variables
buffer = get(polar, ExaPF.PhysicalState())
jx = AutoDiff.Jacobian(polar, ExaPF.power_balance, State())

# Warmstart
ExaPF.init_buffer!(polar, buffer)
ExaPF.powerflow(polar, jx, buffer, powerflow_solver; linear_solver=algo)

TimerOutputs.reset_timer!(ExaPF.TIMER)
convergence = ExaPF.update!(nlp, u0)
ExaPF.init_buffer!(polar, buffer)
convergence = ExaPF.powerflow(polar, jx, buffer, powerflow_solver; linear_solver=algo)

# Make sure we are converged
@assert(convergence.has_converged)
Expand Down
175 changes: 0 additions & 175 deletions benchmark/evaluators.jl

This file was deleted.

5 changes: 0 additions & 5 deletions deps/deps.jl

This file was deleted.

Loading

0 comments on commit f256744

Please sign in to comment.