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

Create a GMRES subsection in Solver parameters #2163

Merged
merged 8 commits into from Apr 24, 2018

Conversation

naliboff
Copy link
Contributor

Partially addresses #2023. Moving these two parameters does not require running the update script, but moving any of the other solver parameters would require doing so.

@jdannberg
Copy link
Contributor

Keep in mind that even though we may not use any of these parameters in our tests, other people might still use them in their input file, so we should add an entry in the update script anyway. Also, I would vote for moving Number of cheap Stokes solver steps and Maximum number of expensive Stokes solver steps too. Thoughts?

@jdannberg jdannberg added this to the 2.0 milestone Apr 12, 2018
@naliboff
Copy link
Contributor Author

I agree we should move Number of cheap Stokes solver steps and Maximum number of expensive Stokes solver steps. Beyond these two, I think we would need to move all of the rest as a group. For example, I don't think it would make sense to have the Nonlinear solver scheme and Nonlinear solver tolerance in different sections.

For these (and any other) parameters I don't think there is any need to use an additional subsection under Solver parameters.

Once we decide on the remaining parameters to move, I'll modify the update script.

@@ -338,6 +321,26 @@ namespace aspect

prm.enter_subsection ("Solver parameters");
{
prm.enter_subsection ("GMRES parameters");
Copy link
Contributor

Choose a reason for hiding this comment

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

Could I advocate for this to be renamed "Linear solver parameters"? The fact that we use GMRES is not really material in this regard -- it's just what we happen to use -- whereas the important fact is that it's about solving the linear problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. I think it would be logical to move Number of cheap Stokes solver steps and Maximum number of expensive Stokes solver steps into this section as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense.

@jdannberg
Copy link
Contributor

Thinking about this for a bit, we could also discuss if we want to move Use direct solver for Stokes system too.

@naliboff
Copy link
Contributor Author

If we keep 'Linear solver tolerance' outside of the Solver parameters subsection, I think it makes sense to keep Use direct solver for Stokes system in the same place. However, If the group consensus is to move it, no real objection.

@naliboff
Copy link
Contributor Author

I've updated the subsection name to Linear solver parameters and moved Number of cheap Stokes solver steps and Maximum number of expensive Stokes solver steps here.

Unless there are more parameters to move into this subsection or Solver parameters in general, I'll revise the update script. Many of the tests should fail before this update.

@bangerth
Copy link
Contributor

bangerth commented Apr 14, 2018 via email

Copy link
Member

@gassmoeller gassmoeller left a comment

Choose a reason for hiding this comment

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

Two minor improvements. I will send you an update script for the parameter files later this week.

@@ -338,6 +255,92 @@ namespace aspect

prm.enter_subsection ("Solver parameters");
{
prm.enter_subsection ("Linear solver parameters");
Copy link
Member

Choose a reason for hiding this comment

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

Could you rename this "Stokes solver parameters"?

Patterns::Double(0,1),
"The relative tolerance up to which the linear system for "
"the composition system gets solved. See `linear solver "
"tolerance' for more details.");
Copy link
Member

Choose a reason for hiding this comment

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

And leave these for now in the global section.

@naliboff
Copy link
Contributor Author

@gassmoeller - The last commit addressed your two comments. Should I squash everything down to one commit before changing the update script?

Copy link
Member

@gassmoeller gassmoeller left a comment

Choose a reason for hiding this comment

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

Nice job. Now we just need to figure out the test failures.

# We fix the temperature at the top and bottom boundaries of
# the box, and prescribe free-slip boundary conditions on all
# sides.
# We choose a high tolerance for the linear Stokes solver.
Copy link
Member

Choose a reason for hiding this comment

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

strict tolerance might be less ambiguous

@gassmoeller
Copy link
Member

I think I fixed the update script for all special cases we had. @naliboff, sorry for taking over your PR, I rebased everything after #2168 was merged, so you will need to throw away your local branch and check out this one if you want to do any more changes. Hopefully that should not be necessary though. I removed some parameter lines that just set parameters to their default value, and made sure that the benchmarks and cookbooks are still nice to read.
Time for a final review and merge?


# The end time of the simulation. Because we want to see how upwellings
# and downwellings evolve over time, and if differences develop between
# the model with and without melt migration, we set the end time to 140 Ma.
set End time = 1.4e8

# We choose a stricter than default linear Stokes solver tolerance,
# to improve the nonlinear convergence behavior.
Copy link
Contributor

Choose a reason for hiding this comment

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

This model does not do any nonlinear iterations. And please don't ask, I do not remember why I set the parameter to this number... (except to make sure that the global_melt and global_no_melt models have the same parameter values). So I would either remove the comment, or move it to the global_melt.prm input file.

Copy link
Contributor

Choose a reason for hiding this comment

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

This would also have the advantage that the files in the doc/manual/cookbooks and the cookbooks folder have the same documentation.

@gassmoeller
Copy link
Member

Done. @tjhei: It seems the tester is taking a break, can you have a look? Thanks!

@naliboff
Copy link
Contributor Author

@gassmoeller - No problem at all and thanks for doing all the work with the update script and parameter file cleanup! I just looked through the cookbook and benchmark parameter file changes and all looks good. As soon as the tester finishes, I agree this is ready to merge.

@jdannberg
Copy link
Contributor

I am doing a review at the moment, please don't merge until I'm done.

Copy link
Contributor

@jdannberg jdannberg left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this! Please address my comments before merging.


# The end time of the simulation. Because we want to see how upwellings
# and downwellings evolve over time, and if differences develop between
# the model with and without melt migration, we set the end time to 140 Ma.
set End time = 1.4e8

# We choose a stricter than default linear Stokes solver tolerance,
# to improve the nonlinear convergence behavior.
Copy link
Contributor

Choose a reason for hiding this comment

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

This would also have the advantage that the files in the doc/manual/cookbooks and the cookbooks folder have the same documentation.

subsection Stokes solver parameters
set Number of cheap Stokes solver steps = 0
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

If this was not in the original file, you don't have to add this here (in particular as there's no documentation on why the parameter is chosen like this).

@@ -1,4 +1,3 @@
set Linear solver tolerance = 1e-12
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the default value, so you can not just remove it. Please add it below to the Stokes solver parameters.

@@ -9,7 +9,6 @@
# equal to the start time to force a single time
# step before the program terminates.
set Additional shared libraries = ./libburstedde.so
set Linear solver tolerance = 1e-12
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the default value, so you can not just remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

"If this value is set too low for the size of the problem, the Stokes solver will "
"not converge and return an error message pointing out that the user didn't allow "
"a sufficiently large number of iterations for the iterative solver to converge.");

prm.declare_entry ("Temperature solver tolerance", "1e-12",
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we had agreed to also move the temperature and composition solver tolerance if we move the linear solver tolerance?
I am not insisting on this (and the last time we talked about this, I had assumed none of these tolerances would be moved, that is why I argued they should stay where they are), but I just think this can be quite confusing. Why is the Linear solver tolerance in its own subsection, while the temperature and composition solver tolerances aren't?
We can also do that in a follow-up pull request, but we should at least discuss again what the final state for the release should be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I recall us deciding that the composition and temperature solver tolerance would be moved eventually, but not in this pull request.

I think the decision was based on the fact that there currently are no other values we would move into the composition and temperature solver subsections and it would simply add lines to the input file. If someone creates more parameters related to the composition and linear solver tolerance, then it would make sense to move them.

However, I agree it is a bit confusing to have the temperature and composition solver tolerances as global parameters now. Do you think it is worth moving them into a new subsection before the 2.0 release? If so, I vote to do this in a separate PR.

@gassmoeller
Copy link
Member

I fixed the issues, thanks for taking a look!
Concerning the advection solver tolerances: I think we discussed this, and settled on something like this: If we move the advection solver tolerances, we also have to do X (I do not quite remember, I think you brought up the point, and I think it was something about the stabilization). That is why we decided to leave them at their current position for now.

@jdannberg
Copy link
Contributor

Okay, looks good to me! I've created an issue (#2171) for the advection solver tolerances, which can then be handled in a follow-up pull request.
Go ahead and merge once the tester is running again and all tests have passed.

@jdannberg jdannberg merged commit debde66 into geodynamics:master Apr 24, 2018
@jdannberg jdannberg mentioned this pull request Apr 24, 2018
@naliboff naliboff deleted the create_gmres_subsection branch June 8, 2018 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants