Commit bfe7d03f authored by Jonathan Hu's avatar Jonathan Hu
Browse files

MueLu: Xpetra: fix macro usage in cmake files

This commit allows the MueLu TwoBillion test to compile and run
nontrivially again.

There were multiple problems:

 1) The TwoBillion test itself was using an Xpetra preprocessor macro
 that wasn't ever defined.
 2) The TwoBillion test was protected in CMake with an Xpetra variable
 that was set with "SET" instead of "SET_GLOBAL".
 3) MueLu wasn't using the ASSERT_DEFINED cmake macro, which throws an
 error if a variable isn't defined and would have caught issue #2.

Build/Test Cases Summary
Enabled Packages: MueLu, Xpetra
Enabled all Forward Packages
0) MPI_DEBUG => passed: passed=356,notpassed=0 (27.99 min)
1) SERIAL_RELEASE => passed: passed=348,notpassed=0 (15.15 min)
2) MPI_SS_DEBUG => FAILED: passed=619,notpassed=2 => Not ready to push! (54.96 min)
3) SERIAL_SS_RELEASE => passed: passed=354,notpassed=0 (26.55 min)
WARNING: Forced the push!
parent 91b6cd9f
......@@ -17,6 +17,17 @@ IF (NOT ${PACKAGE_NAME}_ENABLE_Epetra AND NOT ${PACKAGE_NAME}_ENABLE_Tpetra)
MESSAGE(FATAL_ERROR "Neither Epetra nor Tpetra are enabled. MueLu requires at least one of them to be enabled.")
ENDIF()
ASSERT_DEFINED(Xpetra_INT_LONG_LONG)
ASSERT_DEFINED(Xpetra_ENABLE_Experimental)
ASSERT_DEFINED(Xpetra_ENABLE_Kokkos_Refactor)
ASSERT_DEFINED(Tpetra_INST_DOUBLE)
ASSERT_DEFINED(Tpetra_INST_INT_INT)
ASSERT_DEFINED(Tpetra_INST_INT_LONG)
ASSERT_DEFINED(Tpetra_INST_INT_LONG_LONG)
ASSERT_DEFINED(Tpetra_INST_COMPLEX_DOUBLE)
ASSERT_DEFINED(Tpetra_INST_FLOAT)
ASSERT_DEFINED(Teuchos_ENABLE_COMPLEX)
# JJH: pulled this logic from Tpetra. Comments below about CUDA are from Tpetra developers.
# This is redundant, since MueLu also requires Kokkos, and Kokkos requires C++11.
# "I left a special case for CUDA because I'm not sure whether TriBITS
......
......@@ -12,6 +12,7 @@ IF(${PACKAGE_NAME}_ENABLE_EXPLICIT_INSTANTIATION)
APPEND_GLOB(HEADERS ${BDIR}/MueLu_ExplicitInstantiation.hpp)
ENDIF()
ASSERT_DEFINED(Tpetra_INST_INT_INT)
#
# Belos
#
......@@ -169,7 +170,7 @@ IF(${PACKAGE_NAME}_ENABLE_EXPLICIT_INSTANTIATION)
# Set the list of classes in MueLu adapters that are templated
# on <Scalar, LO, GO, Node> for which we want to do ETI using this system.
GLOBAL_SET(MUELUADAPTERS_ETI_CLASSES )
IF (${PACKAGE_NAME}_ENABLE_Belos AND TPETRA_INST_INT_INT)
IF (${PACKAGE_NAME}_ENABLE_Belos AND Tpetra_INST_INT_INT)
APPEND_SET(MUELUADAPTERS_ETI_CLASSES
MueLu::RefMaxwell
)
......
......@@ -2,6 +2,7 @@ ASSERT_DEFINED(
${PACKAGE_NAME}_ENABLE_Tpetra
${PACKAGE_NAME}_ENABLE_Ifpack2
${PACKAGE_NAME}_ENABLE_Amesos2
Xpetra_INT_LONG_LONG
)
TRIBITS_ADD_TEST_DIRECTORIES(unit_tests)
......
......@@ -85,8 +85,6 @@
#include "BelosMueLuAdapter.hpp" // this header defines Belos::MueLuOp()
#endif
// Only run if we have long long
#ifdef HAVE_XPETRA_INT_LONG_LONG
typedef double Scalar;
typedef int LocalOrdinal;
typedef long long GlobalOrdinal;
......@@ -327,24 +325,3 @@ int main(int argc, char *argv[]) {
TEUCHOS_STANDARD_CATCH_STATEMENTS(verbose, std::cerr, success);
return ( success ? EXIT_SUCCESS : EXIT_FAILURE );
}
#else
// if we don't have long longs...
int main(int argc, char *argv[]) {
Teuchos::oblackholestream blackhole;
Teuchos::GlobalMPISession mpiSession(&argc, &argv, &blackhole);
bool success = false;
bool verbose = true;
try {
Teuchos::RCP<const Teuchos::Comm<int> > comm = Teuchos::DefaultComm<int>::getComm();
int MyPID = comm->getRank();
if(MyPID == 0)
printf("TwoBillion: Long long aren't compiled in.\n");
}
TEUCHOS_STANDARD_CATCH_STATEMENTS(verbose, std::cerr, success);
return ( success ? EXIT_SUCCESS : EXIT_FAILURE );
}
#endif
......@@ -91,23 +91,23 @@ ENDIF()
ASSERT_DEFINED (Teuchos_ENABLE_LONG_LONG_INT)
IF (NOT Teuchos_ENABLE_LONG_LONG_INT)
# If Teuchos doesn't have support for long long, we won't get anywhere.
SET (${PACKAGE_NAME}_INT_LONG_LONG OFF)
GLOBAL_SET (${PACKAGE_NAME}_INT_LONG_LONG OFF)
ELSE ()
# Teuchos supports long long. How about Epetra or Tpetra?
IF (${PACKAGE_NAME}_ENABLE_Tpetra)
# Does Tpetra provide LocalOrdinal = int and GlobalOrdinal = long long?
ASSERT_DEFINED(Tpetra_INST_INT_LONG_LONG)
SET (${PACKAGE_NAME}_INT_LONG_LONG ${Tpetra_INST_INT_LONG_LONG})
GLOBAL_SET (${PACKAGE_NAME}_INT_LONG_LONG ${Tpetra_INST_INT_LONG_LONG})
ELSE () # Tpetra NOT enabled
IF (${PACKAGE_NAME}_ENABLE_Epetra)
# Does Epetra provide LocalOrdinal = int and GlobalOrdinal = long long?
IF (${PACKAGE_NAME}_Epetra_NO_64BIT_GLOBAL_INDICES)
SET (${PACKAGE_NAME}_INT_LONG_LONG OFF)
GLOBAL_SET (${PACKAGE_NAME}_INT_LONG_LONG OFF)
ELSE ()
SET (${PACKAGE_NAME}_INT_LONG_LONG ON)
GLOBAL_SET (${PACKAGE_NAME}_INT_LONG_LONG ON)
ENDIF ()
ELSE () # Neither Epetra nor Tpetra are enabled
SET (${PACKAGE_NAME}_INT_LONG_LONG OFF)
GLOBAL_SET (${PACKAGE_NAME}_INT_LONG_LONG OFF)
ENDIF ()
ENDIF ()
ENDIF ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment