Skip to content

Instantly share code, notes, and snippets.

View rschwarz's full-sized avatar

Robert Schwarz rschwarz

View GitHub Profile
@rschwarz
rschwarz / valgrind.log
Created February 24, 2019 17:29
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
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)
==26500== by 0x4FDB920: access_mem (in /home/rs/opt/julia-1.1.0/lib/libjulia.so.1.1)
@rschwarz
rschwarz / errors.log
Created February 23, 2019 15:41
Non-deterministic behavior: Three consecutive runs on the exact same code.
# 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
@rschwarz
rschwarz / del_var.c
Created January 15, 2019 12:28
use SCIPdelVar for variable which is still in constraint (failed assertion / segfault)
#include "scip/scip.h"
#include "scip/scipdefplugins.h"
// compile with:
// gcc -lscip del_var.c -o del_var
int main() {
SCIP* scip;
SCIP_CALL(SCIPcreate(&scip));
SCIP_CALL(SCIPincludeDefaultPlugins(scip));
@rschwarz
rschwarz / stdlib-deps-dot.jl
Created November 21, 2018 08:59
Write dependencies in Julia's stdlib using DOT format
import Pkg
import Pkg.TOML
const STDLIB_DIR = "/home/rs/opt/julia-1.0.2/share/julia/stdlib/v1.0"
const STDLIBS = readdir(STDLIB_DIR)
println("digraph stdlib {")
for (i, stdlib) in enumerate(STDLIBS)
proj = Pkg.TOML.parsefile(joinpath(STDLIB_DIR, stdlib, "Project.toml"))
@rschwarz
rschwarz / groupby then map with key.ipynb
Created November 8, 2018 19:02
Julia and Query.jl: using the `_.key` syntax with @groupby |> @Map
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rschwarz
rschwarz / vlplot_with_data_keyword.ipynb
Created November 8, 2018 18:44
Julia and VegaLite.jl: using @vlplot with keyword argument `data`
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rschwarz
rschwarz / gist:2ba2c863b027a35ce3f22268074df611
Created February 28, 2018 14:18 — forked from bayan/gist:3382884
Clojure DSL to generate static HTML
;; Generating static HTML using Clojure macros
;; It is possible to write a DSL in Clojure that generates HTML markup without the need to write a separate parser and compiler (e.g. HAML).
;; Our aim here would be to write code that converts the following Clojure code into the HTML below it
;; (html
;; (head)
;; (body
;; (h1 "An example")
@rschwarz
rschwarz / juliaopt.ipynb
Last active April 23, 2017 16:05
JuliaOpt talk (notebook and slides)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rschwarz
rschwarz / gc.log
Last active February 27, 2017 15:31
run once to warm up.
force garbage collection.
run once to warm up (again).
force garbage collection.
-- calling CSIPfreeModel -- 0 mem used
run 3x
force garbage collection.
-- calling CSIPfreeModel -- 0 mem used
-- calling CSIPfreeModel -- 19043000 mem used
-- calling CSIPfreeModel -- 9521500 mem used
@rschwarz
rschwarz / memleaks.jl
Created January 11, 2017 18:04
Demo memory leaks in SCIP.jl
using JuMP
using Cbc
using SCIP
function leaky(solver, d)
m = Model(solver=solver)
@variable(m, x[1:d] >= 0)
solve(m)
end