More details on your implementation are needed for us to help. But in general,
- When you do
mpiexec -n 5
you’re launching 5 identical chains, not 5 procs dedicated to PETSc. - You’ll have to control PETSc’ access to MPI ranks through its dedicated communicator (iirc
MPI_COMM_PETSC
). - It’s not clear to me what is in the model that a simple SIR could take advantage of parallelism.
- There’s a working Stan-PETSc coupling effort by @IvanYashchuk