Skip to content

Commit

Permalink
Merge pull request LCSB-BioCore#303 from LCSB-BioCore/mk-warmup-optim…
Browse files Browse the repository at this point in the history
…izer

warmup jump+tulip code to save much time later in testing
  • Loading branch information
exaexa committed Jun 7, 2021
2 parents a9f19a2 + 83cb549 commit d5374a4
Showing 1 changed file with 12 additions and 2 deletions.
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

0 comments on commit d5374a4

Please sign in to comment.