title: Determining MPI implementation programmatically
body: <p>Say that <code>/path/to/mpi/bin</code> is in my <code>PATH</code>. I can then invoke e.g. <code>mpicc</code> and <code>mpiexec</code>. If I now want to <em>programmatically</em> determine which MPI implementation I am dealing with (e.g. OpenMPI, MPICH), how could I do this?</p>
  
  <p>The solution I got so far is to <code>grep</code> for some more og less arbitrary string in the output of e.g. <code>mpiexec --version</code>.</p>
  
  <p>Specifically I need to distinguish between OpenMPI and MPICH, but a general solution would of course be nice.</p>