Running chains on multiple cores

I am using the cmdstan interface with the following sys config:

OS: Ubuntu 22.04 5.15.0-58-generic
CPU: Ryzen 9 5900x 12 core 24 threads
Memory: 64GB

I am trying to run sampling with multiple chains. According to the cmdstan documentation, I created make/local and enabled STAN_THREADS=true, proceeded to build cmdstan and compiled the models with STAN_THREADS=true. From here: 4 MCMC Sampling | CmdStan User’s Guide, I ran the model executable with num_chains=4 and num_threads=4 arguments.

According to the docs, if I have no within-chain parallelization (which I don’t), the chains should run in parallel instead of doing so sequentially. However, output1.csv, output2.csv… etc are being created. The docs implied that this means they are running sequentially. If this is the case, how does one enable parallel chain execution ?

The wording of that part of the documentation is poor, the file names will be the same in either case. The best way to tell if parallel or sequential sampling is occurring is to monitor the console output. If it is sequential, you will see messages like

Chain 1 ....
Chain 1 ....
...
Chain 2 ....
Chain 2 ....
...

But if it is in parallel, these will be all occuring at the same time, so output will look more like

Chain 1 ....
Chain 3 ....
Chain 4 ....
Chain 2 ...
Chain 3 ....
Chain 1 ....
1 Like

thanks!