Just wanted to report an issue I encountered while working with RStan on a Linux cluster.
Running a “job array” where several jobs are using the same Stan model from a file
I got many jobs to terminate with “readRDS” errors, like
“Error in readRDS(file) : error reading from connection”
the problem went away once I turned off the
rstan_options(auto_write = TRUE)
seems like multiple processes were trying to read and write into the same “model.rds”
As long as you give the full path to the Stan program when you call stan or sampling on the cluster nodes, it should find the RDS file in the same directory. This can be a bit tricky if the file systems are separate.
Of course, you’ll need to install the optparse package from CRAN for this script to work as is. On the cluster node, just read in the saved model with the readRDS() function.
I am new to RStan. I installed the R version (3.4.2) last week and previously had installed R3.2.2 in 2015 for Windows which is also currently in my C directory. I followed the rstan installation guideline https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Windows and did the testing for rTools. I got fx( 2L, 5 ) # should be 10.