I first ran the mediation analysis using within-chain parallelization (plz see the following code) on my pc. It worked fine with one of my simulated data (I will call it, d12 here.).
- Operating System: windows 10
- CmdStan Version: 0.4.0
outcomeMod <- bf(y ~ mediatorCount + pF + rc
+ (1|i) + (1 + rc|j),
family = "bernoulli")
mediatorMod <- bf(mediatorCount ~ talk + pF + (1|i) + (1 + pF|j),
family = poisson())
fit <- brm(outcomeMod + mediatorMod + set_rescor(FALSE),
data = data[[10]], iter = 16000, chains = 4, cores = 4,
threads = 2, backend = "cmdstanr",
seed = 29, inits = 0, save_pars(group = T, all = T), control=list(adapt_delta=0.99))
Then, I am trying to run the same mediation model on cluster with a slight tweak – I increased the thread number from 2 to 4 (the rest of the code stays exactly the same), and used another simulated data (d10 instead of d12). It gave me the following error message.
- Operating System: CentOS 7.9
- CmdStan Version: 0.4.0
- Compiler/Toolkit: gnu 9.3.0
All 4 chains finished successfully.
Mean chain execution time: 29704.0 seconds.
Total execution time: 30050.2 seconds.
grep: write error
grep: write error
grep: write error
grep: write error
Error: All variables in all chains must have the same length.
Execution halted
I am not sure what is going on. But any help is appreciated! Thank you very much!