diff --git a/NEWS.md b/NEWS.md index 54ebe7e4..3ba73d16 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,20 @@ ExaPF release notes ================== -Version 0.7.0 (TBD) +Version 0.7.1 (TDB) +------------------------------- + +- New features + * Add `BlockNetworkStack` structure for batch evaluation (#241) + * Add `ArrowheadJacobian` and `ArrowheadHessian` for stochastic OPF (#241) + * define loads as parameters inside `NetworkStack` (#238) +- Bug fixes & improvements + * Migrate to KernelAbstractions 0.8 (#236) + * Drop support for Julia 1.6 + * Migrate to Krylov.jl 0.8 (#239) + * Update CI + +Version 0.7.0 (March 1st, 2022) ------------------- - API changes diff --git a/Project.toml b/Project.toml index d5f86699..59a1a19c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ExaPF" uuid = "0cf0e50c-a82e-488f-ac7e-41ffdff1b8aa" authors = ["Adrian Maldonado ", "Michel Schanen ", "François Pacaud "] -version = "0.7.0" +version = "0.7.1" [deps] CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" @@ -26,7 +26,7 @@ Krylov = "0.8" LightGraphs = "1.3" Metis = "1" SparseDiffTools = "1" -julia = "1.6" +julia = "1.7" [extras] FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" diff --git a/README.md b/README.md index 9db4298c..0d361129 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ # ExaPF -| **Documentation** | **Release** | **Dev** | -|:-:|:-:|:-:| -| [![][docs-stable-img]][docs-stable-url] | [![][build-stable-img]][build-url] | [![][build-latest-img]][build-url] | -| | [![][codecov-stable-img]][codecov-stable-url] | [![][codecov-latest-img]][codecov-latest-url] | +[![][docs-stable-img]][docs-stable-url] [![][build-latest-img]][build-url] [![][codecov-latest-img]][codecov-latest-url] [![][doi-img]][doi-url] ExaPF is a HPC package implementing a vectorized modeler for power systems. It targets primarily GPU architectures, and provides a portable abstraction to model power systems on upcoming HPC architectures. @@ -78,16 +75,14 @@ This research was supported by the Exascale Computing Project (17-SC-20-SC), a j [docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg -[docs-stable-url]: https://exanauts.github.io/ExaPF.jl/ +[docs-stable-url]: https://exanauts.github.io/ExaPF.jl/stable -[codecov-stable-img]: https://codecov.io/gh/exanauts/ExaPF.jl/branch/master/graphs/badge.svg?branch=master -[codecov-stable-url]: https://codecov.io/github/exanauts/ExaPF.jl?branch=master - -[codecov-latest-img]: https://codecov.io/gh/exanauts/ExaPF.jl/branch/develop/graphs/badge.svg?branch=develop -[codecov-latest-url]: https://codecov.io/github/exanauts/ExaPF.jl?branch=develop +[codecov-latest-img]: https://codecov.io/gh/exanauts/ExaPF.jl/branch/master/graphs/badge.svg?branch=master +[codecov-latest-url]: https://codecov.io/github/exanauts/ExaPF.jl?branch=master [build-url]: https://github.com/exanauts/ExaPF.jl/actions?query=workflow +[build-latest-img]: https://github.com/exanauts/ExaPF.jl/workflows/Run%20tests/badge.svg?branch=master -[build-stable-img]: https://github.com/exanauts/ExaPF.jl/workflows/Run%20tests/badge.svg?branch=master -[build-latest-img]: https://github.com/exanauts/ExaPF.jl/workflows/Run%20tests/badge.svg?branch=develop +[doi-img]: https://zenodo.org/badge/DOI/10.5281/zenodo.5705457.svg +[doi-url]: https://doi.org/10.5281/zenodo.5705457 diff --git a/docs/make.jl b/docs/make.jl index 760a76a4..9036be96 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -39,7 +39,7 @@ makedocs( deploydocs( repo = "github.com/exanauts/ExaPF.jl.git", target = "build", - devbranch = "develop", + devbranch = "master", devurl = "dev", push_preview = true, ) diff --git a/docs/src/lib/formulations.md b/docs/src/lib/formulations.md index 31e25077..b2320179 100644 --- a/docs/src/lib/formulations.md +++ b/docs/src/lib/formulations.md @@ -20,6 +20,7 @@ Control ```@docs PolarForm NetworkStack +BlockNetworkStack init! ``` diff --git a/src/Polar/stacks.jl b/src/Polar/stacks.jl index 9732c335..d5248fd0 100644 --- a/src/Polar/stacks.jl +++ b/src/Polar/stacks.jl @@ -16,7 +16,7 @@ function Base.copyto!(dest::AbstractVector, stack::AutoDiff.AbstractStack{VT}, m end """ - NetworkStack <: AbstractStack + NetworkStack{VT,VD,MT} <: AbstractNetworkStack{VT} NetworkStack(polar::PolarForm) NetworkStack(nbus::Int, ngen::Int, nlines::Int, VT::Type) @@ -141,12 +141,32 @@ voltage(buf::NetworkStack) = buf.vmag .* exp.(im .* buf.vang) voltage_host(buf::NetworkStack) = voltage(buf) |> Array -#= - BlockNetworkStack +""" + BlockNetworkStack{MT,MD,MI} <: AbstractStack{MT} + +Store the variables of the `N` different scenarios +associated to the polar formulation. Extend [`NetworkStack`](@ref). + +The variables are stored in the field `input`, and +are ordered as follows +``` + input = [ vmag^1, ..., vmag^N, vang^1, ..., vang^N, pgen^1, ..., pgen^N] +``` +--- + BlockNetworkStack(polar::PolarForm, k::Int) + +Create a `BlockNetworkStack` with `k` different scenarios using the data stored inside `polar`. + +--- + BlockNetworkStack(polar::PolarForm, pload::Array, qload::Array) +Create a `BlockNetworkStack` using the load scenarios stored +inside the 2-dimensional arrays `pload` and `qload`. - Ordering of input: - [ vmag^1, ..., vmag^N, vang^1, ..., vang^N, pgen^1, ..., pgen^N] -=# +--- + BlockNetworkStack(k::Int, nbus::Int, ngen::Int, nlines::Int, VT::Type) +Create an empty `BlockNetworkStack` with the size needed to stored `k` different scenarios. + +""" struct BlockNetworkStack{MT,MD,NT} <: AbstractNetworkStack{MT} k::Int # INPUT @@ -198,6 +218,28 @@ function BlockNetworkStack(k, nbus, ngen, nlines, VT, VD) return BlockNetworkStack(k, input, vmag, vang, pgen, ψ, intermediate, params, pload, qload) end +function BlockNetworkStack(polar::PolarForm{T,VI,VT,MT}, k::Int) where {T,VI,VT,MT} + nbus = get(polar, PS.NumberOfBuses()) + ngen = get(polar, PS.NumberOfGenerators()) + nlines = get(polar, PS.NumberOfLines()) + stack = BlockNetworkStack(k, nbus, ngen, nlines, VT, VT) + init!(polar, stack) + return stack +end +function BlockNetworkStack( + polar::PolarForm, + ploads::Array{Float64, 2}, + qloads::Array{Float64, 2}, +) + @assert size(ploads) == size(qloads) + k = size(ploads, 2) + blk_stack = BlockNetworkStack(polar, k) + + copyto!(blk_stack.pload, ploads) + copyto!(blk_stack.qload, qloads) + return blk_stack +end + function Base.show(io::IO, stack::BlockNetworkStack) print(io, "$(length(stack.input))-elements BlockNetworkStack{$(typeof(stack.input))}") @@ -232,29 +274,6 @@ function init!(polar::PolarForm, stack::BlockNetworkStack; loads=true) end end -function BlockNetworkStack(polar::PolarForm{T,VI,VT,MT}, k::Int) where {T,VI,VT,MT} - nbus = get(polar, PS.NumberOfBuses()) - ngen = get(polar, PS.NumberOfGenerators()) - nlines = get(polar, PS.NumberOfLines()) - stack = BlockNetworkStack(k, nbus, ngen, nlines, VT, VT) - init!(polar, stack) - return stack -end - -function BlockNetworkStack( - polar::PolarForm, - ploads::Array{Float64, 2}, - qloads::Array{Float64, 2}, -) - @assert size(ploads) == size(qloads) - k = size(ploads, 2) - blk_stack = BlockNetworkStack(polar, k) - - copyto!(blk_stack.pload, ploads) - copyto!(blk_stack.qload, qloads) - return blk_stack -end - function Base.empty!(stack::BlockNetworkStack) fill!(stack.vmag, 0.0) fill!(stack.vang, 0.0)