From 0e01f225ff3080d30e7ed634e276c090a5badc4f Mon Sep 17 00:00:00 2001 From: Matthias Mayr Date: Sun, 22 Aug 2021 10:31:57 +0200 Subject: [PATCH 1/3] MueLu: add doc, remove commented code, formatting --- .../MueLu_BlockedGaussSeidelSmoother_decl.hpp | 36 +++++++++---------- .../MueLu_BlockedGaussSeidelSmoother_def.hpp | 21 ++--------- 2 files changed, 21 insertions(+), 36 deletions(-) diff --git a/packages/muelu/src/Smoothers/BlockedSmoothers/MueLu_BlockedGaussSeidelSmoother_decl.hpp b/packages/muelu/src/Smoothers/BlockedSmoothers/MueLu_BlockedGaussSeidelSmoother_decl.hpp index 1dc38c2a4caa..d6f6209252f7 100644 --- a/packages/muelu/src/Smoothers/BlockedSmoothers/MueLu_BlockedGaussSeidelSmoother_decl.hpp +++ b/packages/muelu/src/Smoothers/BlockedSmoothers/MueLu_BlockedGaussSeidelSmoother_decl.hpp @@ -43,12 +43,6 @@ // *********************************************************************** // // @HEADER -/* - * MueLu_BlockedGaussSeidelSmoother_decl.hpp - * - * Created on: 30.01.2012 - * Author: tobias - */ #ifndef MUELU_BLOCKEDGAUSSSEIDELSMOOTHER_DECL_HPP_ #define MUELU_BLOCKEDGAUSSSEIDELSMOOTHER_DECL_HPP_ @@ -90,10 +84,10 @@ namespace MueLu { \code // prototypes for direct solvers for blocks 1 and 2 - RCP smoProto11 = rcp( new DirectSolver("", Teuchos::ParameterList(), A11Fact) ); - RCP smoProto22 = rcp( new DirectSolver("", Teuchos::ParameterList(), A22Fact) ); - RCP Smoo11Fact = rcp( new SmootherFactory(smoProto11) ); - RCP Smoo22Fact = rcp( new SmootherFactory(smoProto22) ); + RCP smoProto11 = rcp(new DirectSolver("", Teuchos::ParameterList(), A11Fact)); + RCP smoProto22 = rcp(new DirectSolver("", Teuchos::ParameterList(), A22Fact)); + RCP Smoo11Fact = rcp(new SmootherFactory(smoProto11)); + RCP Smoo22Fact = rcp(new SmootherFactory(smoProto22)); // define factory manager objects for sublocks RCP M11 = rcp(new FactoryManager()); @@ -105,10 +99,10 @@ namespace MueLu { M22->SetFactory("Smoother", Smoo22Fact); // create blocked Gauss-Seidel smoother for 2x2 blocked matrix - RCP smootherPrototype = rcp( new BlockedGaussSeidelSmoother(2,1.0) ); + RCP smootherPrototype = rcp(new BlockedGaussSeidelSmoother(2,1.0)); smootherPrototype->AddFactoryManager(M11); smootherPrototype->AddFactoryManager(M22); - RCP smootherFact = rcp( new SmootherFactory(smootherPrototype) ); + RCP smootherFact = rcp( new SmootherFactory(smootherPrototype) ); // use smootherFact in main-factory manager \endcode @@ -181,8 +175,11 @@ namespace MueLu { //! Return a simple one-line description of this object. std::string description() const; - //! Print the object with some verbosity level to an FancyOStream object. - //using MueLu::Describable::describe; // overloading, not hiding + /*! \brief Print the object with some verbosity level \c verbLevel to an FancyOStream object \c out + * + * - use MueLu::Describable::describe; + * - overloading, not hiding + */ void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel = Default) const; //! Get a rough estimate of cost per iteration @@ -207,11 +204,14 @@ namespace MueLu { //! A Factory RCP AFact_; - //! block operator - RCP A_; // < ! internal blocked operator "A" generated by AFact_ + //! internal blocked operator "A" generated by AFact_ + RCP A_; - RCP rangeMapExtractor_; //!< range map extractor (from A_ generated by AFact) - RCP domainMapExtractor_; //!< domain map extractor (from A_ generated by AFact) + //! range map extractor (from A_ generated by AFact) + RCP rangeMapExtractor_; + + //! domain map extractor (from A_ generated by AFact) + RCP domainMapExtractor_; }; // class Amesos2Smoother } // namespace MueLu diff --git a/packages/muelu/src/Smoothers/BlockedSmoothers/MueLu_BlockedGaussSeidelSmoother_def.hpp b/packages/muelu/src/Smoothers/BlockedSmoothers/MueLu_BlockedGaussSeidelSmoother_def.hpp index 1f9da8ab1d1b..aa3de47ff275 100644 --- a/packages/muelu/src/Smoothers/BlockedSmoothers/MueLu_BlockedGaussSeidelSmoother_def.hpp +++ b/packages/muelu/src/Smoothers/BlockedSmoothers/MueLu_BlockedGaussSeidelSmoother_def.hpp @@ -43,12 +43,6 @@ // *********************************************************************** // // @HEADER -/* - * MueLu_BlockedGaussSeidelSmoother_def.hpp - * - * Created on: 30.01.2012 - * Author: tobias - */ #ifndef MUELU_BLOCKEDGAUSSSEIDELSMOOTHER_DEF_HPP_ #define MUELU_BLOCKEDGAUSSSEIDELSMOOTHER_DEF_HPP_ @@ -102,10 +96,10 @@ namespace MueLu { size_t myPos = Teuchos::as(pos); if (myPos < FactManager_.size()) { - // replace existing entris in FactManager_ vector + // replace existing entries in FactManager_ vector FactManager_.at(myPos) = FactManager; - } else if( myPos == FactManager_.size()) { - // add new Factory manager in the end of the vector + } else if(myPos == FactManager_.size()) { + // append new Factory manager at the end of the vector FactManager_.push_back(FactManager); } else { // if(myPos > FactManager_.size()) RCP out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout)); @@ -133,13 +127,10 @@ namespace MueLu { // request "A" for current subblock row (only needed for Thyra mode) currentLevel.DeclareInput("A",(*it)->GetFactory("A").get()); } - - //RCP out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout)); } template void BlockedGaussSeidelSmoother::Setup(Level ¤tLevel) { - //typedef Xpetra::BlockedCrsMatrix BlockedCrsOMatrix; RCP out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout)); @@ -202,8 +193,6 @@ namespace MueLu { //this->GetOStream(Runtime1) << "BlockedGaussSeidel: X is a MultiVector of size " << X.getMap()->getGlobalNumElements() << std::endl; //TEUCHOS_TEST_FOR_EXCEPTION(bA->getFullDomainMap()->isSameAs(*(X.getMap())) == false, Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Apply(): The map of the solution vector X is not the same as domain map of the blocked operator A. Please check the map of X and A."); } - - #endif SC zero = Teuchos::ScalarTraits::zero(), one = Teuchos::ScalarTraits::one(); @@ -377,11 +366,7 @@ namespace MueLu { // FIXME: This is a placeholder return Teuchos::OrdinalTraits::invalid(); } - - } // namespace MueLu - - #endif /* MUELU_BLOCKEDGAUSSSEIDELSMOOTHER_DEF_HPP_ */ From b2f19ea86640004698c46166b81e626368bddf08 Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Mon, 23 Aug 2021 15:29:17 +0200 Subject: [PATCH 2/3] Fix Panzer's tests with UVM off (#9599) * Fix PanzerAdaptersSTK_check_rotation_matrices test with UVM disabled * Fix PanzerAdaptersSTK_hdiv_basis with UVM off * Fix PanzerAdaptersSTK_check_sorted_face_quads with UVM off * Fix PanzerAdaptersSTK_field_manager_builder with UVM off --- .../check_rotation_matrices.cpp | 62 ++++++++------- .../check_sorted_face_quads.cpp | 76 +++++++++++-------- .../panzer_workset_builder/hdiv_basis.cpp | 27 +++++-- .../panzer/disc-fe/src/Panzer_Workset.cpp | 36 ++++++--- .../src/evaluators/Panzer_DOF_impl.hpp | 61 ++++++++------- 5 files changed, 153 insertions(+), 109 deletions(-) diff --git a/packages/panzer/adapters-stk/test/panzer_workset_builder/check_rotation_matrices.cpp b/packages/panzer/adapters-stk/test/panzer_workset_builder/check_rotation_matrices.cpp index 8f10a3b9ebcb..8e5e4f4271f8 100644 --- a/packages/panzer/adapters-stk/test/panzer_workset_builder/check_rotation_matrices.cpp +++ b/packages/panzer/adapters-stk/test/panzer_workset_builder/check_rotation_matrices.cpp @@ -135,7 +135,7 @@ namespace panzer { auto worksets = wkstContainer->getWorksets(workset_descriptor); TEST_ASSERT(worksets->size()==1); - + auto & workset = (*worksets)[0]; auto rot_matrices = workset.getIntegrationValues(sid).surface_rotation_matrices; @@ -146,15 +146,15 @@ namespace panzer { const int num_real_cells = num_owned_cells + num_ghost_cells; const int num_virtual_cells = workset.numVirtualCells(); const int num_cells = num_real_cells + num_virtual_cells; - + const int faces_per_cell = 6; // hexahedron auto & face_connectivity = workset.getFaceConnectivity(); - + // sanity check on cell counts: should have 6 virtual, 1 owned TEST_EQUALITY(num_owned_cells, 1); TEST_EQUALITY(num_ghost_cells, 0); TEST_EQUALITY(num_virtual_cells, 6); - + TEST_ASSERT(rot_matrices.rank()==4); TEST_ASSERT(rot_matrices.extent_int(0)==num_cells); TEST_ASSERT(rot_matrices.extent_int(2)==3); @@ -174,14 +174,14 @@ namespace panzer { // the rotation matrices for the other faces of the virtual cell should be all 0s. const bool is_virtual = (c >= num_real_cells); int virtual_local_face_id = -1; // the virtual cell face that adjoins the real cell - + if (is_virtual) { // determine which face adjoins the real cell: int face_ordinal = -1; for (int local_face_id=0; local_face_id= 0) { virtual_local_face_id = local_face_id; @@ -189,7 +189,11 @@ namespace panzer { } } } - + + auto rot_matrices_view = PHX::as_view(rot_matrices); + auto rot_matrices_h = Kokkos::create_mirror_view(rot_matrices_view); + Kokkos::deep_copy(rot_matrices_h, rot_matrices_view); + for(int p=0;p(hdiv_basis_vector.extent(1)),hdiv_intrepid_basis->getCardinality()); TEST_EQUALITY(hdiv_basis_vector.extent(1),hdiv_basis_vector.extent(2)); @@ -175,6 +175,10 @@ namespace panzer { // print out basis values /////////////////////////////////////////////////////////////////////// + auto hdiv_basis_vector_view = PHX::as_view(hdiv_basis_vector); + auto hdiv_basis_vector_h = Kokkos::create_mirror_view(hdiv_basis_vector_view); + Kokkos::deep_copy(hdiv_basis_vector_h, hdiv_basis_vector_view); + // print out phi_i(x_j).phi_j(x_j) for(size_t c=0;c > iv const int faces_per_cell = cell_topology->getSubcellCount(space_dim-1); const int points = iv->surface_normals.extent_int(1); const int points_per_face = points / faces_per_cell; + + auto surface_normals_view = PHX::as_view(iv->surface_normals); + auto surface_normals_h = Kokkos::create_mirror_view(surface_normals_view); + Kokkos::deep_copy(surface_normals_h, surface_normals_view); + + auto surface_rotation_matrices_view = PHX::as_view(iv->surface_rotation_matrices); + auto surface_rotation_matrices_h = Kokkos::create_mirror_view(surface_rotation_matrices_view); + Kokkos::deep_copy(surface_rotation_matrices_h, surface_rotation_matrices_view); + + for (int virtual_cell_ordinal=0; virtual_cell_ordinal > iv int face_ordinal = -1; for (int local_face_id=0; local_face_id= 0) { virtual_local_face_id = local_face_id; @@ -123,10 +133,10 @@ correctVirtualNormals(const Teuchos::RCP > iv } if (face_ordinal >= 0) { - const int first_cell_for_face = face_connectivity.cellForSubcell(face_ordinal, 0); + const int first_cell_for_face = face_connectivity.cellForSubcellHost(face_ordinal, 0); const panzer::LocalOrdinal other_side = (first_cell_for_face == virtual_cell) ? 1 : 0; - const panzer::LocalOrdinal real_cell = face_connectivity.cellForSubcell(face_ordinal,other_side); - const panzer::LocalOrdinal face_in_real_cell = face_connectivity.localSubcellForSubcell(face_ordinal,other_side); + const panzer::LocalOrdinal real_cell = face_connectivity.cellForSubcellHost(face_ordinal,other_side); + const panzer::LocalOrdinal face_in_real_cell = face_connectivity.localSubcellForSubcellHost(face_ordinal,other_side); TEUCHOS_ASSERT(real_cell < num_real_cells); for (int point_ordinal=0; point_ordinal > iv for (int d=0; dsurface_normals(real_cell,real_cell_point,d); - iv->surface_normals(virtual_cell,virtual_cell_point,d) = -n_d; + const auto n_d = surface_normals_h(real_cell,real_cell_point,d); + surface_normals_h(virtual_cell,virtual_cell_point,d) = -n_d; normal[d] = -n_d; } panzer::convertNormalToRotationMatrix(normal,transverse,binormal); for(int dim=0; dim<3; ++dim){ - iv->surface_rotation_matrices(virtual_cell,virtual_cell_point,0,dim) = normal[dim]; - iv->surface_rotation_matrices(virtual_cell,virtual_cell_point,1,dim) = transverse[dim]; - iv->surface_rotation_matrices(virtual_cell,virtual_cell_point,2,dim) = binormal[dim]; + surface_rotation_matrices_h(virtual_cell,virtual_cell_point,0,dim) = normal[dim]; + surface_rotation_matrices_h(virtual_cell,virtual_cell_point,1,dim) = transverse[dim]; + surface_rotation_matrices_h(virtual_cell,virtual_cell_point,2,dim) = binormal[dim]; } } // clear the other normals and rotation matrices for the virtual cell: @@ -165,19 +175,23 @@ correctVirtualNormals(const Teuchos::RCP > iv int point = local_face_id * points_per_face + point_ordinal; for (int dim=0; dimsurface_normals(virtual_cell,point,dim) = 0.0; + surface_normals_h(virtual_cell,point,dim) = 0.0; } + for(int dim1=0; dim1<3; ++dim1) { for(int dim2=0; dim2<3; ++dim2) { - iv->surface_rotation_matrices(virtual_cell,point,dim1,dim2) = 0; + surface_rotation_matrices_h(virtual_cell,point,dim1,dim2) = 0; } } } } } } + + Kokkos::deep_copy(surface_normals_view, surface_normals_h); + Kokkos::deep_copy(surface_rotation_matrices_view, surface_rotation_matrices_h); } } diff --git a/packages/panzer/disc-fe/src/evaluators/Panzer_DOF_impl.hpp b/packages/panzer/disc-fe/src/evaluators/Panzer_DOF_impl.hpp index fb0be3a95306..7f602ba24dca 100644 --- a/packages/panzer/disc-fe/src/evaluators/Panzer_DOF_impl.hpp +++ b/packages/panzer/disc-fe/src/evaluators/Panzer_DOF_impl.hpp @@ -64,28 +64,28 @@ namespace panzer { //********************************************************************** //********************************************************************** -template +template DOF:: DOF(const Teuchos::ParameterList & p) : use_descriptors_(false), - dof_basis( p.get("Name"), + dof_basis( p.get("Name"), p.get< Teuchos::RCP >("Basis")->functional), basis_name(p.get< Teuchos::RCP >("Basis")->name()) { - Teuchos::RCP basis + Teuchos::RCP basis = p.get< Teuchos::RCP >("Basis")->getBasis(); is_vector_basis = basis->isVectorBasis(); // swap between scalar basis value, or vector basis value if(basis->isScalarBasis()) { dof_ip_scalar = PHX::MDField( - p.get("Name"), + p.get("Name"), p.get< Teuchos::RCP >("IR")->dl_scalar); this->addEvaluatedField(dof_ip_scalar); } else if(basis->isVectorBasis()) { dof_ip_vector = PHX::MDField( - p.get("Name"), + p.get("Name"), p.get< Teuchos::RCP >("IR")->dl_vector); this->addEvaluatedField(dof_ip_vector); } @@ -99,22 +99,22 @@ DOF(const Teuchos::ParameterList & p) : } //********************************************************************** -template +template DOF:: DOF(const PHX::FieldTag & input, const PHX::FieldTag & output, const panzer::BasisDescriptor & bd, const panzer::IntegrationDescriptor & id) : use_descriptors_(true) - , bd_(bd) - , id_(id) + , bd_(bd) + , id_(id) , dof_basis(input) { - TEUCHOS_ASSERT(bd.getType()=="HGrad" || bd.getType()=="HCurl" || + TEUCHOS_ASSERT(bd.getType()=="HGrad" || bd.getType()=="HCurl" || bd.getType()=="HDiv" || bd.getType()=="Const") is_vector_basis = (bd.getType()=="HCurl" || bd.getType()=="HDiv"); - + // swap between scalar basis value, or vector basis value if(not is_vector_basis) { dof_ip_scalar = output; @@ -132,7 +132,7 @@ DOF(const PHX::FieldTag & input, } //********************************************************************** -template +template void DOF:: postRegistrationSetup(typename TRAITS::SetupData sd, PHX::FieldManager& fm) @@ -149,10 +149,10 @@ postRegistrationSetup(typename TRAITS::SetupData sd, } //********************************************************************** -template +template void DOF:: evaluateFields(typename TRAITS::EvalData workset) -{ +{ const panzer::BasisValues2 & basisValues = use_descriptors_ ? this->wda(workset).getBasisValues(bd_,id_) : *this->wda(workset).bases[basis_index]; @@ -188,15 +188,15 @@ evaluateFields(typename TRAITS::EvalData workset) //********************************************************************** //********************************************************************** -template +template DOF:: DOF(const Teuchos::ParameterList & p) : use_descriptors_(false), - dof_basis( p.get("Name"), + dof_basis( p.get("Name"), p.get< Teuchos::RCP >("Basis")->functional), basis_name(p.get< Teuchos::RCP >("Basis")->name()) { - Teuchos::RCP basis + Teuchos::RCP basis = p.get< Teuchos::RCP >("Basis")->getBasis(); is_vector_basis = basis->isVectorBasis(); @@ -205,8 +205,11 @@ DOF(const Teuchos::ParameterList & p) : // allocate and copy offsets vector to Kokkos array offsets_array = PHX::View("offsets",offsets.size()); + auto offsets_array_h = Kokkos::create_mirror_view(offsets_array); for(std::size_t i=0;iisScalarBasis()) { dof_ip_scalar = PHX::MDField( - p.get("Name"), + p.get("Name"), p.get< Teuchos::RCP >("IR")->dl_scalar); this->addEvaluatedField(dof_ip_scalar); } else if(basis->isVectorBasis()) { dof_ip_vector = PHX::MDField( - p.get("Name"), + p.get("Name"), p.get< Teuchos::RCP >("IR")->dl_vector); this->addEvaluatedField(dof_ip_vector); } @@ -236,31 +239,31 @@ DOF(const Teuchos::ParameterList & p) : this->addDependentField(dof_basis); - std::string n = "DOF: " + dof_basis.fieldTag().name() - + ( accelerate_jacobian_enabled ? " accel_jac " : "slow_jac" ) + std::string n = "DOF: " + dof_basis.fieldTag().name() + + ( accelerate_jacobian_enabled ? " accel_jac " : "slow_jac" ) + " ("+PHX::print()+")"; this->setName(n); } //********************************************************************** -template +template DOF:: DOF(const PHX::FieldTag & input, const PHX::FieldTag & output, const panzer::BasisDescriptor & bd, const panzer::IntegrationDescriptor & id) : use_descriptors_(true) - , bd_(bd) - , id_(id) + , bd_(bd) + , id_(id) , dof_basis(input) { - TEUCHOS_ASSERT(bd.getType()=="HGrad" || bd.getType()=="HCurl" || + TEUCHOS_ASSERT(bd.getType()=="HGrad" || bd.getType()=="HCurl" || bd.getType()=="HDiv" || bd.getType()=="Const") accelerate_jacobian_enabled = false; // don't short cut for identity matrix is_vector_basis = (bd.getType()=="HCurl" || bd.getType()=="HDiv"); - + // swap between scalar basis value, or vector basis value if(not is_vector_basis) { dof_ip_scalar = output; @@ -278,7 +281,7 @@ DOF(const PHX::FieldTag & input, } //********************************************************************** -template +template void DOF:: postRegistrationSetup(typename TRAITS::SetupData sd, PHX::FieldManager& fm) @@ -308,10 +311,10 @@ preEvaluate(typename TRAITS::PreEvalData d) } //********************************************************************** -template +template void DOF:: evaluateFields(typename TRAITS::EvalData workset) -{ +{ const panzer::BasisValues2 & basisValues = use_descriptors_ ? this->wda(workset).getBasisValues(bd_,id_) : *this->wda(workset).bases[basis_index]; From 353c286554055695c8a306ffc999288a7e562e9a Mon Sep 17 00:00:00 2001 From: K Devine Date: Mon, 23 Aug 2021 11:21:36 -0600 Subject: [PATCH 3/3] zoltan2: made method names in test consistent with actual method names; (#9268) enabled tests that don't rely on Galeri when Galeri is not built --- .../zoltan2/test/core/color/CMakeLists.txt | 12 +++++++---- .../zoltan2/test/core/color/coloring1.cpp | 20 +++++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/packages/zoltan2/test/core/color/CMakeLists.txt b/packages/zoltan2/test/core/color/CMakeLists.txt index d749d79d4909..15a4167ce17f 100644 --- a/packages/zoltan2/test/core/color/CMakeLists.txt +++ b/packages/zoltan2/test/core/color/CMakeLists.txt @@ -1,13 +1,18 @@ +TRIBITS_ADD_EXECUTABLE( + Coloring1 + SOURCES coloring1.cpp + ) IF (${PROJECT_NAME}_ENABLE_Galeri) - TRIBITS_ADD_EXECUTABLE_AND_TEST( + TRIBITS_ADD_TEST( Coloring1 - SOURCES coloring1.cpp + NAME Coloring1_galeri NUM_MPI_PROCS 4 COMM serial mpi PASS_REGULAR_EXPRESSION "PASS" FAIL_REGULAR_EXPRESSION "FAIL" ) +ENDIF() TRIBITS_ADD_TEST( Coloring1 @@ -124,9 +129,9 @@ TRIBITS_ADD_TEST( PASS_REGULAR_EXPRESSION "PASS" FAIL_REGULAR_EXPRESSION "FAIL" ) - ENDIF() + TRIBITS_ADD_TEST( Coloring1 NAME Coloring1_noedges_D1 @@ -501,7 +506,6 @@ TRIBITS_ADD_TEST( PASS_REGULAR_EXPRESSION "PASS" FAIL_REGULAR_EXPRESSION "FAIL" ) -ENDIF() # Command that copies files to the executable directory. diff --git a/packages/zoltan2/test/core/color/coloring1.cpp b/packages/zoltan2/test/core/color/coloring1.cpp index 644a12c04020..41010a5679dc 100644 --- a/packages/zoltan2/test/core/color/coloring1.cpp +++ b/packages/zoltan2/test/core/color/coloring1.cpp @@ -87,6 +87,8 @@ typedef Zoltan2::XpetraCrsMatrixAdapter SparseMatrixAdapter; int validateColoring(RCP A, int *color) // returns 0 if coloring is valid, nonzero if invalid { + if (A->getRowMap()->getComm()->getRank() == 0) + std::cout << "validate coloring: local graph, distance-one" << std::endl; int nconflicts = 0; typename tcrsMatrix_t::local_inds_host_view_type indices; typename tcrsMatrix_t::values_host_view_type values; @@ -107,6 +109,8 @@ int validateColoring(RCP A, int *color) } int validateDistributedColoring(RCP A, int *color){ + if (A->getRowMap()->getComm()->getRank() == 0) + std::cout << "validate coloring: distributed, distance-one" << std::endl; int nconflicts = 0; RCP rowMap = A->getRowMap(); RCP colMap = A->getColMap(); @@ -142,6 +146,8 @@ int validateDistributedColoring(RCP A, int *color){ int validateDistributedDistance2Coloring(RCP A, int* color){ + if (A->getRowMap()->getComm()->getRank() == 0) + std::cout << "validate coloring: distributed, distance-two" << std::endl; //To check distance-2 conflicts, we square the input matrix and check //for distance-1 conflicts on the squared matrix. @@ -214,7 +220,7 @@ int main(int narg, char** arg) // Read run-time options. Teuchos::CommandLineProcessor cmdp (false, false); cmdp.setOption("colorMethod", &colorAlg, - "Coloring algorithms supported: SerialGreedy, Hybrid, 2GL, D2"); + "Coloring algorithms supported: SerialGreedy, D1, D1-2GL, D2, PD2"); cmdp.setOption("inputFile", &inputFile, "Name of a Matrix Market file in the data directory; " "if not specified, a matrix will be generated by Galeri."); @@ -346,6 +352,7 @@ int main(int narg, char** arg) params.set("timing", timing); params.set("serial_threshold",serialThreshold); params.set("recolor_degrees",recolorDegrees); + //params.set("balance_colors", balanceColors); // TODO ////// Create an input adapter for the Tpetra matrix. @@ -355,7 +362,7 @@ int main(int narg, char** arg) try { Zoltan2::ColoringProblem problem(&adapter, ¶ms); - std::cout << "Going to color" << std::endl; + std::cout << "Going to color " << colorAlg << std::endl; problem.solve(); ////// Basic metric checking of the coloring solution @@ -424,9 +431,10 @@ int main(int narg, char** arg) if(hasDiagonal) { if(Matrix->replaceGlobalValues(rowInds[i],idx,val) == Teuchos::OrdinalTraits::invalid()){ std::cout<<"Either !isFillActive() or inds.extent != vals.extent()\n"; - } else { - std::cout<<"*******DIAGONAL REPLACED*********\n"; - } + } + //else { + // std::cout<<"*******DIAGONAL REPLACED*********\n"; + //} } } Matrix->fillComplete(); @@ -436,7 +444,7 @@ int main(int narg, char** arg) testReturn += validateDistributedDistance2Coloring(Matrix, checkColoring); } else if (colorAlg == "PD2"){ testReturn = validateDistributedDistance2Coloring(Matrix, checkColoring); - }else if(colorAlg == "2GL" || colorAlg == "Hybrid"){ + }else if(colorAlg == "D1-2GL" || colorAlg == "D1"){ testReturn = validateDistributedColoring(Matrix, checkColoring); } else if (checkLength > 0){ testReturn = validateColoring(Matrix, checkColoring);