Skip to content
Snippets Groups Projects
Unverified Commit ac01d755 authored by St. Elmo's avatar St. Elmo
Browse files

error with parallel warmup

parent c367af2f
No related branches found
No related tags found
Loading
......@@ -63,14 +63,11 @@ function hit_and_run(
model,
optimizer;
modifications = modifications,
warmup_points = warmup_indices,
workers = workers, # parallel
)
# load warmup points to workers
map(fetch, save_at.(workers, :ws, Ref(:($ws))))
map(fetch, save_at.(workers, :lbs, Ref(:($lbs))))
map(fetch, save_at.(workers, :ubs, Ref(:($ubs))))
save_at.(workers, :_cobrexa_hit_and_run_warmup, Ref(:($ws, $lbs, $ubs)))
# do in parallel!
samples = dpmap(
......@@ -134,7 +131,7 @@ function _serial_hit_and_run(ws, lbs, ubs, samplesize, keepevery, N)
end
if λmax <= λmin || λmin == -Inf || λmax == Inf # this sometimes can happen
@warn "Infeasible direction at iteration $(n)..."
# @warn "Infeasible direction at iteration $(n)..." # noisy
continue
end
......
......@@ -22,17 +22,22 @@ function warmup(
mod(model, optmodel)
end
map(fetch, save_at.(workers, :warmup_model, Ref(:($optmodel))))
save_model = :(
$optmodel
)
map(fetch, save_at.(workers, :cobrexa_hit_and_run_warmup_model, Ref(save_model)))
ret = m -> value.(m[:x]) # get all the fluxes
# error occurs here :/
fluxes = dpmap(
rid -> :($COBREXA._FVA_optimize_reaction(warmup_model, $rid, $ret)),
rid -> :($COBREXA._FVA_optimize_reaction(cobrexa_hit_and_run_warmup_model, $rid, $ret)),
CachingPool(workers),
[-warmup_points warmup_points],
)
# free the data on workers
map(fetch, remove_from.(workers, :warmup_model))
map(fetch, remove_from.(workers, :cobrexa_hit_and_run_warmup_model))
lbs, ubs = get_bound_vectors(optmodel)
return fluxes, lbs, ubs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment