]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add the preprocessor command to use 64bit global indices to CMake and check that...
authorBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 31 May 2013 22:58:10 +0000 (22:58 +0000)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 31 May 2013 22:58:10 +0000 (22:58 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29701 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_petsc.cmake
deal.II/cmake/configure/configure_trilinos.cmake
deal.II/cmake/modules/FindPETSC.cmake
deal.II/cmake/modules/FindTRILINOS.cmake
deal.II/cmake/scripts/report_features.cc.in
deal.II/include/deal.II/base/config.h.in
deal.II/include/deal.II/base/types.h

index eaad928c7d7e2e8bd0218ad06dc259362306feb7..a7d8d6d626c578dea52fe25604b7068c89413684 100644 (file)
@@ -45,7 +45,7 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
     # Petsc has to be configured with the same MPI configuration as
     # deal.II.
     #
-    # petscconf.h should export PETSC_HAVE_MPIUNI 1 in case  mpi support is
+    # petscconf.h should export PETSC_HAVE_MPIUNI 1 in case mpi support is
     # _NOT_ enabled.
     # So we check for this:
     #
@@ -65,6 +65,33 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
       SET(${var} FALSE)
     ENDIF()
 
+
+    #
+    # Petsc has to be configured with the same number of bits for indices as
+    # deal.II.
+    #
+    # petscconf.h should export PETSC_WITH_64BIT_INDICES 1 in case 64bits
+    # indices support is enabled.
+    # So we check for this:
+    #
+    IF( (NOT PETSC_WITH_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES)
+         OR
+         (PETSC_WITH_64BIT_INDICES AND NOT DEAL_II_WITH_64BIT_INDICES))
+      MESSAGE(STATUS "Could not find a sufficient PETSc installation: "
+        "PETSc has to be configured to use the same number of bits for the "
+        "global indices as deal.II."
+        )
+      SET(PETSC_ADDITIONAL_ERROR_STRING
+        ${PETSC_ADDITIONAL_ERROR_STRING}
+        "Could not find a sufficient PETSc installation:\n"
+        "PETSc has to be configured to use the same number of bits for the "
+        "global indices as deal.II, but found:\n"
+        "  DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n"
+        "  PETSC_WITH_64BIT_INDICES = (${PETSC_WITH_64BIT_INDICES})\n"
+        )
+      SET(${var} FALSE)
+    ENDIF()
+
     IF(NOT ${var})
       UNSET(PETSC_INCLUDE_DIR_ARCH CACHE)
       UNSET(PETSC_INCLUDE_DIR_COMMON CACHE)
index 346d2165fb3c55b3fefc73d69f872f4fee083232..d7e08f752ffebb7605e2229e38b13f32a657c7e0 100644 (file)
@@ -115,9 +115,47 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
       SET(${var} FALSE)
     ENDIF()
 
+    #
+    # Trilinos has to be configured with 32bit indices if deal.II uses unsigned long
+    # long int.
+    #
+    IF(TRILINOS_WITH_NO_32BIT_INDICES AND NOT DEAL_II_WITH_64BIT_INDICES)
+      MESSAGE(STATUS "deal.II was configured to use 32bit global indices but "
+        "Trilinos was not."
+        ) 
+      SET(TRILINOS_ADDITIONAL_ERROR_STRING
+        ${TRILINOS_ADDITIONAL_ERROR_STRING}
+        "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n"
+        "has to be configured to use the same number of bits as deal.II, but "
+        "found:\n"
+        "  DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n"
+        "  TRILINOS_WITH_NO_32BIT_INDICES = ${TRILINOS_WITH_NO_32_BIT_INDICES}\n" 
+        )
+      SET(${var} FALSE)
+    ENDIF()  
+
+    #
+    # Trilinos has to be configured with 64bit indices if deal.II uses unsigned long
+    # long int.
+    #
+    IF(TRILINOS_WITH_NO_64BIT_INDICES AND DEAL_II_WITH_64BIT_INDICES)
+      MESSAGE(STATUS "deal.II was configured to use 64bit global indices but "
+        "Trilinos was not."
+        ) 
+      SET(TRILINOS_ADDITIONAL_ERROR_STRING
+        ${TRILINOS_ADDITIONAL_ERROR_STRING}
+        "The Trilinos installation (found at \"${TRILINOS_DIR}\")\n"
+        "has to be configured to use the same number of bits as deal.II, but "
+        "found:\n"
+        "  DEAL_II_WITH_64BIT_INDICES = ${DEAL_II_WITH_64BIT_INDICES}\n"
+        "  TRILINOS_WITH_NO_64BIT_INDICES = ${TRILINOS_WITH_NO_64_BIT_INDICES}\n" 
+        )
+      SET(${var} FALSE)
+    ENDIF()  
+
 
     #
-    # Some verions of Sacado_cmath.hpp does things that aren't compatible
+    # Some versions of Sacado_cmath.hpp do things that aren't compatible
     # with the -std=c++0x flag of GCC, see deal.II FAQ.
     # Test whether that is indeed the case
     #
index e61211b6f0a160df99cc6b787215ed2dc098ac09..b3fddfac03cb2c6faed2e68512f6c49d9f14dccd 100644 (file)
@@ -26,6 +26,7 @@
 #     PETSC_VERSION_SUBMINOR
 #     PETSC_VERSION_PATCH
 #     PETSC_WITH_MPIUNI
+#     PETSC_WITH_64BIT_INDICES
 #
 
 INCLUDE(FindPackageHandleStandardArgs)
@@ -153,6 +154,17 @@ IF(PETSC_FOUND)
     SET(PETSC_WITH_MPIUNI TRUE)
   ENDIF()
 
+  #
+  # Is petsc compiled with support for 64BIT_INDICES?
+  #
+  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_64BIT_INDICES_STRING
+    REGEX "#define.*PETSC_USE_64BIT_INDICES 1")
+  IF("${PETSC_64BIT_INDICES_STRING}" STREQUAL "")
+    SET(PETSC_WITH_64BIT_INDICES FALSE)
+  ELSE()
+    SET(PETSC_WITH_64BIT_INDICES TRUE)
+  ENDIF()
+
   FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING
     REGEX "#define.*PETSC_VERSION_MAJOR")
   STRING(REGEX REPLACE "^.*PETSC_VERSION_MAJOR.*([0-9]+).*" "\\1"
index 0c30184f78fa58fe438c2837fb16ab4010e5ff4e..d038db322a08bad217480d0a67b22575e7f26e02 100644 (file)
@@ -99,7 +99,7 @@ IF(TRILINOS_FOUND)
     TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}")
 
   #
-  # Determine whether Trilinos was configured with MPI:
+  # Determine whether Trilinos was configured with MPI and 64bit indices:
   #
   FIND_FILE(EPETRA_CONFIG_H Epetra_config.h
     HINTS ${TRILINOS_INCLUDE_DIRS}
@@ -117,6 +117,20 @@ IF(TRILINOS_FOUND)
   ELSE()
     SET(TRILINOS_WITH_MPI TRUE)
   ENDIF()
+  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_32BIT_STRING
+    REGEX "#define EPETRA_NO_32BIT_GLOBAL_INDICES")
+  IF("${EPETRA_64BIT_STRING}" STREQUAL "")
+    SET(TRILINOS_WITH_NO_32BITS_INDICES TRUE)
+  ELSE()
+    SET(TRILINOS_WITH_NO_32BITS_INDICES FALSE)
+  ENDIF()
+  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_64BIT_STRING
+    REGEX "#define EPETRA_NO_64BIT_GLOBAL_INDICES")
+  IF("${EPETRA_64BIT_STRING}" STREQUAL "")
+    SET(TRILINOS_WITH_NO_64BITS_INDICES TRUE)
+  ELSE()
+    SET(TRILINOS_WITH_NO_64BITS_INDICES FALSE)
+  ENDIF()
 
   UNSET(EPETRA_CONFIG_H CACHE)
 
index 6e9570453f8501b9d95809c85108dddb41db8c95..3b0c072a01ca89a0eab255735edbd782fdba0809 100644 (file)
@@ -166,4 +166,7 @@ std::cout << "dealii-feature: BOOST="
   std::cout << "dealii-feature: LibZ=yes" << std::endl;
 #endif
 
+#ifdef DEAL_II_WITH_64BIT_INDICES
+  std::cout << "dealii-feature: 64bit_indices=yes" <<std::endl;
+#endif  
 }
index 9e21898d6686b1dfd47d6b8bf87e2d5b4c4bef30..fc4d8169a65d034f4a99775e6a17fd9a5de84343 100644 (file)
 #endif
 
 
+/********************************************************************
+ * Configured in configure_trilinos.cmake or configure_petsc.cmake: *
+ ********************************************************************/
+
+#cmakedefine DEAL_II_WITH_64BIT_INDICES
+#ifdef DEAL_II_WITH_64BIT_INDICES
+#  define DEAL_II_USE_LARGE_INDEX_TYPE
+#endif
+
+
 #include <deal.II/base/numbers.h>
 #include <deal.II/base/types.h>
 
index a4cd0022879ad01d4e5d2d5d62c0d9e0c714c876..27aac6be0bdc974512a1941b7a88973e9432f3fb 100644 (file)
@@ -52,7 +52,6 @@ namespace types
    */
   const unsigned int artificial_subdomain_id DEAL_II_DEPRECATED = static_cast<subdomain_id>(-2);
 
-#define DEAL_II_USE_LARGE_INDEX_TYPE
 #ifdef DEAL_II_USE_LARGE_INDEX_TYPE
   /**
    * The type used for global indices of

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.