From fedb22f255c5a9ea509f8625276aa3a4ab8c4a34 Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Fri, 25 Feb 2022 14:46:25 -0700 Subject: [PATCH] Amesos2: update Tpetra getNode* names to getLocal* Attempts to address issue #10247 Related to #10189 --- .../amesos2/src/Amesos2_EpetraMultiVecAdapter_def.hpp | 8 ++++---- packages/amesos2/src/Amesos2_MatrixAdapter_def.hpp | 10 +++++----- packages/amesos2/src/Amesos2_STRUMPACK_def.hpp | 2 +- packages/amesos2/src/Amesos2_Superludist_def.hpp | 2 +- .../amesos2/src/Amesos2_TpetraMultiVecAdapter_def.hpp | 10 +++++----- ...esos2_TpetraRowMatrix_AbstractMatrixAdapter_def.hpp | 2 +- packages/amesos2/src/Amesos2_Util.hpp | 2 +- packages/amesos2/test/solvers/SolverFactory.cpp | 2 +- packages/amesos2/test/tklu_simple/tklu_simple.cpp | 4 ++-- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/amesos2/src/Amesos2_EpetraMultiVecAdapter_def.hpp b/packages/amesos2/src/Amesos2_EpetraMultiVecAdapter_def.hpp index 302577b35f97..8e40363adc00 100644 --- a/packages/amesos2/src/Amesos2_EpetraMultiVecAdapter_def.hpp +++ b/packages/amesos2/src/Amesos2_EpetraMultiVecAdapter_def.hpp @@ -224,7 +224,7 @@ void MultiVecAdapter::get1dCopy( const size_t num_vecs = getGlobalNumVectors(); #ifdef HAVE_AMESOS2_DEBUG - const size_t requested_vector_length = distribution_map->getNodeNumElements(); + const size_t requested_vector_length = distribution_map->getLocalNumElements(); TEUCHOS_TEST_FOR_EXCEPTION( lda < requested_vector_length, std::invalid_argument, "Given stride is not large enough for local vector length" ); @@ -270,7 +270,7 @@ void MultiVecAdapter::get1dCopy_kokkos_view_host( const size_t num_vecs = getGlobalNumVectors(); #ifdef HAVE_AMESOS2_DEBUG - const size_t requested_vector_length = distribution_map->getNodeNumElements(); + const size_t requested_vector_length = distribution_map->getLocalNumElements(); TEUCHOS_TEST_FOR_EXCEPTION( lda < requested_vector_length, std::invalid_argument, "Given stride is not large enough for local vector length" ); @@ -279,7 +279,7 @@ void MultiVecAdapter::get1dCopy_kokkos_view_host( // First make a host view host_view = Kokkos::View( Kokkos::ViewAllocateWithoutInitializing("get1dCopy_kokkos_view"), - distribution_map->getNodeNumElements(), num_vecs); + distribution_map->getLocalNumElements(), num_vecs); // Optimization for ROOTED and single MPI process if ( num_vecs == 1 && this->mv_->Comm().MyPID() == 0 && this->mv_->Comm().NumProc() == 1 ) { @@ -320,7 +320,7 @@ MultiVecAdapter::get1dViewNonConst(bool local) // // localize(); // // /* Use the global element list returned by - // // * mv_->getMap()->getNodeElementList() to get a subCopy of mv_ which we + // // * mv_->getMap()->getLocalElementList() to get a subCopy of mv_ which we // // * assign to l_l_mv_, then return get1dViewNonConst() of l_l_mv_ // // */ // // l_l_mv_ = Teuchos::null; diff --git a/packages/amesos2/src/Amesos2_MatrixAdapter_def.hpp b/packages/amesos2/src/Amesos2_MatrixAdapter_def.hpp index 4cb885a92c98..11aa8b41cd85 100644 --- a/packages/amesos2/src/Amesos2_MatrixAdapter_def.hpp +++ b/packages/amesos2/src/Amesos2_MatrixAdapter_def.hpp @@ -247,14 +247,14 @@ namespace Amesos2 { size_t MatrixAdapter::getLocalNumRows() const { - return row_map_->getNodeNumElements(); // TODO: verify + return row_map_->getLocalNumElements(); // TODO: verify } template < class Matrix > size_t MatrixAdapter::getLocalNumCols() const { - return col_map_->getNodeNumElements(); + return col_map_->getLocalNumElements(); } template < class Matrix > @@ -422,7 +422,7 @@ namespace Amesos2 { // compatibility, but things are working fine now. RCP > rmap = get_mat->getRowMap(); - ArrayView node_elements = rmap->getNodeElementList(); + ArrayView node_elements = rmap->getLocalElementList(); if( node_elements.size() == 0 ) return; // no more contribution typename ArrayView::iterator row_it, row_end; @@ -509,7 +509,7 @@ namespace Amesos2 { // compatibility, but things are working fine now. RCP > rmap = get_mat->getRowMap(); - ArrayView node_elements = rmap->getNodeElementList(); + ArrayView node_elements = rmap->getLocalElementList(); //if( node_elements.size() == 0 ) return; // no more contribution typename ArrayView::iterator row_it, row_end; row_end = node_elements.end(); @@ -788,7 +788,7 @@ namespace Amesos2 { RCP > cmap = get_mat->getColMap(); TEUCHOS_ASSERT( *colmap == *cmap ); - ArrayView node_elements = cmap->getNodeElementList(); + ArrayView node_elements = cmap->getLocalElementList(); if( node_elements.size() == 0 ) return; // no more contribution typename ArrayView::iterator col_it, col_end; diff --git a/packages/amesos2/src/Amesos2_STRUMPACK_def.hpp b/packages/amesos2/src/Amesos2_STRUMPACK_def.hpp index a80c88d2f9b8..de0098e1a9b5 100644 --- a/packages/amesos2/src/Amesos2_STRUMPACK_def.hpp +++ b/packages/amesos2/src/Amesos2_STRUMPACK_def.hpp @@ -206,7 +206,7 @@ namespace Amesos2 { #ifdef HAVE_MPI // local_len_rhs is how many of the multivector rows belong to // this processor - const size_t local_len_rhs = strumpack_rowmap_->getNodeNumElements(); + const size_t local_len_rhs = strumpack_rowmap_->getLocalNumElements(); const global_size_type nrhs = X->getGlobalNumVectors(); // make sure our multivector storage is sized appropriately diff --git a/packages/amesos2/src/Amesos2_Superludist_def.hpp b/packages/amesos2/src/Amesos2_Superludist_def.hpp index 740a6da024cd..8180ca558fa5 100644 --- a/packages/amesos2/src/Amesos2_Superludist_def.hpp +++ b/packages/amesos2/src/Amesos2_Superludist_def.hpp @@ -500,7 +500,7 @@ namespace Amesos2 { // local_len_rhs is how many of the multivector rows belong to // this processor in the SuperLU_DIST processor grid. - const size_t local_len_rhs = superlu_rowmap_->getNodeNumElements(); + const size_t local_len_rhs = superlu_rowmap_->getLocalNumElements(); const global_size_type nrhs = X->getGlobalNumVectors(); const global_ordinal_type first_global_row_b = superlu_rowmap_->getMinGlobalIndex(); diff --git a/packages/amesos2/src/Amesos2_TpetraMultiVecAdapter_def.hpp b/packages/amesos2/src/Amesos2_TpetraMultiVecAdapter_def.hpp index 2051b7e4bdca..7edc5c0001bc 100644 --- a/packages/amesos2/src/Amesos2_TpetraMultiVecAdapter_def.hpp +++ b/packages/amesos2/src/Amesos2_TpetraMultiVecAdapter_def.hpp @@ -132,7 +132,7 @@ namespace Amesos2 { "Amesos2::MultiVecAdapter::get1dCopy: this->getMap() returns null."); #ifdef HAVE_AMESOS2_DEBUG - const size_t requested_vector_length = distribution_map->getNodeNumElements (); + const size_t requested_vector_length = distribution_map->getLocalNumElements (); TEUCHOS_TEST_FOR_EXCEPTION( lda < requested_vector_length, std::invalid_argument, "Amesos2::MultiVecAdapter::get1dCopy: On process " << @@ -248,7 +248,7 @@ namespace Amesos2 { "Amesos2::MultiVecAdapter::get1dCopy_kokkos_view: this->getMap() returns null."); #ifdef HAVE_AMESOS2_DEBUG - const size_t requested_vector_length = distribution_map->getNodeNumElements (); + const size_t requested_vector_length = distribution_map->getLocalNumElements (); TEUCHOS_TEST_FOR_EXCEPTION( lda < requested_vector_length, std::invalid_argument, "Amesos2::MultiVecAdapter::get1dCopy_kokkos_view: On process " << @@ -338,12 +338,12 @@ namespace Amesos2 { // if( local ){ // this->localize(); // /* Use the global element list returned by - // * mv_->getMap()->getNodeElementList() to get a subCopy of mv_ which we + // * mv_->getMap()->getLocalElementList() to get a subCopy of mv_ which we // * assign to l_l_mv_, then return get1dViewNonConst() of l_l_mv_ // */ // if(l_l_mv_.is_null() ){ // Teuchos::ArrayView nodeElements_go - // = mv_->getMap()->getNodeElementList(); + // = mv_->getMap()->getLocalElementList(); // Teuchos::Array nodeElements_st(nodeElements_go.size()); // // Convert the node element to a list of size_t type objects @@ -362,7 +362,7 @@ namespace Amesos2 { // // made to the global structure that are not reflected in the local // // view. // Teuchos::ArrayView nodeElements_go - // = mv_->getMap()->getNodeElementList(); + // = mv_->getMap()->getLocalElementList(); // Teuchos::Array nodeElements_st(nodeElements_go.size()); // // Convert the node element to a list of size_t type objects diff --git a/packages/amesos2/src/Amesos2_TpetraRowMatrix_AbstractMatrixAdapter_def.hpp b/packages/amesos2/src/Amesos2_TpetraRowMatrix_AbstractMatrixAdapter_def.hpp index 4517169d9004..937a42349de3 100644 --- a/packages/amesos2/src/Amesos2_TpetraRowMatrix_AbstractMatrixAdapter_def.hpp +++ b/packages/amesos2/src/Amesos2_TpetraRowMatrix_AbstractMatrixAdapter_def.hpp @@ -165,7 +165,7 @@ namespace Amesos2 { Tpetra::RowMatrix, DerivedMat>::getLocalNNZ_impl() const { - return this->mat_->getNodeNumEntries(); + return this->mat_->getLocalNumEntries(); } template diff --git a/packages/amesos2/src/Amesos2_Util.hpp b/packages/amesos2/src/Amesos2_Util.hpp index a5b110369a13..ef1d296a8c27 100644 --- a/packages/amesos2/src/Amesos2_Util.hpp +++ b/packages/amesos2/src/Amesos2_Util.hpp @@ -1072,7 +1072,7 @@ namespace Amesos2 { using Teuchos::as; Teuchos::Array elements_tmp; - elements_tmp = map.getNodeElementList(); + elements_tmp = map.getLocalElementList(); int num_my_elements = elements_tmp.size(); Teuchos::Array my_global_elements(num_my_elements); for (int i = 0; i < num_my_elements; ++i){ diff --git a/packages/amesos2/test/solvers/SolverFactory.cpp b/packages/amesos2/test/solvers/SolverFactory.cpp index 6b51e67f0ab5..94a51bbc73e1 100644 --- a/packages/amesos2/test/solvers/SolverFactory.cpp +++ b/packages/amesos2/test/solvers/SolverFactory.cpp @@ -126,7 +126,7 @@ namespace { const SC minusOne = static_cast (-1.0); RCP A (new MAT (rowMap, maxNumEntPerRow)); - if (rowMap->getNodeNumElements () != 0) { + if (rowMap->getLocalNumElements () != 0) { for (LO lclRow = rowMap->getMinLocalIndex (); lclRow <= rowMap->getMaxLocalIndex (); ++lclRow) { const GO gblRow = rowMap->getGlobalElement(lclRow); diff --git a/packages/amesos2/test/tklu_simple/tklu_simple.cpp b/packages/amesos2/test/tklu_simple/tklu_simple.cpp index dc241292adda..f285a8c5e8c1 100644 --- a/packages/amesos2/test/tklu_simple/tklu_simple.cpp +++ b/packages/amesos2/test/tklu_simple/tklu_simple.cpp @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) { // Get update list and number of local equations from newly created map. - const size_t numMyElements = map->getNodeNumElements(); + const size_t numMyElements = map->getLocalNumElements(); if( numMyElements != numGlobalElements ) if (numProc != 1) { @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) { return -1; } - Teuchos::ArrayView myGlobalElements = map->getNodeElementList(); + Teuchos::ArrayView myGlobalElements = map->getLocalElementList(); // klu_symbolic *Symbolic ; // klu_numeric *Numeric ;