Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MueLu: Adding support for driving Galeri options via ParameterList in Driver #9871

Merged
merged 3 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/muelu/test/scaling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ IF (${PACKAGE_NAME}_HAVE_TPETRA_SOLVER_STACK OR ${PACKAGE_NAME}_HAVE_EPETRA_SOLV
)

TRIBITS_COPY_FILES_TO_BINARY_DIR(Driver_cp
SOURCE_FILES scaling.xml scaling.yaml scaling-complex.xml scaling-withglobalconstants.xml scaling-complex-withglobalconstants.xml circ_nsp_dependency.xml isorropia.xml iso_poisson.xml conchas_milestone_zoltan.xml conchas_milestone_zoltan2.xml conchas_milestone_zoltan2_complex.xml sa_with_ilu.xml sa_with_Ifpack2_line_detection.xml rap.xml smoother.xml smoother_complex.xml tripleMatrixProduct.xml scaling-ml.xml elasticity3D.xml amgx.json amgx.xml scaling-with-rerun.xml scaling_distance2_agg.xml smooVec.mm smooVecCoalesce.xml pairwise.xml sa_enforce_constraints.xml recurMG.xml
SOURCE_FILES scaling.xml scaling.yaml scaling-complex.xml scaling-withglobalconstants.xml scaling-complex-withglobalconstants.xml circ_nsp_dependency.xml isorropia.xml iso_poisson.xml conchas_milestone_zoltan.xml conchas_milestone_zoltan2.xml conchas_milestone_zoltan2_complex.xml sa_with_ilu.xml sa_with_Ifpack2_line_detection.xml rap.xml smoother.xml smoother_complex.xml tripleMatrixProduct.xml scaling-ml.xml elasticity3D.xml amgx.json amgx.xml scaling-with-rerun.xml scaling_distance2_agg.xml smooVec.mm smooVecCoalesce.xml pairwise.xml sa_enforce_constraints.xml recurMG.xml anisotropic.xml
CATEGORIES BASIC PERFORMANCE
)

Expand Down Expand Up @@ -114,6 +114,15 @@ TRIBITS_ADD_TEST(
CATEGORIES PERFORMANCE
)


TRIBITS_ADD_TEST(
Driver
NAME Driver_anisotropic
ARGS "--xml=anisotropic.xml --tol=1e-6"
NUM_MPI_PROCS 4
COMM mpi # HAVE_MPI required
)

# not very elegant. The best would probably to make Reuse.cpp work for both Epetra and Tpetra
IF (${PACKAGE_NAME}_HAVE_TPETRA_SOLVER_STACK)
TRIBITS_ADD_EXECUTABLE(
Expand Down Expand Up @@ -188,6 +197,7 @@ IF (${PACKAGE_NAME}_HAVE_EPETRA_SOLVER_STACK AND (NOT Xpetra_INT_LONG_LONG))
NUM_MPI_PROCS 4
COMM mpi # HAVE_MPI required
)


TRIBITS_ADD_TEST(
Driver
Expand Down
13 changes: 12 additions & 1 deletion packages/muelu/test/scaling/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,19 @@ MueLu::MueLu_AMGX_initialize_plugins();
if (paramList.isParameter(name))
realParams.setEntry(name, paramList.getEntry(name));
}
}

// Galeri updates (only works with Run1)
if(paramList.sublist("Run1").isSublist("Galeri")) {
ParameterList& moreParams = paramList.sublist("Run1").sublist("Galeri");
std::cout<<"*** moreParams ***"<<std::endl<<moreParams<<std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing std::cout to out to avoid all processes printing.

for (ParameterList::ConstIterator it = moreParams.begin(); it != moreParams.end(); it++) {
const std::string& name = moreParams.name(it);
if (moreParams.isParameter(name))
realParams.setEntry(name, moreParams.getEntry(name));
}
}
}

#ifdef HAVE_MPI
// Generate the node-level communicator, if we want one
Teuchos::RCP<const Teuchos::Comm<int> > nodeComm;
Expand Down
73 changes: 73 additions & 0 deletions packages/muelu/test/scaling/anisotropic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<ParameterList>
<ParameterList name="Run1">
<ParameterList name="Galeri">
<!-- // z3 e z4
// b a c
// z1 d z2 -->
<Parameter name="a" type="double" value="28"/>
<Parameter name="b" type="double" value="-10"/>
<Parameter name="c" type="double" value="-10"/>
<Parameter name="d" type="double" value="-1"/>
<Parameter name="e" type="double" value="-1"/>

<Parameter name="z1" type="double" value="-1"/>
<Parameter name="z2" type="double" value="-1"/>
<Parameter name="z3" type="double" value="-1"/>
<Parameter name="z4" type="double" value="-1"/>
</ParameterList>


<ParameterList name="MueLu">

<!--
For a generic symmetric scalar problem, these are the recommended settings for MueLu.
-->

<!-- =========== GENERAL ================ -->
<Parameter name="verbosity" type="string" value="high"/>

<Parameter name="coarse: max size" type="int" value="1000"/>

<Parameter name="multigrid algorithm" type="string" value="unsmoothed"/>

<!-- reduces setup cost for symmetric problems -->
<Parameter name="transpose: use implicit" type="bool" value="true"/>

<!-- start of default values for general options (can be omitted) -->
<Parameter name="max levels" type="int" value="2"/>
<Parameter name="number of equations" type="int" value="1"/>
<Parameter name="sa: use filtered matrix" type="bool" value="true"/>
<!-- end of default values -->

<!-- =========== AGGREGATION =========== -->
<Parameter name="aggregation: type" type="string" value="uncoupled"/>
<Parameter name="aggregation: drop scheme" type="string" value="classical"/>
<!-- Uncomment the next line to enable dropping of weak connections, which can help AMG convergence
for anisotropic problems. The exact value is problem dependent. -->
<Parameter name="aggregation: drop tol" type="double" value="0.2"/>

<!-- =========== SMOOTHING =========== -->
<Parameter name="smoother: type" type="string" value="RELAXATION"/>
<ParameterList name="smoother: params">
<Parameter name="relaxation: type" type="string" value="Gauss-Seidel"/>
<Parameter name="relaxation: sweeps" type="int" value="2"/>
</ParameterList>

<!-- =========== REPARTITIONING =========== -->
<Parameter name="repartition: enable" type="bool" value="true"/>
<Parameter name="repartition: partitioner" type="string" value="zoltan2"/>
<Parameter name="repartition: start level" type="int" value="2"/>
<Parameter name="repartition: min rows per proc" type="int" value="800"/>
<Parameter name="repartition: max imbalance" type="double" value="1.1"/>
<Parameter name="repartition: remap parts" type="bool" value="false"/>
<!-- start of default values for repartitioning (can be omitted) -->
<Parameter name="repartition: remap parts" type="bool" value="true"/>
<Parameter name="repartition: rebalance P and R" type="bool" value="false"/>
<ParameterList name="repartition: params">
<Parameter name="algorithm" type="string" value="multijagged"/>
</ParameterList>
<!-- end of default values -->

</ParameterList>
</ParameterList>
</ParameterList>