Skip to content
Prev 573 / 696 Next

[R-sig-dyn-mod] compiled code and parallel computing with deSolve

Fantastic, thanks Thomas. 

Works like a charm and so much faster!


-----Urspr?ngliche Nachricht-----
Von: Thomas Petzoldt [mailto:thomas.petzoldt at tu-dresden.de] 
Gesendet: Thursday, 9 November 2017 17:22
An: Special Interest Group for Dynamic Simulation Models in R
Cc: Simeon Lisovski
Betreff: Re: [R-sig-dyn-mod] compiled code and parallel computing with deSolve

Hi,

if I understand you correctly, then you want to use "top level parallelization". It means that R starts several R instances as child processes, each process can call its own ode().

What I do is creating an ordinary function (lets say "foo") that gets all the necessary data (!) and packages (!) and that calls ode() with the appropriate dll. Then a parallelizer, e.g. parLapply calls this function "foo".

Package "growthrates" (https://github.com/tpetzoldt/growthrates/) uses such a mechanism for fitting parametric models in parallel. The function to be fitted can be given in closed form, as an R ODE or a compiled ODE
-- it does not matter at the top level.

Please check if your R child processes get all relevant data, including the event function.

Thomas



Am 09.11.2017 um 14:18 schrieb Simeon Lisovski: