Skip to content

Commit

Permalink
Tpetra: Fix #395 (completely scope Tpetra::Details::DefaultTypes)
Browse files Browse the repository at this point in the history
@trilinos/tpetra Make sure that all use of
Tpetra::Details::DefaultTypes is completely scoped (at least to
include "Tpetra::Details::" if not "::Tpetra::Details::").  This
ensures its correct use in inner namespaces like
Tpetra::Experimental::Details.

Build/Test Cases Summary
Enabled Packages: TpetraCore
Disabled Packages: FEI,PyTrilinos,Moertel,STK,SEACAS,ThreadPool,OptiPack,Rythmos
Enabled all Forward Packages
0) MPI_DEBUG => passed: passed=388,notpassed=0 (20.60 min)
1) SERIAL_RELEASE => passed: passed=297,notpassed=0 (8.85 min)
  • Loading branch information
Mark Hoemmen committed Jun 5, 2016
1 parent 8b1d148 commit 16af8e0
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 81 deletions.
8 changes: 4 additions & 4 deletions packages/tpetra/core/ext/TpetraExt_MMHelpers_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ namespace Tpetra {
///
/// These contents may be a mixture of local and remote rows of the
/// actual matrix.
template <class Scalar = Details::DefaultTypes::scalar_type,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template <class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class CrsMatrixStruct {
public:
typedef Map<LocalOrdinal, GlobalOrdinal, Node> map_type;
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_CrsGraph_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ namespace Tpetra {
/// stored in the local graph and communicated to the appropriate
/// node on the next call to globalAssemble() or fillComplete() (the
/// latter calls the former).
template <class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type,
template <class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type,
const bool classic = Node::classic>
class CrsGraph :
public RowGraph<LocalOrdinal, GlobalOrdinal, Node>,
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_CrsMatrixMultiplyOp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ namespace Tpetra {
/// Operator.
template <class Scalar,
class MatScalar = Scalar,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class CrsMatrixMultiplyOp :
public Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node>
{
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_CrsMatrixSolveOp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ namespace Tpetra {
/// of entries in the MultiVector input and output of apply().
template <class Scalar,
class MatScalar = Scalar,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class CrsMatrixSolveOp :
public Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
public:
Expand Down
8 changes: 4 additions & 4 deletions packages/tpetra/core/src/Tpetra_CrsMatrix_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ namespace Tpetra {
/// object, that keeps the same source and target Map objects but
/// has a different communication plan. We have not yet implemented
/// this optimization.
template <class Scalar = Details::DefaultTypes::scalar_type,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type,
template <class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type,
const bool classic = Node::classic>
class CrsMatrix :
public RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>,
Expand Down
4 changes: 2 additions & 2 deletions packages/tpetra/core/src/Tpetra_DefaultPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ namespace Tpetra {
using Teuchos::rcp;
if (platform_.is_null ()) {
#ifdef HAVE_TPETRA_MPI
platform_ = rcp (new MpiPlatform<Tpetra::Details::DefaultTypes::node_type> ());
platform_ = rcp (new MpiPlatform< ::Tpetra::Details::DefaultTypes::node_type> ());
#else
platform_ = rcp (new SerialPlatform<Tpetra::Details::DefaultTypes::node_type> ());
platform_ = rcp (new SerialPlatform< ::Tpetra::Details::DefaultTypes::node_type> ());
#endif
}
return *platform_;
Expand Down
4 changes: 2 additions & 2 deletions packages/tpetra/core/src/Tpetra_DefaultPlatform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ class DefaultPlatform {
/// For a serial build, this will be SerialPlatform. Otherwise, it
/// will be MpiPlatform.
#ifdef HAVE_TPETRA_MPI
typedef MpiPlatform<Details::DefaultTypes::node_type> DefaultPlatformType;
typedef MpiPlatform< ::Tpetra::Details::DefaultTypes::node_type> DefaultPlatformType;
#else
typedef SerialPlatform<Details::DefaultTypes::node_type> DefaultPlatformType;
typedef SerialPlatform< ::Tpetra::Details::DefaultTypes::node_type> DefaultPlatformType;
#endif

//! Return a reference to the default platform singleton.
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_Details_Transfer_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ namespace Details {
/// \brief Common base class of Import and Export
/// \warning This is an implementation detail of Tpetra. We make no
/// promises of backwards compatibility with this class.
template<class LO = DefaultTypes::local_ordinal_type,
class GO = DefaultTypes::global_ordinal_type,
class NT = DefaultTypes::node_type>
template<class LO = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GO = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class NT = ::Tpetra::Details::DefaultTypes::node_type>
class Transfer : public Teuchos::Describable {
public:
//! Destructor (declared virtual for memory safety of derived classes).
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_Directory_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ namespace Tpetra {
/// already exists. Epetra_Directory is an abstract interface
/// with one implementation (Epetra_BasicDirectory);
/// Tpetra::Directory is a concrete implementation.
template<class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template<class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class Directory : public Teuchos::Describable {
public:
//! Type of the Map specialization to give to the constructor.
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_DistObject_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ namespace Tpetra {
/// an object can be the target of an Import or Export, it can also
/// be the source of an Import or Export.
template <class Packet,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type,
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type,
const bool classic = Node::classic>
class DistObject :
virtual public SrcDistObject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ namespace Experimental {
/// }
/// \endcode
///
template<class Scalar = Details::DefaultTypes::scalar_type,
class LO = Details::DefaultTypes::local_ordinal_type,
class GO = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template<class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LO = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GO = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class BlockCrsMatrix :
virtual public Tpetra::RowMatrix<Scalar, LO, GO, Node>,
virtual public Tpetra::DistObject<char, LO, GO, Node>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ template<class S, class LO, class GO, class N> class BlockCrsMatrix;
/// It doesn't make sense for BlockMultiVector to implement
/// MultiVector, because the desired fill interfaces of the two
/// classes are different.
template<class Scalar = Details::DefaultTypes::scalar_type,
class LO = Details::DefaultTypes::local_ordinal_type,
class GO = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template<class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LO = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GO = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class BlockMultiVector :
public Tpetra::DistObject<Scalar, LO, GO, Node>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ namespace Experimental {
/// "multivectors" that are not "multi." That is, a BlockVector has a
/// single vector (column). Please refer to the documentation of
/// BlockMultiVector for details.
template<class Scalar = Details::DefaultTypes::scalar_type,
class LO = Details::DefaultTypes::local_ordinal_type,
class GO = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template<class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LO = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GO = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class BlockVector : public BlockMultiVector<Scalar, LO, GO, Node> {
private:
typedef BlockMultiVector<Scalar, LO, GO, Node> base_type;
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_Export_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ namespace Tpetra {
/// the Import (i.e., when calling DistObject's doImport()
/// (forward mode) or doExport() (reverse mode)).
///
template<class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template<class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class Export:
public ::Tpetra::Details::Transfer<LocalOrdinal, GlobalOrdinal, Node>
{
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_Import_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ namespace Tpetra {
/// the Import (i.e., when calling DistObject's doImport()
/// (forward mode) or doExport() (reverse mode)).
///
template<class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template<class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class Import:
public ::Tpetra::Details::Transfer<LocalOrdinal, GlobalOrdinal, Node>
{
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_Map_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ namespace Tpetra {
/// product functions produce small dense matrices that are required
/// by all images. Replicated local objects handle these
/// situations.
template <class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template <class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class Map : public Teuchos::Describable {
public:
//! @name Typedefs
Expand Down
2 changes: 1 addition & 1 deletion packages/tpetra/core/src/Tpetra_MpiPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ namespace Tpetra {
return comm_;
}

Teuchos::RCP<MpiPlatform<Tpetra::Details::DefaultTypes::node_type>::NodeType>
Teuchos::RCP<MpiPlatform< ::Tpetra::Details::DefaultTypes::node_type>::NodeType>
MpiPlatform<Tpetra::Details::DefaultTypes::node_type>::
getNode () const
{
Expand Down
11 changes: 5 additions & 6 deletions packages/tpetra/core/src/Tpetra_MpiPlatform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,21 +361,20 @@ namespace Tpetra {
MpiPlatform& operator= (const MpiPlatform<NodeType>& platform);
};

/// \class MpiPlatform<Tpetra::Details::DefaultTypes::node_type>
/// \class MpiPlatform< ::Tpetra::Details::DefaultTypes::node_type>
/// \brief MpiPlatform specialization for the default Node type.
///
/// \note Tpetra::Details::DefaultTypes::node_type is a typedef,
/// and may have a different type, depending on Trilinos' build
/// options.
/// \note <tt>::Tpetra::Details::DefaultTypes::node_type</tt> is a
/// typedef. Its actual type depends on Trilinos' build options.
template <>
class MpiPlatform<Tpetra::Details::DefaultTypes::node_type> :
class MpiPlatform< ::Tpetra::Details::DefaultTypes::node_type> :
public Teuchos::Describable {
public:
//! @name Typedefs
//@{

//! Kokkos Node type; the template parameter of this class.
typedef Tpetra::Details::DefaultTypes::node_type NodeType;
typedef ::Tpetra::Details::DefaultTypes::node_type NodeType;

//@}
//! @name Constructors and destructor
Expand Down
8 changes: 4 additions & 4 deletions packages/tpetra/core/src/Tpetra_MultiVector_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,10 @@ namespace Tpetra {
/// That is, if some but not all rows are shared by more than one
/// process in the communicator, then inner products and norms may
/// be wrong. This behavior may change in future releases.
template <class Scalar = Details::DefaultTypes::scalar_type,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type,
template <class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type,
const bool classic = Node::classic>
class MultiVector :
public DistObject<Scalar, LocalOrdinal, GlobalOrdinal, Node>
Expand Down
8 changes: 4 additions & 4 deletions packages/tpetra/core/src/Tpetra_Operator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ namespace Tpetra {
/// different classes implement this interface, including sparse
/// matrices, direct solvers, iterative solvers, and
/// preconditioners.
template <class Scalar = Details::DefaultTypes::scalar_type,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template <class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class Operator : virtual public Teuchos::Describable {
public:
/** \name Typedefs that give access to the template parameters. */
Expand Down
6 changes: 3 additions & 3 deletions packages/tpetra/core/src/Tpetra_RowGraph_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ namespace Tpetra {
/// documentation of Map for requirements.
/// \tparam Node The Kokkos Node type. See the documentation of Map
/// for requirements.
template <class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template <class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class RowGraph :
virtual public Teuchos::Describable,
public Packable<GlobalOrdinal, LocalOrdinal> {
Expand Down
8 changes: 4 additions & 4 deletions packages/tpetra/core/src/Tpetra_RowMatrixTransposer_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ namespace Tpetra {
/// "unique", i.e., a row is wholly owned by one process.
///
/// This class takes the same template parameters as CrsMatrix.
template<class Scalar = Details::DefaultTypes::scalar_type,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template<class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class RowMatrixTransposer {
public:
//! @name Typedefs
Expand Down
8 changes: 4 additions & 4 deletions packages/tpetra/core/src/Tpetra_RowMatrix_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ namespace Tpetra {
/// implementations of RowMatrix, which do useful things like
/// wrapping an existing matrix to view only certain desired
/// entries.
template <class Scalar = Details::DefaultTypes::scalar_type,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type>
template <class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type>
class RowMatrix :
virtual public Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node>,
virtual public SrcDistObject,
Expand Down
8 changes: 4 additions & 4 deletions packages/tpetra/core/src/Tpetra_Vector_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ namespace Tpetra {
/// only one vector (column). It may be used wherever a MultiVector
/// may be used. Please see the documentation of MultiVector for more
/// details.
template <class Scalar = Details::DefaultTypes::scalar_type,
class LocalOrdinal = Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
class Node = Details::DefaultTypes::node_type,
template <class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
class Node = ::Tpetra::Details::DefaultTypes::node_type,
const bool classic = Node::classic>
class Vector :
public MultiVector<Scalar,
Expand Down

0 comments on commit 16af8e0

Please sign in to comment.