I am running a model estimation with cmdstan on a linux machine. I sent a batch script to the machine and it started to run the first chain. However, according to the output file, the second chain is not running. I am wondering if I have to adjust the number of nodes or the number of tasks per node in the batch script. So far, I only increased the number of CPUs in the script to 2, because I want to run 2 chains in parallel.
Here is my script:
#!/bin/bash -l
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=2
#SBATCH --mem=8GB
#SBATCH --time=336:00:00
#SBATCH --output=%x-%j.out
module load gnu/7.4.0
cd $HOME/cmdstan-2.25.0/examples/bernoulli
for i in {1..2}
do
./bernoulli sample algorithm=hmc engine=nuts max_depth=10 num_samples=2000 data file=bernoulli.data.R
output file=output_${i}.csv &
done
What do I need to adjust to make the chains run in parallel?