Unverified Commit 6e7b210c authored by trilinos-autotester's avatar trilinos-autotester Committed by GitHub
Browse files

Merge Pull Request #5094 from trilinos/Trilinos/tpetra-cgsolve-perf-test-fix

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Tpetra cgsolve perf test fix
PR Author: crtrott
parents 0a1ce853 a2c01a01
......@@ -131,7 +131,7 @@ Teuchos::XMLTestNode test_entry(
template<class CrsMatrix, class Vector>
result_struct
cg_solve (Teuchos::RCP<CrsMatrix> A, Teuchos::RCP<Vector> b, Teuchos::RCP<Vector> x, int myproc)
cg_solve (Teuchos::RCP<CrsMatrix> A, Teuchos::RCP<Vector> b, Teuchos::RCP<Vector> x, int myproc, double tolerance, int max_iter)
{
static_assert (std::is_same<typename CrsMatrix::scalar_type, typename Vector::scalar_type>::value,
"The CrsMatrix and Vector template parameters must have the same scalar_type.");
......@@ -140,8 +140,8 @@ cg_solve (Teuchos::RCP<CrsMatrix> A, Teuchos::RCP<Vector> b, Teuchos::RCP<Vector
typedef typename Vector::mag_type magnitude_type;
typedef typename Vector::local_ordinal_type LO;
Teuchos::RCP<Vector> r,p,Ap;
int max_iter=200;
double tolerance = 1e-8;
//int max_iter=200;
//double tolerance = 1e-8;
r = Tpetra::createVector<ScalarType>(A->getRangeMap());
p = Tpetra::createVector<ScalarType>(A->getRangeMap());
Ap = Tpetra::createVector<ScalarType>(A->getRangeMap());
......@@ -302,7 +302,7 @@ run (int argc, char *argv[])
Kokkos::InitArguments kokkosArgs;
kokkosArgs.num_threads = numthreads;
kokkosArgs.num_numa = numteams; // ???
kokkosArgs.device_id = myRank & numgpus;
kokkosArgs.device_id = myRank % numgpus;
kokkosArgs.skip_device = skipgpu;
kokkosArgs.disable_warnings = ! verbose;
......@@ -372,7 +372,7 @@ run (int argc, char *argv[])
RCP<vec_type> x (new vec_type (A->getDomainMap ()));
// Solve the linear system Ax=b using CG.
result_struct results = cg_solve (A, b, x, myRank);
result_struct results = cg_solve (A, b, x, myRank, tolerance, niters);
// Print results.
if (myRank == 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment