remake
doesn't deep copy; mutating new MTKParameters
affects parent problem as well
#3056
Labels
bug
Something isn't working
remake
doesn't copy theMTKParameters
object, unless new parameters are passed directlynewprob = remake(odeprob)
, any mutations tonewprob.p
will affectodeprob.p
because both fields point to the same thing. This side effect is either a bug or not well documented, because a naive user would not expect this.remake
to possibly be thread unsafe if the problem is remade and then modified within the loopremake(odeprob; p = newp)
ODEProblem
is copied withremake
first, and then the parameters of the new problem modified withreplace!
:odeprob.p
in addition tonewprob.p
every iteration, obviously not threadsafe or generally robustSolution
remake
needs to copy the original problem's parameters when constructing the new problemPackage environment
Version info
The text was updated successfully, but these errors were encountered: