Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(DO NOT MERGE) Tpetra: Fix #5117 (make TpetraCore build w/ deprecated code disabled) #5314

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions packages/tpetra/core/src/Tpetra_CrsGraph_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ namespace Tpetra {
/// default values.
CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
const size_t maxNumEntriesPerRow,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

/// \brief Constructor specifying a (possibly different) upper
Expand All @@ -371,7 +371,7 @@ namespace Tpetra {
/// default values.
CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
const Kokkos::DualView<const size_t*, execution_space>& numEntPerRow,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

/// \brief Constructor specifying a (possibly different) upper
Expand All @@ -394,15 +394,15 @@ namespace Tpetra {
/// default values.
CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
const Teuchos::ArrayView<const size_t>& numEntPerRow,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

#ifdef TPETRA_ENABLE_DEPRECATED_CODE
//! DEPRECATED; use the version that takes an ArrayView instead.
TPETRA_DEPRECATED
CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
const Teuchos::ArrayRCP<const size_t>& numEntPerRow,
const ProfileType pftype = DynamicProfile,
const ProfileType pftype = DynamicProfile,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
#endif // TPETRA_ENABLE_DEPRECATED_CODE

Expand Down Expand Up @@ -430,7 +430,7 @@ namespace Tpetra {
CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
const Teuchos::RCP<const map_type>& colMap,
const size_t maxNumEntriesPerRow,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

/// \brief Constructor specifying column Map and number of entries in each row.
Expand All @@ -454,7 +454,7 @@ namespace Tpetra {
CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
const Teuchos::RCP<const map_type>& colMap,
const Kokkos::DualView<const size_t*, execution_space>& numEntPerRow,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

/// \brief Constructor specifying column Map and number of entries
Expand All @@ -479,7 +479,7 @@ namespace Tpetra {
CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
const Teuchos::RCP<const map_type>& colMap,
const Teuchos::ArrayView<const size_t>& numEntPerRow,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

#ifdef TPETRA_ENABLE_DEPRECATED_CODE
Expand All @@ -488,7 +488,7 @@ namespace Tpetra {
CrsGraph (const Teuchos::RCP<const map_type>& rowMap,
const Teuchos::RCP<const map_type>& colMap,
const Teuchos::ArrayRCP<const size_t>& numEntPerRow,
const ProfileType pftype = DynamicProfile,
const ProfileType pftype = DynamicProfile,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
#endif // TPETRA_ENABLE_DEPRECATED_CODE

Expand Down Expand Up @@ -2571,13 +2571,16 @@ namespace Tpetra {
/// \relatesalso CrsGraph
template <class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
createCrsGraph (const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map,
createCrsGraph (const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>& map,
size_t maxNumEntriesPerRow = 0,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
{
using Teuchos::rcp;
typedef CrsGraph<LocalOrdinal, GlobalOrdinal, Node> graph_type;
return rcp (new graph_type (map, maxNumEntriesPerRow, DynamicProfile, params));
using graph_type = CrsGraph<LocalOrdinal, GlobalOrdinal, Node>;

const ProfileType profileType = TPETRA_DEFAULT_PROFILE_TYPE;
return rcp (new graph_type (map, maxNumEntriesPerRow,
profileType, params));
}

/// \brief Nonmember CrsGraph constructor that fuses Import and fillComplete().
Expand Down
19 changes: 11 additions & 8 deletions packages/tpetra/core/src/Tpetra_CrsMatrix_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ namespace Tpetra {
/// default values.
CrsMatrix (const Teuchos::RCP<const map_type>& rowMap,
const size_t maxNumEntriesPerRow,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

/// \brief Constructor specifying (possibly different) number of entries in each row.
Expand All @@ -549,7 +549,7 @@ namespace Tpetra {
/// default values.
CrsMatrix (const Teuchos::RCP<const map_type>& rowMap,
const Teuchos::ArrayView<const size_t>& numEntPerRowToAlloc,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

#ifdef TPETRA_ENABLE_DEPRECATED_CODE
Expand Down Expand Up @@ -586,7 +586,7 @@ namespace Tpetra {
CrsMatrix (const Teuchos::RCP<const map_type>& rowMap,
const Teuchos::RCP<const map_type>& colMap,
const size_t maxNumEntPerRow,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

/// \brief Constructor specifying column Map and number of entries in each row.
Expand Down Expand Up @@ -614,7 +614,7 @@ namespace Tpetra {
CrsMatrix (const Teuchos::RCP<const map_type>& rowMap,
const Teuchos::RCP<const map_type>& colMap,
const Teuchos::ArrayView<const size_t>& numEntPerRowToAlloc,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const ProfileType pftype = TPETRA_DEFAULT_PROFILE_TYPE,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);

#ifdef TPETRA_ENABLE_DEPRECATED_CODE
Expand Down Expand Up @@ -5033,13 +5033,16 @@ namespace Tpetra {
*/
template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
createCrsMatrix (const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& map,
createCrsMatrix (const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>& map,
size_t maxNumEntriesPerRow = 0,
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
{
typedef CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> matrix_type;
return Teuchos::rcp (new matrix_type (map, maxNumEntriesPerRow,
DynamicProfile, params));
using Teuchos::rcp;
using matrix_type = CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;

const ProfileType profileType = TPETRA_DEFAULT_PROFILE_TYPE;
return rcp (new matrix_type (map, maxNumEntriesPerRow,
profileType, params));
}

template<class CrsMatrixType>
Expand Down
15 changes: 8 additions & 7 deletions packages/tpetra/core/test/BugTests/BlankRowBugTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,18 @@
namespace {

using Teuchos::RCP;
using Teuchos::rcp;
using Teuchos::Comm;
using Teuchos::tuple;

TEUCHOS_UNIT_TEST(CrsMatrix, BlankRowImport)
{
typedef Tpetra::Map<> map_type;
typedef map_type::local_ordinal_type LO;
typedef map_type::global_ordinal_type GO;
typedef Tpetra::CrsMatrix<>::scalar_type SC;
typedef Tpetra::CrsMatrix<> crs_matrix_type;
typedef Tpetra::Import<LO, GO> import_type;
using map_type = Tpetra::Map<>;
using LO = map_type::local_ordinal_type;
using GO = map_type::global_ordinal_type;
using crs_matrix_type = Tpetra::CrsMatrix<>;
using SC = crs_matrix_type::scalar_type;
using import_type = Tpetra::Import<LO, GO>;

RCP<const Comm<int> > comm = Tpetra::getDefaultComm ();
// We run this test explicitly in MPI mode with 2 processors as described in
Expand All @@ -76,7 +77,7 @@ namespace {
}
destRowMap = Tpetra::createNonContigMap<LO, GO> (tuple<GO> (0, 1), comm);

RCP<crs_matrix_type> srcMat = Tpetra::createCrsMatrix<SC>(sourceRowMap);
RCP<crs_matrix_type> srcMat = rcp (new crs_matrix_type (sourceRowMap, 1));
if (rank == 0) {
srcMat->insertGlobalValues (static_cast<GO> (0), tuple<GO> (0), tuple<SC> (1.0));
}
Expand Down
11 changes: 4 additions & 7 deletions packages/tpetra/core/test/BugTests/BugTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,12 @@ namespace {
TEUCHOS_UNIT_TEST( readHBMatrix, Bug5072_ReadOneRowMPI )
{
// failure reading 1x4 matrix under MPI
// typedef int LO;
// typedef int GO;
typedef Tpetra::Map<> map_type;
typedef map_type::local_ordinal_type LO;
typedef map_type::global_ordinal_type GO;
typedef Tpetra::CrsMatrix<> crs_matrix_type;
typedef typename crs_matrix_type::scalar_type SC;

// create a comm
RCP<const Comm<int> > comm = getDefaultComm();
const int myImageID = comm->getRank();
RCP<const crs_matrix_type> readMatrix, testMatrix;
Expand All @@ -116,7 +113,7 @@ namespace {
// this is what the file looks like: 1 3 4 9
RCP<const map_type> rng = Tpetra::createUniformContigMap<LO, GO>(1,comm);
RCP<const map_type> dom = Tpetra::createUniformContigMap<LO, GO>(4,comm);
RCP<crs_matrix_type> A = Tpetra::createCrsMatrix<SC, LO, GO>(rng);
RCP<crs_matrix_type> A = rcp (new crs_matrix_type (rng, 4));
if (myImageID == 0) {
A->insertGlobalValues( 0, Teuchos::tuple<GO>(0,1,2,3), Teuchos::tuple<SC>(1.0,3.0,4.0,9.0) );
}
Expand Down Expand Up @@ -174,7 +171,7 @@ namespace {
{
// test bug where map test checks that maps are the same object, instead of checking that maps are equivalent

using std::endl;
using std::endl;
// mfh 06 Aug 2017: There was no obvious reason why this test
// required LO=int and GO=int, nor did the original Bug 5129 bug
// report depend on specific LO or GO types, so I relaxed this
Expand All @@ -188,7 +185,7 @@ namespace {
// this still has to be bigger than LO
typedef int GO;
#endif // 1

RCP<const Comm<int> > comm = getDefaultComm();
const bool verbose = Tpetra::Details::Behavior::verbose ();
std::unique_ptr<std::string> prefix;
Expand All @@ -207,7 +204,7 @@ namespace {
os << *prefix << "Create Maps" << endl;
std::cerr << os.str ();
}

RCP<const Map<LO,GO> > mapImportIn = Tpetra::createUniformContigMap<LO,GO>(numGlobal, comm);
RCP<const Map<LO,GO> > mapImportOut = Tpetra::createUniformContigMap<LO,GO>(numGlobal, comm);
RCP<const Map<LO,GO> > mapIn = Tpetra::createUniformContigMap<LO,GO>(numGlobal, comm);
Expand Down
12 changes: 8 additions & 4 deletions packages/tpetra/core/test/CrsGraph/CrsGraph_Issue601.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,18 @@ namespace { // (anonymous)
RCP<const map_type> rowMap =
rcp (new map_type (INV, myGblRowInds (), indexBase, comm));

Tpetra::ProfileType profileTypes[] = { Tpetra::DynamicProfile, Tpetra::StaticProfile };
#ifdef TPETRA_ENABLE_DEPRECATED_CODE
const Tpetra::ProfileType profileTypes[2] =
{ Tpetra::DynamicProfile, Tpetra::StaticProfile };
#else
const Tpetra::ProfileType profileTypes[1] =
{ Tpetra::StaticProfile };
#endif // TPETRA_ENABLE_DEPRECATED_CODE
bool insertLocalEntryValues[] = { true, false };

// Test both dynamic and static profile.
for (Tpetra::ProfileType profileType : profileTypes) {

out << "ProfileType: "
<< ((profileType == Tpetra::DynamicProfile) ? "Dynamic" : "Static")
<< ((profileType == Tpetra::StaticProfile) ? "Static" : "Dynamic")
<< "Profile" << endl;
Teuchos::OSTab tab2 (out);

Expand Down
Loading