NexGenAnalytics / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
0 stars 2 forks source link

Belos: clean MINRES `Tpetra` test_minres_diag test #205

Closed tlamonthezie closed 1 year ago

tlamonthezie commented 1 year ago

In addition to #70 , #176 The goal is to clean code in test_minres_diag.cpp that remains invalid from line 267-276 (and remove TD and AM comments) and finalize this block conversion to Tpetra

this :

#ifdef HAVE_TPETRA_MPI
  MPI_Allreduce(&n_in, &n_global, 1, MPI_UNSIGNED, MPI_SUM, MPI_COMM_WORLD);
  pComm = Teuchos::rcp (new Teuchos::MpiComm<int> (MPI_COMM_WORLD));
#else
  pComm = Teuchos::rcp (new Teuchos::SerialComm<int> ());
  n_global = n_in;
#endif

should be replaced by

int n_global;
const int count = 1;
const auto reductType = Teuchos::REDUCE_SUM;
pComm = Tpetra::getDefaultComm();
Teuchos::reduceAll<int,int>( *pComm, reductType, count, &n_in, &n_global );