Skip to content

Commit

Permalink
Merge Pull Request trilinos#10332 from trilinos/Trilinos/master_merge…
Browse files Browse the repository at this point in the history
…_20220315_000720

Automatically Merged using Trilinos Master Merge AutoTester
PR Title: Trilinos Master Merge PR Generator: Auto PR created to promote from master_merge_20220315_000720 branch to master
PR Author: trilinos-autotester
  • Loading branch information
trilinos-autotester authored Mar 15, 2022
2 parents a3b63fd + 0b00ccf commit 7bc4eb6
Show file tree
Hide file tree
Showing 75 changed files with 1,146 additions and 175 deletions.
2 changes: 1 addition & 1 deletion packages/amesos2/example/SimpleSolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
int main(int argc, char *argv[]) {
Tpetra::ScopeGuard tpetraScope(&argc,&argv);

typedef double Scalar;
typedef Tpetra::CrsMatrix<>::scalar_type Scalar;
typedef Tpetra::Map<>::local_ordinal_type LO;
typedef Tpetra::Map<>::global_ordinal_type GO;

Expand Down
2 changes: 1 addition & 1 deletion packages/amesos2/example/SimpleSolveNonContigMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) {
}


typedef double Scalar;
typedef Tpetra::CrsMatrix<>::scalar_type Scalar;
typedef Tpetra::Map<>::local_ordinal_type LO;
typedef Tpetra::Map<>::global_ordinal_type GO;

Expand Down
2 changes: 1 addition & 1 deletion packages/amesos2/example/SimpleSolveTranspose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
int main(int argc, char *argv[]) {
Tpetra::ScopeGuard tpetraScope(&argc,&argv);

typedef double Scalar;
typedef Tpetra::CrsMatrix<>::scalar_type Scalar;
typedef Tpetra::Map<>::local_ordinal_type LO;
typedef Tpetra::Map<>::global_ordinal_type GO;

Expand Down
2 changes: 1 addition & 1 deletion packages/amesos2/example/SimpleSolve_File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
int main(int argc, char *argv[]) {
Tpetra::ScopeGuard tpetraScope(&argc,&argv);

typedef double Scalar;
typedef Tpetra::CrsMatrix<>::scalar_type Scalar;
typedef Tpetra::Map<>::local_ordinal_type LO;
typedef Tpetra::Map<>::global_ordinal_type GO;

Expand Down
2 changes: 1 addition & 1 deletion packages/amesos2/example/quick_solve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
int main(int argc, char *argv[]) {
Tpetra::ScopeGuard tpetraScope(&argc,&argv);

typedef double Scalar;
typedef Tpetra::CrsMatrix<>::scalar_type Scalar;
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Magnitude;
typedef Tpetra::Map<>::local_ordinal_type LO;
typedef Tpetra::Map<>::global_ordinal_type GO;
Expand Down
3 changes: 2 additions & 1 deletion packages/amesos2/src/Amesos2_Superludist_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ namespace Amesos2 {
}

// Retrieve the normI of A (required by gstrf).
double anorm = function_map::plangs((char *)"I", &(data_.A), &(data_.grid));
bool notran = (data_.options.Trans == SLUD::NOTRANS);
double anorm = function_map::plangs((notran ? (char *)"1" : (char *)"I"), &(data_.A), &(data_.grid));

int info = 0;
{
Expand Down
8 changes: 8 additions & 0 deletions packages/belos/tpetra/src/BelosTpetraTestFramework.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ namespace Belos {
retVals[i] = dPtr[i];
}

template<>
void convertData( const double* dPtr, const int nnz, float* retVals )
{
for ( int i=0; i<nnz; ++i )
retVals[i] = (float) dPtr[i];
}


template<>
void convertData( const double* dPtr, const int nnz, std::complex<double>* retVals )
{
Expand Down
10 changes: 5 additions & 5 deletions packages/belos/tpetra/test/BiCGStab/test_bicgstab_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int main (int argc, char *argv[])
using std::cout;
using std::endl;

typedef double ST;
typedef Tpetra::MultiVector<>::scalar_type ST;
typedef Teuchos::ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down Expand Up @@ -151,8 +151,8 @@ int main (int argc, char *argv[])
//
// Construct a preconditioned linear problem
//
RCP<Belos::LinearProblem<double,MV,OP> > problem
= rcp (new Belos::LinearProblem<double,MV,OP> (A, X, B));
RCP<Belos::LinearProblem<ST,MV,OP> > problem
= rcp (new Belos::LinearProblem<ST,MV,OP> (A, X, B));
bool set = problem->setProblem ();
if (! set) {
if (proc_verbose) {
Expand All @@ -162,8 +162,8 @@ int main (int argc, char *argv[])
}

// Create a Belos solver.
RCP<Belos::SolverManager<double,MV,OP> > solver
= rcp (new Belos::BiCGStabSolMgr<double,MV,OP> (problem, belosList));
RCP<Belos::SolverManager<ST,MV,OP> > solver
= rcp (new Belos::BiCGStabSolMgr<ST,MV,OP> (problem, belosList));

if (proc_verbose) {
cout << endl << endl;
Expand Down
4 changes: 2 additions & 2 deletions packages/belos/tpetra/test/BlockCG/test_bl_cg_complex_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ using std::vector;
using Teuchos::tuple;

int main(int argc, char *argv[]) {

typedef std::complex<double> ST;
typedef Tpetra::MultiVector<>::scalar_type BSC;
typedef std::complex<BSC> ST;
typedef ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down
3 changes: 1 addition & 2 deletions packages/belos/tpetra/test/BlockCG/test_bl_cg_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ using std::vector;
using Teuchos::tuple;

int main(int argc, char *argv[]) {

typedef double ST;
typedef Tpetra::MultiVector<>::scalar_type ST;
typedef ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down
3 changes: 1 addition & 2 deletions packages/belos/tpetra/test/BlockCG/test_pseudo_bl_cg_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ using std::vector;
using Teuchos::tuple;

int main(int argc, char *argv[]) {

typedef double ST;
typedef Tpetra::MultiVector<>::scalar_type ST;
typedef ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ main (int argc, char *argv[])
using Teuchos::rcpFromRef;
using std::endl;
using std::cout;

typedef double ST;
typedef Tpetra::MultiVector<>::scalar_type ST;
typedef Teuchos::ScalarTraits<ST> STS;
typedef STS::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down
5 changes: 2 additions & 3 deletions packages/belos/tpetra/test/BlockGmres/test_bl_fgmres_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ using Teuchos::rcp;
using Teuchos::ParameterList;

int main(int argc, char *argv[]) {

typedef double ST;
typedef Tpetra::MultiVector<>::scalar_type ST;
typedef Teuchos::ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down Expand Up @@ -186,7 +185,7 @@ int main(int argc, char *argv[]) {
innerBelosList.set( "Timer Label", "Belos Preconditioner Solve" );// Choose a different label for the inner solve

// *****Construct linear problem for the inner iteration using A *****
Belos::LinearProblem<double,MV,OP> innerProblem;
Belos::LinearProblem<ST,MV,OP> innerProblem;
innerProblem.setOperator( A );
innerProblem.setLabel( "Belos Preconditioner Solve" );

Expand Down
3 changes: 1 addition & 2 deletions packages/belos/tpetra/test/BlockGmres/test_bl_gmres_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ using std::vector;
using Teuchos::tuple;

int main(int argc, char *argv[]) {

typedef double ST;
typedef Tpetra::MultiVector<>::scalar_type ST;
typedef ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down
11 changes: 9 additions & 2 deletions packages/belos/tpetra/test/BlockGmres/test_bl_gmres_hb_df.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,16 @@ int main(int argc, char *argv[])

// run tests for different scalar types
double ltol = tol;
double ftime[3]; int fiter; bool fpass = runTest<float>(ltol,ftime,fiter,vmap);
double ftime[3] = {0,0,0}; int fiter=0;
bool fpass = true, dpass = true;
#ifdef HAVE_TPETRA_INST_FLOAT
fpass = runTest<float>(ltol,ftime,fiter,vmap);
#endif
ltol = (reduce_tol ? ltol*ltol : ltol);
double dtime[3]; int diter; bool dpass = runTest<double>(ltol,dtime,diter,vmap);
double dtime[3] = {0,0,0}; int diter=0;
#ifdef HAVE_TPETRA_INST_DOUBLE
dpass = runTest<double>(ltol,dtime,diter,vmap);
#endif

// done with the matrix data now; delete it
if (mptestmypid == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ using std::vector;
using Teuchos::tuple;

int main(int argc, char *argv[]) {

typedef double ST;
typedef Tpetra::MultiVector<>::scalar_type ST;
typedef ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down
3 changes: 1 addition & 2 deletions packages/belos/tpetra/test/FixedPoint/test_fp_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ using std::vector;
using Teuchos::tuple;

int main(int argc, char *argv[]) {

typedef double ST;
typedef Tpetra::MultiVector<>::scalar_type ST;
typedef ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down
6 changes: 3 additions & 3 deletions packages/belos/tpetra/test/GCRODR/test_block_gcrodr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ main (int argc, char *argv[])
//
// Typedefs for Tpetra template arguments.
//
typedef double scalar_type;
typedef long int global_ordinal_type;
typedef int local_ordinal_type;
typedef Tpetra::MultiVector<>::scalar_type scalar_type;
typedef Tpetra::MultiVector<>::local_ordinal_type local_ordinal_type;
typedef Tpetra::MultiVector<>::global_ordinal_type global_ordinal_type;
//
// Tpetra objects which are the MV and OP template parameters of the
// Belos specialization which we are testing.
Expand Down
4 changes: 2 additions & 2 deletions packages/belos/tpetra/test/GCRODR/test_gcrodr_complex_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ using std::vector;
using Teuchos::tuple;

int main(int argc, char *argv[]) {

typedef std::complex<double> ST;
typedef Tpetra::MultiVector<>::scalar_type BSC;
typedef std::complex<BSC> ST;
typedef ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down
3 changes: 1 addition & 2 deletions packages/belos/tpetra/test/GCRODR/test_gcrodr_hb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ using std::vector;
using Teuchos::tuple;

int main(int argc, char *argv[]) {

typedef double ST;
typedef Tpetra::MultiVector<>::scalar_type ST;
typedef ScalarTraits<ST> SCT;
typedef SCT::magnitudeType MT;
typedef Tpetra::Operator<ST> OP;
Expand Down
3 changes: 1 addition & 2 deletions packages/belos/tpetra/test/Issue_3235.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ int main(int argc, char *argv[]) {
using Teuchos::ParameterList;
using Teuchos::RCP;
using Teuchos::rcp;

using SC = double;
using SC = Tpetra::MultiVector<>::scalar_type;
using crs_matrix_type = Tpetra::CrsMatrix<SC>;
using map_type = Tpetra::Map<>;
using OP = Tpetra::Operator<SC>;
Expand Down
2 changes: 1 addition & 1 deletion packages/belos/tpetra/test/Native/nonsymm_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace { // (anonymous)

struct CommandLineOptions {
std::string solverName {"TPETRA GMRES"};
double offDiagDiff = 1.0 / 8.0;
Tpetra::MultiVector<>::scalar_type offDiagDiff = 1.0 / 8.0;
// mfh 14 Aug 2018: GMRES takes 20 iterations on this problem (with
// offDiagDiff = 1/8). We add 10 iterations to allow for rounding
// error and differences in the algorithm.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ static void
getCmdLineArgs (const Teuchos::Comm<int>& comm, int argc, char* argv[])
{
using Teuchos::CommandLineProcessor;
typedef Tpetra::MultiVector<>::scalar_type ST;

// Define a OrthoManagerFactory to use to get the names of valid
// orthogonalization manager types. We won't use this factory to
// create them, so we should be able to pick the Scalar, MV, and
// OP template parameters as we wish.
typedef Belos::OrthoManagerFactory<double,
Tpetra::MultiVector<double>, Tpetra::Operator<double> > factory_type;
Tpetra::MultiVector<ST>, Tpetra::Operator<ST> > factory_type;
factory_type factory;

////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -243,7 +244,7 @@ class SparseMatrixLoader<double, LocalOrdinalType, GlobalOrdinalType, NodeType>
// modify numRows to be the number of rows in the sparse matrix.
// Otherwise, it will leave numRows alone.
std::pair<Teuchos::RCP<map_type>, Teuchos::RCP<matrix_type> > results =
Belos::Test::loadSparseMatrix<LocalOrdinalType,
Belos::Test::loadSparseMatrix<typename matrix_type::scalar_type,LocalOrdinalType,
GlobalOrdinalType,
NodeType> (comm, filename, numRows, debugOut);
map = results.first;
Expand Down Expand Up @@ -407,7 +408,7 @@ main (int argc, char *argv[])
typedef Tpetra::Map<>::node_type node_type;

{
typedef double scalar_type;
typedef Tpetra::MultiVector<>::scalar_type scalar_type;
success = runTest<scalar_type, local_ordinal_type,
global_ordinal_type, node_type> (comm);
if (success) {
Expand All @@ -425,7 +426,7 @@ main (int argc, char *argv[])
}
#if defined(HAVE_TEUCHOS_COMPLEX) && defined(HAVE_TPETRA_COMPLEX)
{
typedef std::complex<double> scalar_type;
typedef std::complex<Tpetra::MultiVector<>::scalar_type> scalar_type;
success = runTest<scalar_type, local_ordinal_type,
global_ordinal_type, node_type> (comm);
if (success) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ using std::endl;

//
// These typedefs make main() as generic as possible.
//
typedef double scalar_type;
//
typedef Tpetra::MultiVector<>::scalar_type scalar_type;
typedef Tpetra::Map<>::local_ordinal_type local_ordinal_type;
typedef Tpetra::Map<>::global_ordinal_type global_ordinal_type;
typedef Tpetra::Map<>::node_type node_type;
Expand Down Expand Up @@ -234,7 +234,7 @@ main (int argc, char *argv[])
// modify numRows to be the total number of rows in the sparse
// matrix. Otherwise, it will leave numRows alone.
std::pair<RCP<map_type>, RCP<sparse_matrix_type> > results =
loadSparseMatrix<local_ordinal_type, global_ordinal_type, node_type> (pComm, filename, numRows, debugOut);
loadSparseMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> (pComm, filename, numRows, debugOut);
map = results.first;
M = results.second;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <BelosTypes.hpp> // includes BelosConfigDefs.hpp
#include <BelosOrthoManagerFactory.hpp>
#include <BelosOrthoManagerTest.hpp>
#include <BelosTpetraTestFramework.hpp>
#include <BelosTpetraAdapter.hpp>
#include <Tpetra_Core.hpp>
#include <Tpetra_CrsMatrix.hpp>
Expand Down Expand Up @@ -107,33 +108,36 @@ namespace Belos {
/// distribution of the sparse matrix: we distribute in a way such
/// that the domain, range, and row maps are the same) and a
/// sparse_matrix_type (the sparse matrix itself).
template<class LO, class GO, class NodeType>
std::pair<Teuchos::RCP<Tpetra::Map<LO, GO, NodeType> >, Teuchos::RCP<Tpetra::CrsMatrix<double, LO, GO, NodeType> > >
template<class SC, class LO, class GO, class NodeType>
std::pair<Teuchos::RCP<::Tpetra::Map<LO, GO, NodeType> >, Teuchos::RCP<::Tpetra::CrsMatrix<SC, LO, GO, NodeType> > >
loadSparseMatrix (const Teuchos::RCP< const Teuchos::Comm<int> > pComm,
const std::string& filename,
int& numRows,
std::ostream& debugOut)
{
typedef double scalar_type;
typedef SC scalar_type;
typedef LO local_ordinal_type;
typedef GO global_ordinal_type;
typedef NodeType node_type;

typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
typedef Tpetra::CrsMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> sparse_matrix_type;
typedef ::Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
typedef ::Tpetra::CrsMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> sparse_matrix_type;

using Teuchos::RCP;
using Teuchos::rcp;
using std::vector;

const int myRank = Teuchos::rank (*pComm);
// const int myRank = Teuchos::rank (*pComm);
RCP<map_type> pMap;
RCP<sparse_matrix_type> pMatrix;

if (filename != "")
{
debugOut << "Loading sparse matrix file \"" << filename << "\"" << endl;

Belos::Tpetra::HarwellBoeingReader<sparse_matrix_type> reader(pComm);
pMatrix = reader.readFromFile(filename);
pMap = Teuchos::rcp_const_cast<map_type>(pMatrix->getRowMap());
#if 0
int loadedNumRows = 0;
int numCols = 0;
int nnz = -1;
Expand Down Expand Up @@ -274,6 +278,7 @@ namespace Belos {
// among the processes. The domain, range, and row maps are
// the same (the matrix must be square).
pMatrix->fillComplete();
#endif
debugOut << "Completed loading and distributing sparse matrix" << endl;
} // else M == null
else
Expand All @@ -283,7 +288,7 @@ namespace Belos {
// Let M remain null, and allocate map using the number of rows
// (numRows) specified on the command line.
pMap = rcp (new map_type (numRows, 0, pComm,
Tpetra::GloballyDistributed));
::Tpetra::GloballyDistributed));
}
return std::make_pair (pMap, pMatrix);
}
Expand Down
Loading

0 comments on commit 7bc4eb6

Please sign in to comment.