I would like to check my understanding on how CmdStanR works in terms of compilation.
I want to run cmdstan R on a server. I know that if I use
mod <- cmdstan_model("mystanfilename.stan")
to compile the codes, it’ll automatically generate an executable file in the same folder. My question is, in this case, if I then do slurm array runs on the server. Every time it executes the same line of codes, is it true that it no longer needs to recompile the stan codes?
I usually use rstan. With rstan, I need to save the compiled object, then later read it back in order for my slurm array jobs not to recompile again. I’m not sure how to do that with CmdStanr.
I tried to google about this and searched in the forum, but couldn’t find an answer. Let me know if there’s already a post on this that I should read!
I decided to try CmdStanR because, somehow the rstan runs have been unstable. I’m not sure whether it’s because of my server or rstan … for some simple models, it can finish all the runs without problem. But for a bit complicated models, say I’m doing 60 runs of the same model, but with different parameterization, then maybe 10 out of the 60 runs would die out of no reason. I had to keep rerunning those failed jobs until everything is complete, which is pretty annoying…
Many thanks!