diff --git a/packages/tpetra/core/cmake/TpetraCore_config.h.in b/packages/tpetra/core/cmake/TpetraCore_config.h.in index 2202098bfab6..758c45b52f4a 100644 --- a/packages/tpetra/core/cmake/TpetraCore_config.h.in +++ b/packages/tpetra/core/cmake/TpetraCore_config.h.in @@ -179,4 +179,6 @@ @TPETRA_DEPRECATED_DECLARATIONS@ +#cmakedefine TPETRA_DEPRECATED_DECLARATIONS + #endif // TPETRACORE_CONFIG_H diff --git a/packages/tpetra/core/src/CMakeLists.txt b/packages/tpetra/core/src/CMakeLists.txt index d7a26fa72032..4b09921691b3 100644 --- a/packages/tpetra/core/src/CMakeLists.txt +++ b/packages/tpetra/core/src/CMakeLists.txt @@ -647,6 +647,10 @@ TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.h) APPEND_GLOB(HEADERS ${DIR}/*.hpp) APPEND_GLOB(SOURCES ${DIR}/*.cpp) +IF (NOT Tpetra_ENABLE_DEPRECATED_CODE OR NOT TpetraCore_ENABLE_Epetra) + LIST(REMOVE_ITEM SOURCES ${DIR}/Epetra_TsqrMessenger.cpp) + LIST(REMOVE_ITEM SOURCES ${DIR}/Tpetra_EpetraRowMatrix.cpp) +ENDIF() TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${DIR}) # Pull in the Kokkos refactor code. diff --git a/packages/tpetra/core/src/Epetra_TsqrAdaptor.hpp b/packages/tpetra/core/src/Epetra_TsqrAdaptor.hpp index f195e912a40b..ef94185b73a9 100644 --- a/packages/tpetra/core/src/Epetra_TsqrAdaptor.hpp +++ b/packages/tpetra/core/src/Epetra_TsqrAdaptor.hpp @@ -54,7 +54,15 @@ #include "Tpetra_ConfigDefs.hpp" -#if defined(HAVE_TPETRA_EPETRA) && defined(HAVE_TPETRA_TSQR) +#if defined(TPETRA_ENABLE_DEPRECATED_CODE) +#if defined(TPETRA_DEPRECATED_DECLARATIONS) +#warning This file is deprecated due to Epetra removal and will be removed +#endif +#else +#error This file is deprecated due to Epetra removal and will be removed +#endif + +#if defined(TPETRA_ENABLE_DEPRECATED_CODE) && defined(HAVE_TPETRA_EPETRA) && defined(HAVE_TPETRA_TSQR) #include "Tsqr_NodeTsqrFactory.hpp" // create intranode TSQR object #include "Tsqr.hpp" // full (internode + intranode) TSQR @@ -93,6 +101,7 @@ namespace Epetra { /// \warning The current implementation of this adaptor requires /// that all Epetra_MultiVector inputs use the same communicator /// object (that is, the same Epetra_Comm) and map. + TPETRA_DEPRECATED_MSG("epetra removal") class TsqrAdaptor : public Teuchos::ParameterListAcceptorDefaultBase { public: typedef Epetra_MultiVector MV; @@ -369,7 +378,7 @@ namespace Epetra { } // namespace Epetra -#endif // defined(HAVE_TPETRA_EPETRA) && defined(HAVE_TPETRA_TSQR) +#endif // defined(TPETRA_ENABLE_DEPRECATED_CODE) && defined(HAVE_TPETRA_EPETRA) && defined(HAVE_TPETRA_TSQR) #endif // EPETRA_TSQRADAPTOR_HPP diff --git a/packages/tpetra/core/src/Epetra_TsqrMessenger.cpp b/packages/tpetra/core/src/Epetra_TsqrMessenger.cpp index f297abdbdf94..01c0debda0e9 100644 --- a/packages/tpetra/core/src/Epetra_TsqrMessenger.cpp +++ b/packages/tpetra/core/src/Epetra_TsqrMessenger.cpp @@ -52,10 +52,11 @@ /// time to fix their build systems later. /// -#include +#include "TpetraCore_config.h" #if defined(HAVE_TPETRA_EPETRA) && defined(HAVE_TPETRA_TSQR) +#include #include // EPETRA_MPI #include // HAVE_TEUCHOS_MPI diff --git a/packages/tpetra/core/src/Epetra_TsqrMessenger.hpp b/packages/tpetra/core/src/Epetra_TsqrMessenger.hpp index d11ec38e29b1..e09e35e1b5ed 100644 --- a/packages/tpetra/core/src/Epetra_TsqrMessenger.hpp +++ b/packages/tpetra/core/src/Epetra_TsqrMessenger.hpp @@ -57,7 +57,11 @@ #include -#if defined(HAVE_TPETRA_EPETRA) && defined(HAVE_TPETRA_TSQR) +#if !defined(TPETRA_ENABLE_DEPRECATED_CODE) +#error This file is deprecated due to Epetra removal and will be removed +#endif + +#if defined(TPETRA_ENABLE_DEPRECATED_CODE) && defined(HAVE_TPETRA_EPETRA) && defined(HAVE_TPETRA_TSQR) // Include Epetra's MPI wrappers. #include @@ -80,11 +84,13 @@ namespace TSQR { /// object. Otherwise, return a Teuchos::SerialComm instance. It /// should be one of these two things, but if it's not, this /// function throws std::invalid_argument. + TPETRA_DEPRECATED_MSG("epetra removal") Teuchos::RCP > extractTeuchosComm (const Teuchos::RCP& epetraComm); //! Wrap the given Epetra_Comm in an object that TSQR understands. template + TPETRA_DEPRECATED_MSG("epetra removal") Teuchos::RCP > makeTsqrMessenger (const Teuchos::RCP& pComm) { @@ -98,7 +104,7 @@ namespace TSQR { } // namespace Epetra } // namespace TSQR -#endif // defined(HAVE_TPETRA_EPETRA) && defined(HAVE_TPETRA_TSQR) +#endif // defined(TPETRA_ENABLE_DEPRECATED_CODE) && defined(HAVE_TPETRA_EPETRA) && defined(HAVE_TPETRA_TSQR) #endif // EPETRA_TSQRMESSENGER_HPP diff --git a/packages/tpetra/core/src/Tpetra_EpetraRowMatrix.hpp b/packages/tpetra/core/src/Tpetra_EpetraRowMatrix.hpp index a513890810ef..a5a10c61d282 100644 --- a/packages/tpetra/core/src/Tpetra_EpetraRowMatrix.hpp +++ b/packages/tpetra/core/src/Tpetra_EpetraRowMatrix.hpp @@ -46,7 +46,11 @@ #include "TpetraCore_config.h" -#if defined(HAVE_TPETRA_EPETRA) +#if !defined(TPETRA_ENABLE_DEPRECATED_CODE) +#error This file is deprecated due to Epetra removal and will be removed +#endif + +#if defined(TPETRA_ENABLE_DEPRECATED_CODE) && defined(HAVE_TPETRA_EPETRA) #include #include @@ -64,6 +68,7 @@ namespace Details { // just like std::shared_ptr. We only return // std::shared_ptr because Epetra_Comm is an abstract // base class, so we must return it by pointer. +TPETRA_DEPRECATED_MSG("epetra removal") std::shared_ptr makeEpetraCommFromTeuchosComm (const Teuchos::Comm& teuchosComm); @@ -72,7 +77,9 @@ makeEpetraCommFromTeuchosComm (const Teuchos::Comm& teuchosComm); namespace { // (anonymous) + template +TPETRA_DEPRECATED_MSG("epetra removal") Epetra_Map tpetraToEpetraMapTmpl (const TpetraMapType& tpetraMap) { @@ -119,9 +126,11 @@ tpetraToEpetraMapTmpl (const TpetraMapType& tpetraMap) namespace Tpetra { //! A class for wrapping a Tpetra::RowMatrix object in the Epetra_RowMatrix interface. -template -class EpetraRowMatrix : public Epetra_BasicRowMatrix { +template class +TPETRA_DEPRECATED_MSG("epetra removal") +EpetraRowMatrix : public Epetra_BasicRowMatrix { public: + EpetraRowMatrix(const Teuchos::RCP &mat, const Epetra_Comm &comm); virtual ~EpetraRowMatrix() {}; @@ -218,7 +227,7 @@ int EpetraRowMatrix::NumMyRowEntries(int MyRow, int & NumEntri }//namespace Tpetra -#endif // defined(HAVE_TPETRA_EPETRA) +#endif // defined(TPETRA_ENABLE_DEPRECATED_CODE) && defined(HAVE_TPETRA_EPETRA) //here is the include-guard #endif: diff --git a/packages/tpetra/core/test/BasicPerfTest/BasicPerfTest.cpp b/packages/tpetra/core/test/BasicPerfTest/BasicPerfTest.cpp index 9de0b92ca345..25286d965721 100644 --- a/packages/tpetra/core/test/BasicPerfTest/BasicPerfTest.cpp +++ b/packages/tpetra/core/test/BasicPerfTest/BasicPerfTest.cpp @@ -280,7 +280,6 @@ TEUCHOS_UNIT_TEST_TEMPLATE_3_DECL( BasicPerfTest, MatrixAndMultiVector, LO, GO, // // nrhs - Number of rhs to generate. (First interface produces vectors, so nrhs is not needed // -// comm (In) - an Epetra_Comm object describing the parallel machine (numProcs and my proc ID) // map (Out) - Map describing distribution of matrix and vectors/multivectors // A (Out) - CrsMatrix constructed for nx by ny grid using prescribed stencil // Off-diagonal values are random between 0 and 1. If diagonal is part of stencil, diff --git a/packages/tpetra/core/test/CMakeLists.txt b/packages/tpetra/core/test/CMakeLists.txt index af7b3842edfb..ff0760310286 100644 --- a/packages/tpetra/core/test/CMakeLists.txt +++ b/packages/tpetra/core/test/CMakeLists.txt @@ -38,7 +38,6 @@ ADD_SUBDIRECTORIES( Tsqr ) -ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Epetra) -IF (${PACKAGE_NAME}_ENABLE_Epetra) +IF (Tpetra_ENABLE_DEPRECATED_CODE AND ${PACKAGE_NAME}_ENABLE_Epetra) ADD_SUBDIRECTORY(EpetraRowMatrix) ENDIF() diff --git a/packages/tpetra/core/test/CrsMatrix/CrsMatrix_MatvecH2D.cpp b/packages/tpetra/core/test/CrsMatrix/CrsMatrix_MatvecH2D.cpp index 1cca3aa9278d..1e206abc63a4 100644 --- a/packages/tpetra/core/test/CrsMatrix/CrsMatrix_MatvecH2D.cpp +++ b/packages/tpetra/core/test/CrsMatrix/CrsMatrix_MatvecH2D.cpp @@ -120,7 +120,6 @@ namespace { typedef CrsMatrix MAT; typedef MultiVector MV; typedef typename ST::magnitudeType Mag; - typedef ScalarTraits MT; // This code is left in in case people want to debug future issues using the Kokkos profiling // hooks in Tpetra diff --git a/packages/tpetra/core/test/EpetraRowMatrix/CMakeLists.txt b/packages/tpetra/core/test/EpetraRowMatrix/CMakeLists.txt index db72da25089b..63aaf85e1e4c 100644 --- a/packages/tpetra/core/test/EpetraRowMatrix/CMakeLists.txt +++ b/packages/tpetra/core/test/EpetraRowMatrix/CMakeLists.txt @@ -5,4 +5,4 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( ${TEUCHOS_STD_UNIT_TEST_MAIN} ARGS "" STANDARD_PASS_OUTPUT - ) +) diff --git a/packages/tpetra/core/test/ImportExport/CMakeLists.txt b/packages/tpetra/core/test/ImportExport/CMakeLists.txt index 0d9f61381304..1704adca6e54 100644 --- a/packages/tpetra/core/test/ImportExport/CMakeLists.txt +++ b/packages/tpetra/core/test/ImportExport/CMakeLists.txt @@ -103,7 +103,7 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( STANDARD_PASS_OUTPUT ) -IF (${PROJECT_NAME}_ENABLE_Epetra) +IF (Tpetra_ENABLE_DEPRECATED_CODE AND ${PROJECT_NAME}_ENABLE_Epetra) IF(NOT Trilinos_NO_32BIT_GLOBAL_INDICES AND Tpetra_INST_INT_INT) # Tpetra bug 5430: # https://software.sandia.gov/bugzilla/show_bug.cgi?id=5430