-
Notifications
You must be signed in to change notification settings - Fork 91
Add OPF benchmark #2739
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
base: master
Are you sure you want to change the base?
Add OPF benchmark #2739
Conversation
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9" | ||
JuMP = "4076af6c-e467-56ae-b986-b466b2749572" | ||
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" | ||
PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need compat
@@ -0,0 +1,30 @@ | |||
ROSETTA_OPF_DIR = "/home/blegat/git/rosetta-opf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use Downloads
to download the file to a temp directory?
@@ -0,0 +1,30 @@ | |||
ROSETTA_OPF_DIR = "/home/blegat/git/rosetta-opf" | |||
include(joinpath(ROSETTA_OPF_DIR, "jump.jl")) | |||
model = opf_model(parse_data(joinpath(ROSETTA_OPF_DIR, "data/opf_warmup.m"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not useful to test this one. You really need a much larger file to stress test the code paths.
using Revise
import Ipopt
import JuMP
import MathOptInterface as MOI
import PGLib
import PowerModels
model = JuMP.direct_model(Ipopt.Optimizer())
pm = PowerModels.instantiate_model(
PGLib.pglib("pglib_opf_case10000_goc"),
PowerModels.ACPPowerModel,
PowerModels.build_opf;
jump_model = model,
);
ipopt = JuMP.backend(model)
x = MOI.get(ipopt, MOI.ListOfVariableIndices())
m, n = length(ipopt.nlp_model.constraints), length(x)
evaluator = MOI.Nonlinear.Evaluator(
ipopt.nlp_model,
MOI.Nonlinear.SparseReverseMode(),
x,
)
MOI.initialize(evaluator, [:Grad, :Jac, :Hess])
H_struct = MOI.hessian_lagrangian_structure(evaluator)
H = zeros(length(H_struct))
mu = rand(m)
sigma = 0.0
x_v = rand(n)
@time MOI.eval_hessian_lagrangian(evaluator, H, x_v, sigma, mu) |
No description provided.