I am using foreach()
to run a batch execution of data with cmdstanr on a Linux workstation. I am able to run the batch execution fine on Windows, but when I switch to Linux, I get an error:
Error in read_cmstan_csv(): Assertion on 'files' failed: File does not exist
Below is the function I am using to run the batch execution:
result_all <- foreach(i = 1:5, .packages="cmdstanr") %dopar% {
mod <- mod_2step$sample(data = data[[i]],
refresh=0,
seed = 20040425,
chains=chains,
iter_warmup = 2500,
iter_sampling = 2500,
thin=thin,
max_treedepth=20,adapt_delta=0.99,
parallel_chains = 4)
}