Skip to content

Commit

Permalink
Merge Pull Request #13578 from cgcgcg/Trilinos/phase2bfix
Browse files Browse the repository at this point in the history
Automatically Merged using Trilinos Pull Request AutoTester
PR Title: b'MueLu: Fix for phase 2b'
PR Author: cgcgcg
  • Loading branch information
trilinos-autotester authored Nov 21, 2024
2 parents f36f203 + ff0636b commit 70822c3
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 230 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,13 @@ class AggregationPhase2bAlgorithm : public MueLu::AggregationAlgorithmBase<Local
typename AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node>::AggStatType& aggStat,
LO& numNonAggregatedNodes) const;

void BuildAggregatesRandom(const ParameterList& params,
const LWGraph_kokkos& graph,
Aggregates& aggregates,
typename AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node>::AggStatType& aggStat,
LO& numNonAggregatedNodes) const;

void BuildAggregatesDeterministic(const ParameterList& params,
const LWGraph_kokkos& graph,
Aggregates& aggregates,
typename AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node>::AggStatType& aggStat,
LO& numNonAggregatedNodes) const;
template <bool deterministic>
void BuildAggregates(const ParameterList& params,
const LWGraph_kokkos graph,
Aggregates& aggregates,
typename AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node>::AggStatType aggStat,
LO& numNonAggregatedNodes) const;

//@}

std::string description() const { return "Phase 2b (expansion)"; }
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@ void UncoupledAggregationFactory<LocalOrdinal, GlobalOrdinal, Node>::Build(Level
runOnHost = false;

TEUCHOS_TEST_FOR_EXCEPTION(pL.get<bool>("aggregation: use interface aggregation"), std::invalid_argument, "Option: 'aggregation: use interface aggregation' is not supported in the Kokkos version of uncoupled aggregation");
// Sanity Checking: match ML behavior is not supported in UncoupledAggregation_Kokkos in Phase 1 or Phase 2b, but is in 2a
// Sanity Checking: match ML behavior is not supported in UncoupledAggregation_Kokkos in Phase 1 , but it is in 2a and 2b
TEUCHOS_TEST_FOR_EXCEPTION(pL.get<bool>("aggregation: match ML phase1"), std::invalid_argument, "Option: 'aggregation: match ML phase1' is not supported in the Kokkos version of uncoupled aggregation");
TEUCHOS_TEST_FOR_EXCEPTION(pL.get<bool>("aggregation: match ML phase2b"), std::invalid_argument, "Option: 'aggregation: match ML phase2b' is not supported in the Kokkos version of uncoupled aggregation");
}

// Build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ Cycle type = V
level rows nnz nnz/row c ratio procs
0 10000 49600 4.96 1
1 1700 14928 8.78 5.88 1
2 192 1682 8.76 8.85 1
3 24 200 8.33 8.00 1
2 192 1674 8.72 8.85 1
3 24 190 7.92 8.00 1

Smoother (level 0) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [10000, 10000], Global nnz: 49600}

Smoother (level 1) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [1700, 1700], Global nnz: 14928}

Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [192, 192], Global nnz: 1682}
Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [192, 192], Global nnz: 1674}

Smoother (level 3) pre : <Direct> solver interface
Smoother (level 3) post : no smoother
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ Cycle type = V
level rows nnz nnz/row c ratio procs
0 10000 49600 4.96 4
1 1700 15318 9.01 5.88 4
2 216 2158 9.99 7.87 4
3 32 446 13.94 6.75 4
2 216 2150 9.95 7.87 4
3 32 434 13.56 6.75 4

Smoother (level 0) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [10000, 10000], Global nnz: 49600}

Smoother (level 1) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [1700, 1700], Global nnz: 15318}

Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [216, 216], Global nnz: 2158}
Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [216, 216], Global nnz: 2150}

Smoother (level 3) pre : <Direct> solver interface
Smoother (level 3) post : no smoother
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ Cycle type = V
level rows nnz nnz/row c ratio procs
0 10000 49600 4.96 1
1 1700 14928 8.78 5.88 1
2 192 1682 8.76 8.85 1
3 24 200 8.33 8.00 1
2 192 1674 8.72 8.85 1
3 24 190 7.92 8.00 1

Smoother (level 0) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [10000, 10000], Global nnz: 49600}

Smoother (level 1) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [1700, 1700], Global nnz: 14928}

Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [192, 192], Global nnz: 1682}
Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [192, 192], Global nnz: 1674}

Smoother (level 3) pre : <Direct> solver interface
Smoother (level 3) post : no smoother
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ Cycle type = V
level rows nnz nnz/row c ratio procs
0 10000 49600 4.96 4
1 1700 15318 9.01 5.88 4
2 216 2158 9.99 7.87 4
3 32 446 13.94 6.75 4
2 216 2150 9.95 7.87 4
3 32 434 13.56 6.75 4

Smoother (level 0) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [10000, 10000], Global nnz: 49600}

Smoother (level 1) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [1700, 1700], Global nnz: 15318}

Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [216, 216], Global nnz: 2158}
Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [216, 216], Global nnz: 2150}

Smoother (level 3) pre : <Direct> solver interface
Smoother (level 3) post : no smoother
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ Cycle type = V
level rows nnz nnz/row c ratio procs
0 10000 49600 4.96 1
1 1700 14928 8.78 5.88 1
2 192 1682 8.76 8.85 1
3 24 200 8.33 8.00 1
2 192 1674 8.72 8.85 1
3 24 190 7.92 8.00 1

Smoother (level 0) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [10000, 10000], Global nnz: 49600}

Smoother (level 1) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [1700, 1700], Global nnz: 14928}

Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [192, 192], Global nnz: 1682}
Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [192, 192], Global nnz: 1674}

Smoother (level 3) pre : <Direct> solver interface
Smoother (level 3) post : no smoother
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ Cycle type = V
level rows nnz nnz/row c ratio procs
0 10000 49600 4.96 4
1 1700 15318 9.01 5.88 4
2 216 2158 9.99 7.87 4
3 32 446 13.94 6.75 4
2 216 2150 9.95 7.87 4
3 32 434 13.56 6.75 4

Smoother (level 0) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [10000, 10000], Global nnz: 49600}

Smoother (level 1) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [1700, 1700], Global nnz: 15318}

Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [216, 216], Global nnz: 2158}
Smoother (level 2) both : "Ifpack2::Relaxation": {Initialized: true, Computed: true, Type: Symmetric Gauss-Seidel, sweeps: 1, damping factor: 1, Global matrix dimensions: [216, 216], Global nnz: 2150}

Smoother (level 3) pre : <Direct> solver interface
Smoother (level 3) post : no smoother
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ void gimmeUncoupledAggregates(const Teuchos::RCP<Xpetra::Matrix<Scalar, LocalOrd
params.set<bool>("aggregation: deterministic", false);

params.set<bool>("aggregation: match ML phase2a", true);
params.set<bool>("aggregation: match ML phase2b", false);
params.set<bool>("aggregation: error on nodes with no on-rank neighbors", false);
params.set<bool>("aggregation: phase3 avoid singletons", false);

Expand Down
12 changes: 6 additions & 6 deletions packages/muelu/test/unit_tests_kokkos/Regression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, H2D, Scalar, LocalOrdinal, GlobalO
}
#ifdef KOKKOS_HAS_SHARED_SPACE
else {
size_t targetNumDeepCopies = kkNativeDeepCopies + (std::is_same_v<typename Node::memory_space, Kokkos::SharedSpace> ? 19 : 34);
size_t targetNumDeepCopies = kkNativeDeepCopies + (std::is_same_v<typename Node::memory_space, Kokkos::SharedSpace> ? 19 : 31);
TEST_EQUALITY(Tpetra::Details::DeepCopyCounter::get_count_different_space(), targetNumDeepCopies);
}
#else
else {
TEST_EQUALITY(Tpetra::Details::DeepCopyCounter::get_count_different_space(), kkNativeDeepCopies + 34);
TEST_EQUALITY(Tpetra::Details::DeepCopyCounter::get_count_different_space(), kkNativeDeepCopies + 31);
}
#endif // KOKKOS_HAS_SHARED_SPACE

Expand All @@ -130,7 +130,7 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, H2D, Scalar, LocalOrdinal, GlobalO

} // H2D

TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, Aggregration, Scalar, LocalOrdinal, GlobalOrdinal, Node) {
TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, Aggregation, Scalar, LocalOrdinal, GlobalOrdinal, Node) {
#include <MueLu_UseShortNames.hpp>
MUELU_TESTING_SET_OSTREAM;
MUELU_TESTING_LIMIT_SCOPE(Scalar, GlobalOrdinal, Node);
Expand Down Expand Up @@ -175,12 +175,12 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, Aggregration, Scalar, LocalOrdinal
}
#ifdef KOKKOS_HAS_SHARED_SPACE
else {
size_t targetNumDeepCopies = std::is_same_v<typename Node::memory_space, Kokkos::SharedSpace> ? 17 : 23;
size_t targetNumDeepCopies = std::is_same_v<typename Node::memory_space, Kokkos::SharedSpace> ? 17 : 16;
TEST_EQUALITY(Tpetra::Details::DeepCopyCounter::get_count_different_space(), targetNumDeepCopies);
}
#else
else {
TEST_EQUALITY(Tpetra::Details::DeepCopyCounter::get_count_different_space(), 23);
TEST_EQUALITY(Tpetra::Details::DeepCopyCounter::get_count_different_space(), 16);
}
#endif

Expand All @@ -193,7 +193,7 @@ TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(Regression, Aggregration, Scalar, LocalOrdinal

#define MUELU_ETI_GROUP(Scalar, LO, GO, Node) \
TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(Regression, H2D, Scalar, LO, GO, Node) \
TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(Regression, Aggregration, Scalar, LO, GO, Node)
TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(Regression, Aggregation, Scalar, LO, GO, Node)

#include <MueLu_ETI_4arg.hpp>

Expand Down

0 comments on commit 70822c3

Please sign in to comment.