mrc-ide / drjacoby

Flexible Markov chain monte carlo via reparameterization
https://mrc-ide.github.io/drjacoby/
Other
12 stars 6 forks source link

Parallel error message #113

Open bobverity opened 2 years ago

bobverity commented 2 years ago

Hi Bob,

Hope you are well.

I tried to run drjacoby using parallel chains, as indicated in the vignette, but unfortunately I get a strange error message:

Error in checkForRemoteErrors(val) : 2 nodes produced errors; first error: Evaluation error: object 'truncate_threshold' not found.

When I run drjacoby serially, I get no error message - the only difference is in the cluster argument

the objects cores and cl give the following output:> cores [1] 20 > cl socket cluster with 20 nodes on host ‘localhost’

obviously not an urgent problem so whenever you have time to look into it, please don't hesitate to ping me!

Thanks!

pwinskill commented 2 years ago

Depending on how the likelihood is set up, sometimes it is necessary to export other user-defined function to have parallel instance when setting up the cluster. I am wondering if that is the case here @bobverity?

For example, one might have:

cl <- parallel::makeCluster(4)
parallel::clusterExport(cl, c("myhelperfunction"))