-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transition diffeqr to JuliaConnectoR? #19
Comments
Thanks for asking! I'll take a closer look ... |
If you "translate" the example from the documentation of DifferentialEquations to R with the JuliaConnectoR, it looks like this: Original Julia code:
"Translated" R code: Loading the stuff:
Then the real action:
The JuliaConnectoR doesn't get (yet) that
It is also possible to specify
There is one caveat: The JuliaConnectoR was designed with convenience and stability for interactive use. That's why we chose TCP as communication mechanism between Julia and R. But, of course, TCP has a higher cost for the communication when making calls between Julia and R. In every step of the iteration some binary numbers must be sent between Julia and R if the function that is to be optimized is an R function. (If it's a Julia function, this doesn't matter.) There would probably be the need for doing some further benchmarking against the current implementation of diffeqr to decide. |
I tried to do some benchmarking, but I got an error in diffeqr. That is the code that I tried:
I get the following error with diffeqr when running
I don't know what is wrong. I use R version 4.0.2, Julia version 1.4.2 and DifferentialEquations version 6.15.0. |
Did you run |
No, after running Elapsed time for calling the diffeqr code in the loop above a 100 times: 0.4s Elapsed time for calling the JuliaConnectoR code in the loop above a 100 times, using an R function: 29s Elapsed time for calling the JuliaConnectoR code in the loop above a 100 times, using a Julia function: 1.4s In this case, we have the additional overhead of two calls and one additional assignment for the JuliaConnectoR vs one call in the diffeqr implementation, which explains that there is still a difference when using the Julia function. I also report that during one time of exeuting the diffeqr code, I had a segfault/system error, which crashed R. |
diffeqr is probably more suitable for this specific project, though JuliaConnectoR is great! |
It seems like it could be beneficial to offer a more direct interface, like we do with diffeqpy (https://github.com/SciML/diffeqpy). This package might mostly become documentation for how to do things, along with a few helper functions. @stefan-m-lenz what do you think?
The text was updated successfully, but these errors were encountered: