Skip to content

Commit

Permalink
Merge pull request #552 from pepijndevos/pv/progressid
Browse files Browse the repository at this point in the history
add progress_id argument
  • Loading branch information
ChrisRackauckas authored Nov 6, 2023
2 parents e5b03f5 + bf82098 commit 33c1881
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/integrators/integrator_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ end
if integrator.opts.progress && integrator.iter%integrator.opts.progress_steps==0
@logmsg(LogLevel(-1),
integrator.opts.progress_name,
_id = :StochasticDiffEq,
_id = integrator.opts.progress_id,
message=integrator.opts.progress_message(integrator.dt,integrator.u,integrator.p,integrator.t),
progress=integrator.t/integrator.sol.prob.tspan[2])
end
Expand Down Expand Up @@ -227,7 +227,7 @@ end
if integrator.opts.progress
@logmsg(LogLevel(-1),
integrator.opts.progress_name,
_id = :StochasticDiffEq,
_id = integrator.opts.progress_id,
message=integrator.opts.progress_message(integrator.dt,integrator.u,integrator.p,integrator.t),
progress="done")
end
Expand Down
1 change: 1 addition & 0 deletions src/options_type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ mutable struct SDEOptions{tTypeNoUnits,tType,Controller,F2,F3,F4,F5,F6,F7,tstops
progress_steps::Int
progress_name::String
progress_message::F6
progress_id::Symbol
timeseries_errors::Bool
dense_errors::Bool
delta::D
Expand Down
5 changes: 3 additions & 2 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function DiffEqBase.__init(
initialize_save = true,
progress=false,progress_steps=1000,progress_name="SDE",
progress_message = ODE_DEFAULT_PROG_MESSAGE,
progress_id=gensym("StochasticDiffEq"),
userdata=nothing,
initialize_integrator=true,
seed = UInt64(0), alias_u0=false, alias_jumps = Threads.threadid()==1,
Expand Down Expand Up @@ -114,7 +115,7 @@ function DiffEqBase.__init(
error("The given solver is a Fixed timestep method and does not support adaptivity.")
end

progress && @logmsg(LogLevel(-1),progress_name,_id=_id = :StochasticDiffEq,progress=0)
progress && @logmsg(LogLevel(-1),progress_name,_id=progress_id,progress=0)

tType = eltype(prob.tspan)
noise = prob isa DiffEqBase.AbstractRODEProblem ? prob.noise : nothing
Expand Down Expand Up @@ -513,7 +514,7 @@ function DiffEqBase.__init(
tstops,saveat,d_discontinuities,
userdata,
progress,progress_steps,
progress_name,progress_message,
progress_name,progress_message,progress_id,
timeseries_errors,dense_errors,
convert.(uBottomEltypeNoUnits,delta),
dense,save_on,save_start,save_end,save_end_user,save_noise,
Expand Down

0 comments on commit 33c1881

Please sign in to comment.