]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Provide MPI version number (and OMPI version number as well)
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 12 Oct 2013 19:18:42 +0000 (19:18 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 12 Oct 2013 19:18:42 +0000 (19:18 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31210 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_1_mpi.cmake
deal.II/cmake/setup_finalize.cmake
deal.II/doc/users/Config.sample

index 51408488406939b56ec4060830c7f3dfea7f7bfd..0d1050a8aa0f5af8894f8d381a12d632da1a1905 100644 (file)
@@ -82,6 +82,56 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var)
     ENDIF()
   ENDFOREACH()
 
+  #
+  # Manually assemble some version information:
+  #
+  IF(EXISTS ${MPI_INCLUDE_PATH}/mpi.h)
+    FILE(STRINGS "${MPI_INCLUDE_PATH}/mpi.h" MPI_VERSION_MAJOR_STRING
+      REGEX "#define.*MPI_VERSION")
+    STRING(REGEX REPLACE "^.*MPI_VERSION.*([0-9]+).*" "\\1"
+      MPI_VERSION_MAJOR "${MPI_VERSION_MAJOR_STRING}"
+      )
+    FILE(STRINGS "${MPI_INCLUDE_PATH}/mpi.h" MPI_VERSION_MINOR_STRING
+      REGEX "#define.*MPI_SUBVERSION")
+    STRING(REGEX REPLACE "^.*MPI_SUBVERSION.*([0-9]+).*" "\\1"
+      MPI_VERSION_MINOR "${MPI_VERSION_MINOR_STRING}"
+      )
+    SET(MPI_VERSION "${MPI_VERSION_MAJOR}.${MPI_VERSION_MINOR}")
+    IF("${MPI_VERSION}" STREQUAL ".")
+      SET(MPI_VERSION)
+      SET(MPI_VERSION_MAJOR)
+      SET(MPI_VERSION_MINOR)
+    ENDIF()
+
+    # OMPI specific version number:
+    FILE(STRINGS "${MPI_INCLUDE_PATH}/mpi.h" OMPI_VERSION_MAJOR_STRING
+      REGEX "#define.*OMPI_MAJOR_VERSION")
+    STRING(REGEX REPLACE "^.*OMPI_MAJOR_VERSION.*([0-9]+).*" "\\1"
+      OMPI_VERSION_MAJOR "${OMPI_VERSION_MAJOR_STRING}"
+      )
+    FILE(STRINGS "${MPI_INCLUDE_PATH}/mpi.h" OMPI_VERSION_MINOR_STRING
+      REGEX "#define.*OMPI_MINOR_VERSION")
+    STRING(REGEX REPLACE "^.*OMPI_MINOR_VERSION.*([0-9]+).*" "\\1"
+      OMPI_VERSION_MINOR "${OMPI_VERSION_MINOR_STRING}"
+      )
+    FILE(STRINGS "${MPI_INCLUDE_PATH}/mpi.h" OMPI_VERSION_RELEASE_STRING
+      REGEX "#define.*OMPI_RELEASE_VERSION")
+    STRING(REGEX REPLACE "^.*OMPI_RELEASE_VERSION.*([0-9]+).*" "\\1"
+      OMPI_VERSION_SUBMINOR "${OMPI_VERSION_RELEASE_STRING}"
+      )
+    SET(OMPI_VERSION
+      "${OMPI_VERSION_MAJOR}.${OMPI_VERSION_MINOR}.${OMPI_VERSION_SUBMINOR}"
+      )
+    IF("${OMPI_VERSION}" STREQUAL "..")
+      SET(OMPI_VERSION)
+      SET(OMPI_VERSION_MAJOR)
+      SET(OMPI_VERSION_MINOR)
+      SET(OMPI_VERSION_SUBMINOR)
+    ENDIF()
+
+  ENDIF()
+
+
   # Hide some variables:
   MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY)
 
index 8dd205b3b655c4b0368f4a53c944a990657d25a1..4c4fc377ffafe399405fa791d491be504812317f 100644 (file)
@@ -208,6 +208,10 @@ FOREACH(_var ${_features})
         _detailed("#            TBB_VERSION = ${TBB_VERSION}\n")
       ENDIF()
 
+      IF(_feature MATCHES "MPI" AND DEFINED OMPI_VERSION)
+        _detailed("#            OMPI_VERSION = ${OMPI_VERSION}\n")
+      ENDIF()
+
       #
       # Print out ${_feature}_DIR:
       #
index 4bcbbcbe205efb49232996a23f2092b0059ace44..7b4500bf2f3e0a85f76194b6fb2628dc5da6ab7f 100644 (file)
 # SET(MPI_CXX_INCLUDE_PATH "include directory for mpi" CACHE STRING "")
 # SET(MPI_CXX_COMPILE_FLAGS "..." CACHE STRING "")
 # SET(MPI_CXX_LINK_FLAGS "..." CACHE STRING "")
+# SET(MPI_VERSION "x.y" CACHE STRING "")
+# SET(MPI_VERSION_MAJOR "x" CACHE STRING "")
+# SET(MPI_VERSION_MINOR "y" CACHE STRING "")
 #
 # Additionally:
 #

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.