Skip to content

Commit

Permalink
more import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepijn de Vos committed Nov 6, 2023
1 parent b368879 commit f1494b8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ensemble/basic_ensemble_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,19 @@ function __solve(prob::AbstractEnsembleProblem,
ensemblealg::BasicEnsembleAlgorithm;
trajectories, batch_size = trajectories, progress_aggregate=true,
pmap_batch_size = batch_size ÷ 100 > 0 ? batch_size ÷ 100 : 1, kwargs...)
logger = progress_aggregate ? AggregateLogger(current_logger()) : current_logger()
logger = progress_aggregate ? AggregateLogger(Logging.current_logger()) : Logging.current_logger()

with_logger(logger) do
Logging.with_logger(logger) do
num_batches = trajectories ÷ batch_size
num_batches < 1 &&
error("trajectories ÷ batch_size cannot be less than 1, got $num_batches")
num_batches * batch_size != trajectories && (num_batches += 1)

ChainRulesCore.@ignore_derivatives if get(kwargs, :progress, false)
if get(kwargs, :progress, false)
name = get(kwargs, :progress_name, "Ensemble")
for i in 1:trajectories
Logging.@logmsg(LogLevel(-1), "$name #$i", _id=Symbol("SciMLBase_$i"), progress=0)
msg = "$name #$i"
Logging.@logmsg(LogLevel(-1), msg, _id=Symbol("SciMLBase_$i"), progress=0)
end
end

Expand Down

0 comments on commit f1494b8

Please sign in to comment.