-
Notifications
You must be signed in to change notification settings - Fork 34
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
Ifpack move parameters and options to xml file #400
base: main
Are you sure you want to change the base?
Ifpack move parameters and options to xml file #400
Conversation
@dharinib98, this branch needs to be rebased to resolve merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to the input files change the preconditioner for some tests, since the new xml file always use zero overlap and a fill level of 0
, while some tests have used different settings. I don't say, that you have to change this. I just want to create awareness for this change.
What are the plans to actually dis-allow the old way of configuring Ifpack preconditioners>
/*ifpacklist.set("fact: level-of-fill", inparams.get<int>("IFPACKGFILL")); | ||
ifpacklist.set("partitioner: overlap", inparams.get<int>("IFPACKOVERLAP")); | ||
ifpacklist.set("schwarz: combine mode", | ||
inparams.get<std::string>("IFPACKCOMBINE")); // can be "Zero", "Add", "Insert" | ||
ifpacklist.set("schwarz: reordering type", "rcm"); // "rcm" or "metis" or "amd" | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/*ifpacklist.set("fact: level-of-fill", inparams.get<int>("IFPACKGFILL")); | |
ifpacklist.set("partitioner: overlap", inparams.get<int>("IFPACKOVERLAP")); | |
ifpacklist.set("schwarz: combine mode", | |
inparams.get<std::string>("IFPACKCOMBINE")); // can be "Zero", "Add", "Insert" | |
ifpacklist.set("schwarz: reordering type", "rcm"); // "rcm" or "metis" or "amd" | |
*/ |
ifpacklist.set("partitioner: overlap", inparams.get<int>("IFPACKOVERLAP")); | ||
ifpacklist.set("schwarz: combine mode", | ||
inparams.get<std::string>("IFPACKCOMBINE")); // can be "Zero", "Add", "Insert" | ||
ifpacklist.set("schwarz: reordering type", "rcm"); // "rcm" or "metis" or "amd" | ||
*/ | ||
|
||
std::string xmlfile = inparams.get<std::string>("IFPACK_XML_FILE"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::string xmlfile = inparams.get<std::string>("IFPACK_XML_FILE"); | |
const std::string xmlfile = inparams.get<std::string>("IFPACK_XML_FILE"); |
... and also at other places throughout this PR.
IFPACK_XML_FILE xml/ifpack.xml | ||
IFPACKCOMBINE Zero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IFPACK_XML_FILE xml/ifpack.xml | |
IFPACKCOMBINE Zero | |
IFPACK_XML_FILE xml/ifpack.xml | |
IFPACKCOMBINE Zero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yet another reason to use yaml for input files :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this is also the case with overlap values, not all files use a value of 0. Based on the number of tests that fail, we can think about a solution by maybe adding another xml file for the higher gfill values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have one or two default xml files in the central xml file collection. If individual tests require a specialized preconditioned, then we can put the xml file just next to the input file.
@@ -61,8 +61,7 @@ AZTOL 1.0E-3 | |||
AZCONV AZ_r0 | |||
AZITER 1000 | |||
AZSUB 50 | |||
IFPACKGFILL 1 | |||
IFPACKOVERLAP 1 | |||
IFPACK_XML_FILE xml/ifpack.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This places the xml file into the top level directory of all xml files for solvers/preconditioners. There is an existing folder structure. @maxfirmbach, should we sort it into the folder structure? If yes, where? Into a new directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dharinib98 @mayrmt We need to figure out a place, not sure where it fits best, in theory we could just create a folder called preconditioner
and put all preconditioner related .xml files there with an updated naming scheme. So xml/preconditioner/ifpack.xml
would work for me right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one major point I would like to change. Currently AZPREC
is called ILU
, which I would like to switch to Ifpack
to be consistent with all other AZPREC
package calls e.g. MueLu
and Teko
. This will for sure change again soon, but for now we are not limited to ILU
by using the .xml file as one could also use ILUT
or even just a Jacobi
method.
@@ -61,8 +61,7 @@ AZTOL 1.0E-3 | |||
AZCONV AZ_r0 | |||
AZITER 1000 | |||
AZSUB 50 | |||
IFPACKGFILL 1 | |||
IFPACKOVERLAP 1 | |||
IFPACK_XML_FILE xml/ifpack.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dharinib98 @mayrmt We need to figure out a place, not sure where it fits best, in theory we could just create a folder called preconditioner
and put all preconditioner related .xml files there with an updated naming scheme. So xml/preconditioner/ifpack.xml
would work for me right now.
@mayrmt We will use the provided .xml file for now and see how many tests fail. From that point on we slowly work towards passing all tests with a minimal set of configs. |
eab2e0e
to
0cdbd4a
Compare
src/inpar/4C_inpar_solver.cpp
Outdated
Core::Utils::string_parameter( | ||
"IFPACK_XML_FILE", "none", "xml file defining any IFPACK options", &list); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can read files in a better way (so that relative paths are correctly resolved). See e.g. https://github.com/4C-multiphysics/4C/blob/main/src/inpar/4C_inpar_solver.cpp#L104-L108
// get the type of ifpack preconditioner from solver parameter list | ||
std::string prectype = solverlist_.get("Preconditioner Type", "ILU"); | ||
const int overlap = ifpacklist_.get("IFPACKOVERLAP", 0); | ||
std::string xmlFileName = ifpacklist_.get<std::string>("IFPACK_XML_FILE"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::string xmlFileName = ifpacklist_.get<std::string>("IFPACK_XML_FILE"); | |
const std::string xmlFileName = ifpacklist_.get<std::string>("IFPACK_XML_FILE"); |
auto prectype = ifpack_params.get<std::string>("Preconditioner type"); | ||
auto overlap = ifpack_params.get<int>("Overlap"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Const qualifiers?
auto prectype = ifpack_params.get<std::string>("Preconditioner type"); | |
auto overlap = ifpack_params.get<int>("Overlap"); | |
const std::string prectype = ifpack_params.get<std::string>("Preconditioner type"); | |
const int overlap = ifpack_params.get<int>("Overlap"); |
Description and Context
Ifpack parameters have been moved to an xml file like other preconditioners. Input parameters related to Ifpack have bene removed from the code. Further steps include moving it to the back end based on Stratimikos.
Related Issues and Merge Requests
Part of #365