As stated in the question, what is the command that lists the current version of MPICH? I am running CentOS.
-
Try reading the man pages. My preferred first guess would be `$prog --version` where `$prog` is whatever name you call MPICH with. – icedwater Jun 28 '13 at 03:35
-
When I do man mpich it says "No manual entry for mpich" – Isopycnal Oscillation Jun 28 '13 at 03:37
-
Did you install the documentation packages? Is `mpich` the command you use? Then I would try `mpich -v`, `mpich --version` or even `mpich --help` to find out more. – icedwater Jun 28 '13 at 03:38
-
1I can understand the confusion. MPICH (along with all other implementation of MPI) does not generate an executable called mpich, but instead create mpirun/mpiexec/lot of other things, none of which are named mpich. – Wesley Bland Jun 28 '13 at 15:19
5 Answers
The command you run to start your application with MPICH is mpiexec
, so the way to check the version is:
mpiexec --version

- 8,816
- 3
- 44
- 59
-
If you're unfamiliar with how to use MPI (or MPICH specifically), there's lots of good websites where you can find tutorials. For the specifics of how to compile and run your program, start with the README inside the MPICH src directory. If you installed from a package manager (like yum, apt-get, brew, etc.) you can find that information at the MPICH website: http://www.mpich.org/documentation/guides/ – Wesley Bland Jun 28 '13 at 13:16
-
-
@Mr_and_Mrs_D, which MPI implementation are you using that doesn't support `--version`? – Wesley Bland Jul 16 '13 at 15:44
-
The one installed in the linux labs at school - i.e. not sure :) See my answer [below](http://stackoverflow.com/a/17535008/281545) – Mr_and_Mrs_D Jul 16 '13 at 15:52
-
This could give you openmpi version if both are installed. So the answers below should perhaps be preferred. – HongboZhu Mar 05 '18 at 14:15
I find that mpichversion
, which is found in the directory as mpicc
, provides very useful information. For example, on my laptop, it displays:
$ mpichversion
MPICH Version: 3.2b1
MPICH Release date: unreleased development copy
MPICH Device: ch3:nemesis
MPICH configure: CC=gcc-4.9 CXX=g++-4.9 FC=gfortran-4.9 F77=gfortran-4.9
--enable-cxx --enable-fortran --enable-threads=runtime
--enable-g=dbg --with-pm=hydra
--prefix=/opt/mpich/dev/gcc/default
--enable-wrapper-rpath --enable-static --enable-shared
MPICH CC: gcc-4.9 -g -O2
MPICH CXX: g++-4.9 -g -O2
MPICH F77: gfortran-4.9 -g -O2
MPICH FC: gfortran-4.9 -g -O2
Note that I reformatted the output slightly (I added whitespace, nothing else) so that it would fit nicely into the fixed column format without requiring a slider.
Note that this provides less information than the previously suggested mpiexec --version
, but the configure flags are given in a slightly less useful format, at least for my purposes (copy-and-paste into new configure invocation).
$ mpiexec --version
HYDRA build details:
Version: 3.2b1
Release Date: unreleased development copy
CC: gcc-4.9
CXX: g++-4.9
F77: gfortran-4.9
F90: gfortran-4.9
Configure options: '--disable-option-checking' '--prefix=/opt/mpich/dev/gcc/default' 'CC=gcc-4.9' 'CXX=g++-4.9' 'FC=gfortran-4.9' 'F77=gfortran-4.9' '--enable-cxx' '--enable-fortran' '--enable-threads=runtime' '--enable-g=dbg' '--with-pm=hydra' '--enable-wrapper-rpath' '--enable-static' '--enable-shared' '--cache-file=/dev/null' '--srcdir=../../../../src/pm/hydra' 'CFLAGS= -g -O2' 'LDFLAGS= ' 'LIBS=-lpthread ' 'CPPFLAGS= -I/Users/jrhammon/Work/MPI/MPICH/git/build/src/mpl/include -I/Users/jrhammon/Work/MPI/MPICH/git/src/mpl/include -I/Users/jrhammon/Work/MPI/MPICH/git/src/openpa/src -I/Users/jrhammon/Work/MPI/MPICH/git/build/src/openpa/src -D_REENTRANT -I/Users/jrhammon/Work/MPI/MPICH/git/build/src/mpi/romio/include'
Process Manager: pmi
Launchers available: ssh rsh fork slurm ll lsf sge manual persist
Topology libraries available: hwloc
Resource management kernels available: user slurm ll lsf sge pbs cobalt
Checkpointing libraries available:
Demux engines available: poll select
(I did not reformat this output.)
One benefit of mpichversion
is that, because it is specific to MPICH (and possibly some MPICH derivatives), you can write a more specific parser for it. I do not know what, if any, information is available from mpiexec --version
for OpenMPI or other non-MPICH MPI implementations.

- 5,374
- 3
- 28
- 45
Well for me it was mpicc -v
mpicc for 1.1.1p1
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
HTH

- 32,208
- 39
- 178
- 361
-
2Wow. That looks like an unbelievably old version of MPICH. It's true that it's different for every implementation, but for recent versions of MPICH and Open MPI and all of their derivatives, you should be able to just say `mpiexec --version`. As an example, if you say `mpicc -v` on a relatively recent version of Open MPI (1.4.3), you get the version info for GCC because the arguments just get passed through. On MPICH, you'd still see the version information for MPICH because it grabs that flag. – Wesley Bland Jul 16 '13 at 15:57
Depending on your rights, you can check yum
(or sudo yum
):
$> yum info mpich2
...
Name : mpich2
Arch : x86_64
Version : 1.2.1
Release : 2.3.el6
Size : 3.7 M
Repo : base
...
shows the relevant section on my machine. Repo : base
would be Repo : installed
for the version you have installed.
Or you can check mpirun
or mpiexec
:
$> mpirun --version
mpirun (Open MPI) 1.6.3

- 5,226
- 1
- 37
- 59
-
1Just a quick note here, the most recent version of MPICH is no longer called MPICH2, just MPICH. Some package managers will still have the old name, but more recent updates might not match up. – Wesley Bland Jun 28 '13 at 13:18
There is a string called MPICH_VERSION in mpi.h that is set to the version. Cray, for example, provides their own application launcher so there isn't the standard set of executables already mentioned for querying the MPICH version.

- 31
- 1