(This is on a clean Ubuntu 18.04.1)
This has a nasty failure mode: mpirun -n X python foo.py simply runs X independent copies of foo.py, with no obvious indication to the user that the wrong thing is happening.
Can be fixed with sudo update-alternatives --config mpirun, and choosing the mpich option, at least if you have admin rights.
Two suggestions:
- Ideally, the right mpirun should be used automatically (within the virtualenv, if not system-wide)
- Some way of (automatically) verifying that
mpirun -n X isn't just running X serial copies.