MPI in pystan



I’m a little confused how to run MPI inside pystan. I understand that there are flags described here that turn on threading: but is there an equivalent for turning on MPI?
Thanks for the help!


It is not currently implemented.

I have tried to set it up for PyStan 2.18 with updated Stan source, but I still have not found a way to share MPI to C++ from Python, considering that script should also compile the Stan program.

Lately my dev-time has gone for ArviZ, so this MPI thing has been in the background.

But if you are able to run CmdStan with MPI then you could try to import CmdStan output csvs with arviz.from_cmdstan and use the inference_data class to access your samples.

I think that implementing MPI for httpstan will be easier so it might land for PyStan 3.


Great, thanks for clarifying! I hadn’t seen ArviZ before, looks like a very useful package in general for python users