I am currently working on an R package making use of precompiled Stan code as set up by rstantools::rstan_package_skeleton(). This generally works well, but it fails as soon as I try
to use the ‘cores’ argument of rstan::sampling. Below is the code of the function I use
When running fit_TIRT_stan(, cores = 2), I get the error
Error in checkForRemoteErrors(val) :
2 nodes produced errors; first error: Objekt 'model_thurstonian_irt_model' not found
(thurstonian_irt_model is the name of the precompiled Stan file). Everything works well when running the model only on one core. Do you have an idea what is going wrong based on this information?
If necessary, I will try to build a minimal example using a dummy R package created with rstantools::rstan_package_skeleton().
This usually has to do with a different version of the package being picked up by the nodes than that which is loaded in the current R session. But if you can wait a bit, we are going to roll out a different build process for packages with precompiled models. I don’t know whether it will fix this problem or what new problems it will create, but it fixes some longstanding ones.
Thanks Ben! I get the same error when installing the package from source or binary versions. Do you have any specific workaround in mind? It is not a major issue for me just something I would like to fix at some point.
I have used the latest rstantools version to prepare my package via rstan_package_skeleton. cores will work when I built the package via build source or build binary package but not when running build & reload. Not sure why.