Skip to content
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

warmup jump+tulip code to save much time later in testing #303

Merged
merged 1 commit into from
Jun 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ using Tulip
# error tolerance in computations)
TEST_TOLERANCE = 10 * COBREXA._constants.tolerance

print_timing(fn, t) = @info "$(fn) done in $(round(t; digits = 2))s"

# helper functions for running tests en masse
function run_test_file(path...)
fn = joinpath(path...)
t = @elapsed include(fn)
@info "$(fn) done in $(round(t; digits = 2))s"
print_timing(fn, t)
end

function run_test_dir(dir, comment = "Directory $dir/")
Expand All @@ -33,7 +35,15 @@ end
# set up the workers for Distributed, so that the tests that require more
# workers do not unnecessarily load the stuff multiple times
W = addprocs(2)
@everywhere using COBREXA, Tulip
t = @elapsed @everywhere using COBREXA, Tulip, JuMP
print_timing("import of packages", t)
t = @elapsed @everywhere begin
model = Model(Tulip.Optimizer)
@variable(model, 0 <= x <= 1)
@objective(model, Max, x)
optimize!(model)
end
print_timing("JuMP+Tulip code warmup", t)

# make sure there's a directory for temporary data
tmpdir = "tmpfiles"
Expand Down