Closed oliviaAB closed 6 years ago
The error message is because Julia is writing to the connection directly rather than through the JSON print used for other non-error returns.
The solution seems to be on the Julia side: either get Julia to wait on your computation before giving up; or have your computation return a special not-done-yet value after it waits some length of time. Then the R side would be a repeat
loop that kept recalling the Julia function until it returned the actual answer.
I see, thank you for your help! I will do that.
Hi,
I am trying to run long simulations in Julia (using the module BioSimulator.jl), calling the appropriate functions from R, via the function
juliaCall
. In some cases the simulation is really long (i.e. more than 10 minutes). When trying to run it, after approx. 10 minutes the R interface throws the following error:But the Julia server continues to run the computation.
This is due to the fact that the
JuliaInterface
methodServerTask
is constructed such that it tries for ten minutes (10 trials with a sleep time of 1 sec between them) to listen to the connection. After these 10 trials if the method wasn't able to read anything from the connection it simply return the valuevalue = NA
, which when read by the functionXR::valueFromServer(value, key, get, .self)
from theJuliaInterface
methodServerEval
throws the error. I was wondering if there is any way to wait for the Julia server to finish the computation before trying to read something from the server. I am sorry if my question has a really obvious answer, I am not yet familiar with the XR and XRJulia package.Thanks for your help!