Commit 56a7f9b7 authored by Mark Hoemmen's avatar Mark Hoemmen
Browse files

Moved KokkosLinAlg subpackage from Kokkos into Tpetra as TpetraKernels.

I moved the KokkosLinAlg subpackage of Kokkos into Tpetra, and renamed
it "TpetraKernels".  This move will facilitate moving Kokkos from the
Trilinos repository into its own Github repository.  I renamed it from
"LinAlg" because all of Tpetra implements "linear algebra."  The name
"Kernels" better suggests the contents: single-MPI-process,
thread-parallel computational kernels.

I also fixed downstream packages that depended on KokkosLinAlg.  This
includes both the package name (KokkosLinAlg -> TpetraKernels) and
various library names.

This commit mainly affects Kokkos and Tpetra.  I also had to make
minor changes to Isorropia, ShyLu, Stokhos, TrilinosCouplings, and
Xpetra.  In particular, Xpetra's "FakeKokkos" (KokkosClassic
replacement headers for when building with Tpetra disabled) caused
some bizarre build errors until I finally figured out that Xpetra was
using "Xpetra_ENABLE_Kokkos" to key on whether to use FakeKokkos'
headers.  This manifested as Tpetra files not getting the contents of
TpetraClassic files (like Kokkos_ConfigDefs.hpp), but only when
building in Xpetra.  I fixed this by making Xpetra key on
Xpetra_ENABLE_Tpetra, since the former KokkosClassic now lives in
Tpetra.

NOTE: The Kokkos refactor version of MueLu does not currently build
with ETI enabled, because of some missing explicit instantiations.
Here is the error message I get:

Linking CXX executable MueLu_Challenge_XML.exe
../../../src/libmuelu.so.11.13: undefined reference to `Ifpack2::AdditiveSchwarz<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> >, Ifpack2::Preconditioner<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > >::AdditiveSchwarz(Teuchos::RCP<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > const> const&, int)'
../../../src/libmuelu.so.11.13: undefined reference to `Ifpack2::Details::OneLevelFactory<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > >::create(std::string const&, Teuchos::RCP<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > const> const&) const'
../../../src/libmuelu.so.11.13: undefined reference to `Ifpack2::Chebyshev<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > >::getLambdaMaxForApply() const'
../../../src/libmuelu.so.11.13: undefined reference to `Ifpack2::Hiptmair<Tpetra::CrsMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > >::Hiptmair(Teuchos::RCP<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > const> const&, Teuchos::RCP<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > const> const&, Teuchos::RCP<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > const> const&)'
../../../src/libmuelu.so.11.13: undefined reference to `Ifpack2::Krylov<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > >::Krylov(Teuchos::RCP<Tpetra::RowMatrix<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::OpenMP> > const> const&)'
collect2: error: ld returned 1 exit status

Note that KokkosDeviceWrapperNode<Kokkos::OpenMP> is NOT the default
Node type in this build; the default Node type is
KokkosDeviceWrapperNode<Kokkos::Serial>.  As far as I can tell,
Ifpack2 only does ETI for the default Node type.  It could be that
MueLu is explicitly requesting ETI for a NON-default Node type, or it
could be that I messed up somewhere with the macros.  I'll have to
work a little bit harder at this, but I think it's OK to finish the
subpackage migration process first.
parent e17acde0
SET(LIB_REQUIRED_DEP_PACKAGES Teuchos)
SET(LIB_OPTIONAL_DEP_PACKAGES EpetraExt Ifpack ML TriKota Anasazi Sacado NOX Isorropia KokkosCore KokkosLinAlg KokkosMpiComm KokkosAlgorithms Tpetra Ifpack2 MueLu Belos Amesos2)
SET(LIB_OPTIONAL_DEP_PACKAGES EpetraExt Ifpack ML TriKota Anasazi Sacado NOX Isorropia KokkosCore TpetraKernels KokkosMpiComm KokkosAlgorithms Tpetra Ifpack2 MueLu Belos Amesos2)
SET(TEST_REQUIRED_DEP_PACKAGES)
SET(TEST_OPTIONAL_DEP_PACKAGES AztecOO Stratimikos Zoltan)
SET(LIB_REQUIRED_DEP_TPLS)
......
......@@ -72,8 +72,12 @@
/* Define if KokkosCore is enabled */
#cmakedefine HAVE_STOKHOS_KOKKOSCORE
/* Define if KokkosLinAlg is enabled */
#cmakedefine HAVE_STOKHOS_KOKKOSLINALG
/* Define if TpetraKernels is enabled */
#cmakedefine HAVE_STOKHOS_TPETRAKERNELS
#ifdef HAVE_STOKHOS_TPETRAKERNELS
// Define old macro for backwards compatibility.
# define HAVE_STOKHOS_KOKKOSLINALG
#endif // HAVE_STOKHOS_TPETRAKERNELS
/* Define if KokkosMpiCom is enabled */
#cmakedefine HAVE_STOKHOS_KOKKOSMPICOMM
......
......@@ -583,7 +583,7 @@ IF (Stokhos_ENABLE_Sacado)
sacado/kokkos/Stokhos_MemoryTraits.cpp
sacado/kokkos/vector/Kokkos_View_MP_Vector.cpp
)
IF (Stokhos_ENABLE_KokkosLinAlg)
IF (Stokhos_ENABLE_TpetraKernels)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/sacado/kokkos/vector/linalg)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/sacado/kokkos/pce/linalg)
LIST(APPEND SACADO_HEADERS
......
......@@ -8,7 +8,7 @@ IF (Stokhos_ENABLE_EpetraExt)
ENDIF()
ADD_SUBDIRECTORY(KokkosArraySPMVKernels)
IF (Stokhos_ENABLE_KokkosLinAlg)
IF (Stokhos_ENABLE_TpetraKernels)
IF (Stokhos_ENABLE_Sacado)
ADD_SUBDIRECTORY(MPVectorKernels)
ENDIF()
......@@ -18,7 +18,7 @@ ADD_SUBDIRECTORY(CuspSpMM)
ADD_SUBDIRECTORY(CuspAMG)
IF (Stokhos_ENABLE_Sacado AND
Stokhos_ENABLE_KokkosCore AND
Stokhos_ENABLE_KokkosLinAlg)
Stokhos_ENABLE_TpetraKernels)
ADD_SUBDIRECTORY(MPAssembly)
ADD_SUBDIRECTORY(PCEMeanMultiply)
ENDIF()
......@@ -510,7 +510,7 @@ IF(Stokhos_ENABLE_Sacado)
)
ENDIF()
IF (Stokhos_ENABLE_KokkosLinAlg)
IF (Stokhos_ENABLE_TpetraKernels)
IF (Kokkos_ENABLE_Pthread)
TRIBITS_ADD_EXECUTABLE_AND_TEST(
......
......@@ -5,6 +5,9 @@ Release Notes for Trilinos Package Tpetra
Development version (11.13):
----------------------------
* Moved KokkosLinAlg subpackage (from Kokkos) into Tpetra as the
TpetraKernels subpackage
* Split Tpetra into subpackages; moved KokkosClassic and KokkosTSQR
subpackages into Tpetra
......@@ -30,7 +33,7 @@ disabled by default. Here is a summary of the required CMake options.
-D Trilinos_ENABLE_KokkosCore:BOOL=ON
-D Trilinos_ENABLE_KokkosCompat:BOOL=ON
-D Trilinos_ENABLE_KokkosContainers:BOOL=ON
-D Trilinos_ENABLE_KokkosLinAlg:BOOL=ON
-D Trilinos_ENABLE_TpetraKernels:BOOL=ON
-D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON
-D Trilinos_ENABLE_KokkosMpiComm:BOOL=ON
......@@ -48,7 +51,9 @@ Here are some OPTIONAL CMake options that may help reduce build times
if ETI (explicit template instantiation) is enabled:
# Disable KokkosClassic::TPINode
-D KokkosClassic_ENABLE_ThreadPool:BOOL=OFF
-D TpetraClassic_ENABLE_ThreadPool:BOOL=OFF
# Disable KokkosClassic::OpenMPNode
-D TpetraClassic_ENABLE_OpenMP:BOOL=OFF
# Shut off Kokkos' Pthreads back-end.
-D Kokkos_ENABLE_Pthread:BOOL=OFF
......
......@@ -77,7 +77,7 @@ ENDIF()
ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Thrust)
IF (${PACKAGE_NAME}_ENABLE_Thrust)
PACKAGE_ADD_CUDA_LIBRARY(kokkoslinalg_cuda SOURCES ${CUDA_SOURCES})
PACKAGE_ADD_CUDA_LIBRARY(tpetraclassiclinalg_cuda SOURCES ${CUDA_SOURCES})
ENDIF()
ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_MKL)
......@@ -96,7 +96,7 @@ ENDIF ()
#
TRIBITS_ADD_LIBRARY(
kokkoslinalg
tpetraclassiclinalg
HEADERS ${HEADERS}
SOURCES ${SOURCES}
)
......
......@@ -87,7 +87,7 @@ namespace KokkosClassic {
//@{
//! Default constructor
MultiVector (RCP<Node> node)
MultiVector (const Teuchos::RCP<Node>& node)
: node_(node)
, numRows_(0)
, numCols_(0)
......@@ -130,7 +130,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride)
{
numRows_ = numRows;
......@@ -160,7 +160,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride,
size_t origNumRows,
size_t origNumCols)
......@@ -178,17 +178,17 @@ namespace KokkosClassic {
//@{
//! The multivector data, as a nonconst array.
ArrayRCP<Scalar> getValuesNonConst () {
Teuchos::ArrayRCP<Scalar> getValuesNonConst () {
return contigValues_;
}
//! The multivector data, as a const array.
ArrayRCP<const Scalar> getValues () const {
Teuchos::ArrayRCP<const Scalar> getValues () const {
return contigValues_;
}
//! Return a nonconst view of the data in the i-th column of the multivector.
ArrayRCP<Scalar>
Teuchos::ArrayRCP<Scalar>
getValuesNonConst(size_t i) {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -201,7 +201,7 @@ namespace KokkosClassic {
}
//! Return a const view of the data in the i-th column of the multivector.
ArrayRCP<const Scalar>
Teuchos::ArrayRCP<const Scalar>
getValues (size_t i) const {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -422,7 +422,7 @@ namespace KokkosClassic {
//@{
//! Node accessor
RCP<Node> getNode() const { return node_; }
Teuchos::RCP<Node> getNode() const { return node_; }
//! Number of rows in the multivector (view).
size_t getNumRows() const { return numRows_; }
......@@ -452,8 +452,8 @@ namespace KokkosClassic {
//@}
private:
RCP<Node> node_;
ArrayRCP<Scalar> contigValues_;
Teuchos::RCP<Node> node_;
Teuchos::ArrayRCP<Scalar> contigValues_;
size_t numRows_;
size_t numCols_;
size_t stride_;
......@@ -501,7 +501,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride)
{
numRows_ = numRows;
......@@ -515,7 +515,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride,
size_t origNumRows,
size_t origNumCols)
......@@ -528,15 +528,15 @@ namespace KokkosClassic {
origNumCols_ = origNumCols;
}
ArrayRCP<Scalar> getValuesNonConst () {
Teuchos::ArrayRCP<Scalar> getValuesNonConst () {
return contigValues_;
}
ArrayRCP<const Scalar> getValues () const {
Teuchos::ArrayRCP<const Scalar> getValues () const {
return contigValues_;
}
ArrayRCP<Scalar>
Teuchos::ArrayRCP<Scalar>
getValuesNonConst(size_t i) {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -548,7 +548,7 @@ namespace KokkosClassic {
return contigValues_.persistingView (stride_*i, numRows_);
}
ArrayRCP<const Scalar>
Teuchos::ArrayRCP<const Scalar>
getValues (size_t i) const {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -686,7 +686,7 @@ namespace KokkosClassic {
return B;
}
RCP<SerialNode> getNode() const { return node_; }
Teuchos::RCP<SerialNode> getNode() const { return node_; }
size_t getNumRows() const { return numRows_; }
size_t getNumCols() const { return numCols_; }
size_t getStride() const { return stride_; }
......@@ -694,8 +694,8 @@ namespace KokkosClassic {
size_t getOrigNumCols() const { return origNumCols_; }
private:
RCP<SerialNode> node_;
ArrayRCP<Scalar> contigValues_;
Teuchos::RCP<SerialNode> node_;
Teuchos::ArrayRCP<Scalar> contigValues_;
size_t numRows_;
size_t numCols_;
size_t stride_;
......@@ -737,7 +737,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride)
{
numRows_ = numRows;
......@@ -751,7 +751,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride,
size_t origNumRows,
size_t origNumCols)
......@@ -764,15 +764,15 @@ namespace KokkosClassic {
origNumCols_ = origNumCols;
}
ArrayRCP<Scalar> getValuesNonConst () {
Teuchos::ArrayRCP<Scalar> getValuesNonConst () {
return contigValues_;
}
ArrayRCP<const Scalar> getValues () const {
Teuchos::ArrayRCP<const Scalar> getValues () const {
return contigValues_;
}
ArrayRCP<Scalar>
Teuchos::ArrayRCP<Scalar>
getValuesNonConst(size_t i) {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -784,7 +784,7 @@ namespace KokkosClassic {
return contigValues_.persistingView (stride_*i, numRows_);
}
ArrayRCP<const Scalar>
Teuchos::ArrayRCP<const Scalar>
getValues (size_t i) const {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -922,7 +922,7 @@ namespace KokkosClassic {
return B;
}
RCP<TPINode> getNode() const { return node_; }
Teuchos::RCP<TPINode> getNode() const { return node_; }
size_t getNumRows() const { return numRows_; }
size_t getNumCols() const { return numCols_; }
size_t getStride() const { return stride_; }
......@@ -930,8 +930,8 @@ namespace KokkosClassic {
size_t getOrigNumCols() const { return origNumCols_; }
private:
RCP<TPINode> node_;
ArrayRCP<Scalar> contigValues_;
Teuchos::RCP<TPINode> node_;
Teuchos::ArrayRCP<Scalar> contigValues_;
size_t numRows_;
size_t numCols_;
size_t stride_;
......@@ -974,7 +974,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride)
{
numRows_ = numRows;
......@@ -988,7 +988,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride,
size_t origNumRows,
size_t origNumCols)
......@@ -1001,15 +1001,15 @@ namespace KokkosClassic {
origNumCols_ = origNumCols;
}
ArrayRCP<Scalar> getValuesNonConst () {
Teuchos::ArrayRCP<Scalar> getValuesNonConst () {
return contigValues_;
}
ArrayRCP<const Scalar> getValues () const {
Teuchos::ArrayRCP<const Scalar> getValues () const {
return contigValues_;
}
ArrayRCP<Scalar>
Teuchos::ArrayRCP<Scalar>
getValuesNonConst(size_t i) {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -1021,7 +1021,7 @@ namespace KokkosClassic {
return contigValues_.persistingView (stride_*i, numRows_);
}
ArrayRCP<const Scalar>
Teuchos::ArrayRCP<const Scalar>
getValues (size_t i) const {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -1159,7 +1159,7 @@ namespace KokkosClassic {
return B;
}
RCP<TBBNode> getNode() const { return node_; }
Teuchos::RCP<TBBNode> getNode() const { return node_; }
size_t getNumRows() const { return numRows_; }
size_t getNumCols() const { return numCols_; }
size_t getStride() const { return stride_; }
......@@ -1167,8 +1167,8 @@ namespace KokkosClassic {
size_t getOrigNumCols() const { return origNumCols_; }
private:
RCP<TBBNode> node_;
ArrayRCP<Scalar> contigValues_;
Teuchos::RCP<TBBNode> node_;
Teuchos::ArrayRCP<Scalar> contigValues_;
size_t numRows_;
size_t numCols_;
size_t stride_;
......@@ -1211,7 +1211,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride)
{
numRows_ = numRows;
......@@ -1225,7 +1225,7 @@ namespace KokkosClassic {
void
initializeValues (size_t numRows,
size_t numCols,
const ArrayRCP<Scalar> &values,
const Teuchos::ArrayRCP<Scalar> &values,
size_t stride,
size_t origNumRows,
size_t origNumCols)
......@@ -1238,15 +1238,15 @@ namespace KokkosClassic {
origNumCols_ = origNumCols;
}
ArrayRCP<Scalar> getValuesNonConst () {
Teuchos::ArrayRCP<Scalar> getValuesNonConst () {
return contigValues_;
}
ArrayRCP<const Scalar> getValues () const {
Teuchos::ArrayRCP<const Scalar> getValues () const {
return contigValues_;
}
ArrayRCP<Scalar>
Teuchos::ArrayRCP<Scalar>
getValuesNonConst(size_t i) {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -1258,7 +1258,7 @@ namespace KokkosClassic {
return contigValues_.persistingView (stride_*i, numRows_);
}
ArrayRCP<const Scalar>
Teuchos::ArrayRCP<const Scalar>
getValues (size_t i) const {
#ifdef HAVE_TPETRACLASSIC_DEBUG
const bool inRange = i < numCols_; // i >= 0 since it's unsigned.
......@@ -1396,7 +1396,7 @@ namespace KokkosClassic {
return B;
}
RCP<OpenMPNode> getNode() const { return node_; }
Teuchos::RCP<OpenMPNode> getNode() const { return node_; }
size_t getNumRows() const { return numRows_; }
size_t getNumCols() const { return numCols_; }
size_t getStride() const { return stride_; }
......@@ -1404,8 +1404,8 @@ namespace KokkosClassic {
size_t getOrigNumCols() const { return origNumCols_; }
private:
RCP<OpenMPNode> node_;
ArrayRCP<Scalar> contigValues_;
Teuchos::RCP<OpenMPNode> node_;
Teuchos::ArrayRCP<Scalar> contigValues_;
size_t numRows_;
size_t numCols_;
size_t stride_;
......
......@@ -12,6 +12,5 @@ IF (${PACKAGE_NAME}_ENABLE_CUSPARSE AND ${PACKAGE_NAME}_ENABLE_ThreadPool)
COMM serial mpi
NUM_MPI_PROCS 1
STANDARD_PASS_OUTPUT
DEPLIBS kokkos kokkoslinalg kokkosnodeapi
)
ENDIF()
......@@ -5,5 +5,4 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( RelaxationTest
COMM serial mpi
NUM_MPI_PROCS 1
STANDARD_PASS_OUTPUT
DEPLIBS kokkos kokkoslinalg kokkosnodeapi
)
......@@ -193,7 +193,7 @@ APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/KokkosClassic_DefaultNode_config
#
TRIBITS_ADD_LIBRARY(
kokkosnodeapi
tpetraclassicnodeapi
HEADERS ${HEADERS}
SOURCES ${SOURCES}
)
......
......@@ -39,30 +39,30 @@
// ************************************************************************
//@HEADER
#ifndef KOKKOS_DEFAULT_NODE_HPP_
#define KOKKOS_DEFAULT_NODE_HPP_
#ifndef KOKKOS_DEFAULTNODE_HPP
#define KOKKOS_DEFAULTNODE_HPP
#include "Kokkos_ConfigDefs.hpp"
#include "Kokkos_NodeAPIConfigDefs.hpp"
#include "KokkosClassic_DefaultNode_config.h"
#include "Kokkos_BufferMacros.hpp"
#ifdef HAVE_KOKKOSCLASSIC_SERIAL
#ifdef HAVE_TPETRACLASSIC_SERIAL
# include "Kokkos_SerialNode.hpp"
#endif // HAVE_KOKKOSCLASSIC_SERIAL
#ifdef HAVE_KOKKOSCLASSIC_TBB
#endif // HAVE_TPETRACLASSIC_SERIAL
#ifdef HAVE_TPETRACLASSIC_TBB
# include "Kokkos_TBBNode.hpp"
#endif
#ifdef HAVE_KOKKOSCLASSIC_THREADPOOL
#ifdef HAVE_TPETRACLASSIC_THREADPOOL
# include "Kokkos_TPINode.hpp"
#endif
#ifdef HAVE_KOKKOSCLASSIC_OPENMP
#ifdef HAVE_TPETRACLASSIC_OPENMP
# include "Kokkos_OpenMPNode.hpp"
#endif
#ifdef HAVE_KOKKOSCLASSIC_THRUST
#ifdef HAVE_TPETRACLASSIC_THRUST
# include "Kokkos_ThrustGPUNode.hpp"
#endif
#ifdef HAVE_KOKKOSCLASSIC_KOKKOSCOMPAT
#ifdef HAVE_TPETRACLASSIC_KOKKOSCOMPAT
# include "KokkosCompat_ClassicNodeAPI_Wrapper.hpp"
#endif
......@@ -120,7 +120,7 @@ namespace Details {
typedef OpenMPNode DefaultNodeType;
#elif defined(HAVE_KOKKOSCLASSIC_DEFAULTNODE_THRUSTGPUNODE)
typedef ThrustGPUNode DefaultNodeType;
#elif defined(HAVE_KOKKOSCLASSIC_KOKKOSCOMPAT)
#elif defined(HAVE_TPETRACLASSIC_KOKKOSCOMPAT)
# if defined(HAVE_KOKKOSCLASSIC_DEFAULTNODE_CUDAWRAPPERNODE)
typedef ::Kokkos::Compat::KokkosCudaWrapperNode DefaultNodeType;
# elif defined(HAVE_KOKKOSCLASSIC_DEFAULTNODE_OPENMPWRAPPERNODE)
......@@ -129,12 +129,12 @@ namespace Details {
typedef ::Kokkos::Compat::KokkosThreadsWrapperNode DefaultNodeType;
# elif defined(HAVE_KOKKOSCLASSIC_DEFAULTNODE_SERIALWRAPPERNODE)
typedef ::Kokkos::Compat::KokkosSerialWrapperNode DefaultNodeType;
# elif defined(HAVE_KOKKOSCLASSIC_SERIAL)
# elif defined(HAVE_TPETRACLASSIC_SERIAL)
typedef SerialNode DefaultNodeType;
# else
# error "No default Kokkos Node type specified. Please set the CMake option KokkosClassic_DefaultNode to a valid Node type."
# endif // defined(HAVE_KOKKOSCLASSIC_KOKKOSCOMPAT)
#elif defined(HAVE_KOKKOSCLASSIC_SERIAL)
# endif // defined(HAVE_TPETRACLASSIC_KOKKOSCOMPAT)
#elif defined(HAVE_TPETRACLASSIC_SERIAL)
//! Typedef specifying the default node type.
typedef SerialNode DefaultNodeType;
#else
......@@ -147,4 +147,5 @@ namespace Details {
} // namespace KokkosClassic
#endif
#endif // KOKKOS_DEFAULTNODE_HPP
......@@ -43,7 +43,7 @@ APPEND_SET(SOURCES
#
TRIBITS_ADD_LIBRARY(
kokkos
tpetraclassic
HEADERS ${HEADERS}
SOURCES ${SOURCES}
)
......@@ -39,8 +39,8 @@
// ************************************************************************
//@HEADER
#ifndef KOKKOS_CONFIGDEFS_H
#define KOKKOS_CONFIGDEFS_H
#ifndef KOKKOS_CONFIGDEFS_HPP
#define KOKKOS_CONFIGDEFS_HPP
#include <TpetraClassic_config.h>
// mem management
......@@ -108,5 +108,4 @@ namespace Kokkos {
}
}
#endif /* KOKKOS_CONFIGDEFS_H */
#endif /* KOKKOS_CONFIGDEFS_HPP */
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS
Classic classic PS REQUIRED
Kernels kernels EX OPTIONAL
TSQR tsqr PS OPTIONAL
Core core PS REQUIRED
)
......@@ -268,7 +268,7 @@ TRIBITS_ADD_OPTION_AND_DEFINE(
TRIBITS_ADD_OPTION_AND_DEFINE(
Tpetra_ENABLE_Kokkos_Refactor
TPETRA_ENABLE_KOKKOS_REFACTOR
"Enable the \"Kokkos refactor\" version of Tpetra. In order to enable this, you must also enable the following Kokkos subpackages that do not build by default: Core, Compat, LinAlg, Containers, Algorithms, and MpiComm."
"Enable the \"Kokkos refactor\" version of Tpetra. In order to enable this, you must also enable the following subpackages that do not currently build by default: KokkosCore, KokkosCompat, KokkosContainers, KokkosAlgorithms, KokkosMpiComm, and TpetraKernels."
OFF
)
......@@ -288,11 +288,11 @@ TRIBITS_ADD_OPTION_AND_DEFINE(
IF (Tpetra_ENABLE_Kokkos_Refactor AND
(NOT ${PACKAGE_NAME}_ENABLE_KokkosCore OR
NOT ${PACKAGE_NAME}_ENABLE_KokkosCompat OR
NOT ${PACKAGE_NAME}_ENABLE_KokkosLinAlg OR
NOT ${PACKAGE_NAME}_ENABLE_TpetraKernels OR
NOT ${PACKAGE_NAME}_ENABLE_KokkosContainers OR
NOT ${PACKAGE_NAME}_ENABLE_KokkosAlgorithms OR
NOT ${PACKAGE_NAME}_ENABLE_KokkosMpiComm))
MESSAGE(FATAL_ERROR "Dear user: You enabled the Tpetra_ENABLE_Kokkos_Refactor option, which turns on the Kokkos Refactor version of Tpetra. However, you did not enable all required packages in order for this to work. The Kokkos Refactor version of Tpetra depends on some Kokkos subpackages which currently do not build by default. For now, you must enable them explicitly in order to use the Kokkos Refactor version of Tpetra. Please enable Kokkos subpackages Core, Compat, LinAlg, Containers, Algorithms, and MpiComm. Despite the name \"MpiComm\", you may enable that subpackage even if not building Trilinos with MPI support. Enable these subpackages by adding the following to your CMake configuration:\n-D Trilinos_ENABLE_KokkosCore:BOOL=ON\n-D Trilinos_ENABLE_KokkosCompat:BOOL=ON\n-D Trilinos_ENABLE_KokkosLinAlg:BOOL=ON\n-D Trilinos_ENABLE_KokkosContainers:BOOL=ON\n-D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON\n-D Trilinos_ENABLE_KokkosMpiComm:BOOL=ON\nIf you are running Trilinos' check-in test script, you must enable these subpackages explicitly, using arguments to --enable-packages, like this:\n--enable-packages=KokkosCore,KokkosCompat,KokkosContainers,KokkosLinAlg,KokkosAlgorithms,KokkosMpiComm,<YOUR_PACKAGES>\n(Replace <YOUR_PACKAGES> with the other packages you want to enable.) Also, the check-in test script will not enable these subpackages with the default builds MPI_DEBUG and SERIAL_RELEASE, so you must create another configuration and use it with the --extra-builds=... command-line argument.\n\n${PACKAGE_NAME}_ENABLE_KokkosCore = ${${PACKAGE_NAME}_ENABLE_KokkosCore}\n${PACKAGE_NAME}_ENABLE_KokkosCompat = ${${PACKAGE_NAME}_ENABLE_KokkosCompat}\n${PACKAGE_NAME}_ENABLE_KokkosLinAlg = ${${PACKAGE_NAME}_ENABLE_KokkosLinAlg}\n${PACKAGE_NAME}_ENABLE_KokkosContainers = ${${PACKAGE_NAME}_ENABLE_KokkosContainers}\n${PACKAGE_NAME}_ENABLE_KokkosAlgorithms = ${${PACKAGE_NAME}_ENABLE_KokkosAlgorithms}\n${PACKAGE_NAME}_ENABLE_KokkosMpiComm = ${${PACKAGE_NAME}_ENABLE_KokkosMpiComm}")
MESSAGE(FATAL_ERROR "Dear user: You enabled the Tpetra_ENABLE_Kokkos_Refactor option, which turns on the Kokkos Refactor version of Tpetra. However, you did not enable all required packages in order for this to work. The Kokkos Refactor version of Tpetra depends on some Kokkos subpackages which currently do not build by default. For now, you must enable them explicitly in order to use the Kokkos Refactor version of Tpetra. Please enable subpackages KokkosCore, KokkosContainers, KokkosAlgorithms, KokkosCompat, KokkosMpiComm, and TpetraKernels. Despite the name \"MpiComm\", you may enable that subpackage even if not building Trilinos with MPI support. Enable these subpackages by adding the following to your CMake configuration:\n-D Trilinos_ENABLE_KokkosCore:BOOL=ON\n-D Trilinos_ENABLE_KokkosCompat:BOOL=ON\n-D Trilinos_ENABLE_TpetraKernels:BOOL=ON\n-D Trilinos_ENABLE_KokkosContainers:BOOL=ON\n-D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON\n-D Trilinos_ENABLE_KokkosMpiComm:BOOL=ON\nIf you are running Trilinos' check-in test script, you must enable these subpackages explicitly, using arguments to --enable-packages, like this:\n--enable-packages=KokkosCore,KokkosCompat,KokkosContainers,TpetraKernels,KokkosAlgorithms,KokkosMpiComm,<YOUR_PACKAGES>\n(Replace <YOUR_PACKAGES> with the other packages you want to enable.) Also, the check-in test script will not enable these subpackages with the default builds MPI_DEBUG and SERIAL_RELEASE, so you must create another configuration and use it with the --extra-builds=... command-line argument.\n\n${PACKAGE_NAME}_ENABLE_KokkosCore = ${${PACKAGE_NAME}_ENABLE_KokkosCore}\n${PACKAGE_NAME}_ENABLE_KokkosCompat = ${${PACKAGE_NAME}_ENABLE_KokkosCompat}\n${PACKAGE_NAME}_ENABLE_TpetraKernels = ${${PACKAGE_NAME}_ENABLE_TpetraKernels}\n${PACKAGE_NAME}_ENABLE_KokkosContainers = ${${PACKAGE_NAME}_ENABLE_KokkosContainers}\n${PACKAGE_NAME}_ENABLE_KokkosAlgorithms = ${${PACKAGE_NAME}_ENABLE_KokkosAlgorithms}\n${PACKAGE_NAME}_ENABLE_KokkosMpiComm = ${${PACKAGE_NAME}_ENABLE_KokkosMpiComm}")
ENDIF()
IF (Tpetra_ENABLE_Kokkos_Refactor)
......@@ -312,7 +312,7 @@ TRIBITS_ADD_OPTION_AND_DEFINE(
)
IF (Tpetra_ENABLE_Kokkos_Refactor_Map AND NOT Tpetra_Have_Kokkos_Refactor)
MESSAGE( FATAL_ERROR "If Tpetra_ENABLE_Kokkos_Refactor_Map is ON, then Tpetra's Kokkos refactor code must be enabled as well. This requires Tpetra_ENABLE_Kokkos_Refactor to be ON, and the Core, Compat, Containers, Algorithms, LinAlg, and MpiComm subpackages of Kokkos to be enabled." )
MESSAGE( FATAL_ERROR "If Tpetra_ENABLE_Kokkos_Refactor_Map is ON, then Tpetra's Kokkos refactor code must be enabled as well. This requires Tpetra_ENABLE_Kokkos_Refactor to be ON, and the following subpackages to be enabled: KokkosCore, KokkosContainers, KokkosAlgorithms, KokkosCompat, KokkosMpiComm, and TpetraKernels." )
ENDIF ()
TRIBITS_ADD_OPTION_AND_DEFINE(
......
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
LIB_REQUIRED_PACKAGES Teuchos TpetraClassic