title: How do I tell what version of MPICH or OpenMPI that I have?
body: <p>I am an extremely novice user of MPI and its relatives.  On the node that I have access to at my institution, MPI is installed, but I would like to know what version I have.</p>
  <p><a href="https://stackoverflow.com/questions/17356765/how-do-i-check-the-version-of-mpich">From this old question,</a> an answer suggests trying:</p>
  <pre><code>mpiexec --version
  </code></pre>
  <p>But when I try this, I get this error message:</p>
  <pre><code>invalid &quot;local&quot; arg: --version
  
  usage:
  mpiexec [-h or -help or --help]    # get this message
  mpiexec -file filename             # (or -f) filename contains XML job description
  mpiexec [global args] [local args] executable [args]
  </code></pre>
  <p>Having said this, I am not completely sure that I have MPICH.  I may instead have OpenMPI.  But I do, I think, have MPICH because I ran <code>ldd</code> on my program, and the output included references to <code>libmpich.so</code>, which <a href="https://stackoverflow.com/questions/15619218/did-i-compile-with-openmpi-or-mpich">an answer to this old question</a> says is indicative of MPICH rather than OpenMPI.</p>
  <p>Do you have any ideas of how I can extract the version of MPI that I am using?</p>
  <h1>Addendum</h1>
  <p>Another answer on <a href="https://stackoverflow.com/questions/17356765/how-do-i-check-the-version-of-mpich">that old question</a> says to try:</p>
  <pre><code>mpicc -v
  </code></pre>
  <p>I have tried this, and I get this output:</p>
  <pre><code>mpicc for MPICH2 version 1.2.1p1
  Using built-in specs.
  Target: x86_64-linux-gnu
  Thread model: posix
  gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
  </code></pre>
  <p>So I guess I have <strong>MPICH2 version 1.2.1p1</strong>.  But can I know from this that for sure that <strong>MPICH2 version 1.2.1p1</strong> is currently installed?  Or could it be that <code>mpicc</code> was configured with <strong>MPICH2 version 1.2.1p1</strong> and now a different version of MPI could be installed?</p>