I'm compiling my code on a server that has OpenMPI, but I need to know which version I'm on so I can read the proper documentation. Is there a constant in <mpi.h>
that I can print to display my current version?
Googling tells me that the command to install MPI is sudo apt-get install libcr-dev mpich2 mpich2-doc . Enter that command. If it is already installed, it will tell you. If not, it will tell you how much data needs to be downloaded.
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.
MPI 4.0. MPI-4.0 was approved by the MPI Forum on June 9, 2021. Because of the size, this version does not have a book version. An HTML version is under development.
With the -- prefix option given, OpenMPI binaries are installed in the directory /usr/local/bin and shared libraries in /usr/local/lib. If you want a different installation location, replace /usr/local with your desired directory.
As explained in this tutorial, you may also check the MPI version running the command:
mpiexec --version
or
mpirun --version
in your terminal.
With OpenMPI, the easiest thing to do is to run ompi_info
; the first few lines will give you the information you want. In your own code, if you don't mind something OpenMPI specific, you can look at use OMPI_MAJOR_VERSION
, OMPI_MINOR_VERSION
, and OMPI_RELEASE_VERSION
in mpi.h. That obviously won't work with MPICH2 or other MPI implementations.
More standardly, as part of MPI-3, there is a standard MPI routine called MPI_Get_library_version which gives you detailed library information at run time. This is small enough and useful enough that newer versions of MPI implementations will have this very quickly - for instance it's in the OpenMPI 1.7 development trunk - but it doesn't really help you today.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With