Using MPICH with Boost.MPI on Ubuntu

2020-03-26 13:54发布

问题:

I was trying to use boost.mpi under Ubuntu 12.04. apt-get will install openmpi, but some other software (involving torque) I run expect mpich2/mpich, and complain that

"mpdstartup: Command not found"

I certainly don't want to mess with changing the software to use openmpi and worry about migration issues when the software is upgraded.

My question is, is there a user-friendly way to install boost.mpi + mpich2 in Ubuntu (12.04 LTS)? (e.g. an unofficial repository). In the worst-case, if I have to build boost from source, is there a user-friendly way to uninstall a boost installation when I upgrade to a new boost version? I liked the fact that apt-get will install files and links to well-known locations and do a clean remove when asked to.

BTW, I have tried apt-get installing mpich2 first and then libboost-mpi-dev, but apt-get still installs openmpi even though there is a working mpi implementation. This seems to be somewhat constraining.

Thanks,

回答1:

There's no way to avoid installing openmpi due to the package dependencies. But if you have both openmpi and mpich2 installed, you can use the Debian alternatives system to make mpich2 the preferred mpi on your system. To do this, run:

 sudo update-alternatives --set mpi /usr/include/mpich2