Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Schwarz rschwarz

View GitHub Profile
@rschwarz
rschwarz / Project.toml
Created May 16, 2020
StackOverflowError with Test.detect_ambiguities
View Project.toml
[deps]
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
@rschwarz
rschwarz / run.jl
Created Mar 10, 2020
JuMP / SCIP benchmark
View run.jl
using JuMP
using SCIP
function run1(N)
m = Model(SCIP.Optimizer)
JuMP.set_optimizer_attribute(m, "display/verblevel", 0)
@variable(m, x[1:N])
@objective(m, Min, sum(x))
@constraint(m, x .>= 1)
JuMP.optimize!(m)
@rschwarz
rschwarz / error.log
Created Sep 25, 2019
Testing SCIP.jl with JuMP.jl in direct mode.
View error.log
julia> test()
ERROR: In `@constraint(model, ind, ind_fun in ind_set)`: unable to add the constraint because we don't recognize MathOptInterface.VectorAffineFunction{Float64}(MathOptInterface.VectorAffineTerm{Float64}[VectorAffineTerm{Float64}(1, ScalarAffineTerm{Float64}(1.0, VariableIndex(3))), VectorAffineTerm{Float64}(2, ScalarAffineTerm{Float64}(0.2, VariableIndex(1))), VectorAffineTerm{Float64}(2, ScalarAffineTerm{Float64}(1.0, VariableIndex(2)))], [0.0, 0.0]) as a valid JuMP function.
Stacktrace:
[1] error(::String, ::String) at ./error.jl:42
[2] _macro_error(::Symbol, ::Array{Any,1}, ::String) at /home/rs/.julia/packages/JuMP/iGamg/src/macros.jl:1091
[3] (::getfield(JuMP, Symbol("#_error#55")){Symbol})(::String) at /home/rs/.julia/packages/JuMP/iGamg/src/macros.jl:565
[4] build_constraint(::getfield(JuMP, Symbol("#_error#55")){Symbol}, ::MathOptInterface.VectorAffineFunction{Float64}, ::MathOptInterface.IndicatorSet{ACTIVATE_ON_ONE::ActivationCondition = 1,MathOptInterface.LessThan{Float64}}) at /h
@rschwarz
rschwarz / repl.log
Created Mar 15, 2019
Julia Pkg, using branch of package
View repl.log
# rs@t440p:~/.julia/dev/SCIP/test/MINLPTests [git:master o] [14:01:23]
$ julia --project=.
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.1.0 (2019-01-21)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
@rschwarz
rschwarz / steps.log
Created Mar 3, 2019
Failure when building docs for MathOptInterface.jl locally (Julia 1.1)
View steps.log
# rs@t440p:~/.julia/dev/MathOptInterface/docs [git:master o] [8:21:53]
$ git pull
Already up-to-date.
# rs@t440p:~/.julia/dev/MathOptInterface/docs [git:master o] [8:21:59]
$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
@rschwarz
rschwarz / exprcreate.c
Created Mar 2, 2019
C wrapper for SCIPexprCreate without variadic arguments of mixed type.
View exprcreate.c
#include "scip/scip.h"
/*
* To create nonlinear constraints in SCIP, one creates an expression tree whose
* nodes are of type SCIP_EXPR*. To create these nodes, there is a variadic
* function, SCIPexprCreate:
*
* SCIP_RETCODE SCIPexprCreate(BMS_BLKMEM* blkmem, SCIP_EXPR** expr,
* SCIP_EXPROP op, ...);
*
@rschwarz
rschwarz / example_session.log
Created Feb 25, 2019
MWE for non-deterministic behavior of Julia with ccall, compared to equivalent(?) C code
View example_session.log
$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.1.0 (2019-01-21)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
@rschwarz
rschwarz / test_repr.c
Created Feb 24, 2019
Try to reproduce non-deterministic behavior with pure C code calling SCIP.
View test_repr.c
#include "scip/scip.h"
#include "scip/scipdefplugins.h"
int main() {
SCIP* scip = NULL;
SCIP_CALL( SCIPcreate(&scip) );
SCIP_CALL( SCIPincludeDefaultPlugins(scip) );
SCIP_CALL( SCIPcreateProbBasic(scip, "lp") );
@rschwarz
rschwarz / valgrind.log
Created Feb 24, 2019
Output from: valgrind --leak-check=full --show-leak-kinds=all --smc-check=all-non-file --trace-children=yes --suppressions=/home/rs/in/valgrind-julia.supp julia --project=/home/rs/.julia/environments/scip /home/rs/.julia/dev/SCIP/test/runtests.jl 2>&1 | tee log
View valgrind.log
This file has been truncated, but you can view the full file.
==26500== Memcheck, a memory error detector
==26500== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==26500== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==26500== Command: julia --project=/home/rs/.julia/environments/scip /home/rs/.julia/dev/SCIP/test/runtests.jl
==26500==
==26500== Syscall param msync(start) points to unaddressable byte(s)
==26500== at 0x59C479D: ??? (syscall-template.S:84)
==26500== by 0x4FDB6B7: msync_validate (in /home/rs/opt/julia-1.1.0/lib/libjulia.so.1.1)
==26500== by 0x4FDB7E5: validate_mem (in /home/rs/opt/julia-1.1.0/lib/libjulia.so.1.1)
@rschwarz
rschwarz / errors.log
Created Feb 23, 2019
Non-deterministic behavior: Three consecutive runs on the exact same code.
View errors.log
# rs@t440p:~ [16:38:07]
$ julia --project=/home/rs/.julia/environments/scip ~/.julia/dev/SCIP/test/runtests.jl
linear expressions: Test Failed at /home/rs/.julia/dev/SCIP/test/MOI_nonlinear_exprs.jl:49
Expression: MOI.get(optimizer, MOI.TerminationStatus()) == MOI.OPTIMAL
Evaluated: DUAL_INFEASIBLE::TerminationStatusCode = 3 == OPTIMAL::TerminationStatusCode = 1
Stacktrace:
[1] top-level scope at /home/rs/.julia/dev/SCIP/test/MOI_nonlinear_exprs.jl:49
[2] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
[3] top-level scope at /home/rs/.julia/dev/SCIP/test/MOI_nonlinear_exprs.jl:20
linear expressions: Test Failed at /home/rs/.julia/dev/SCIP/test/MOI_nonlinear_exprs.jl:53
You can’t perform that action at this time.