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

Should we make Conjugate Gradient + FFTBased-preconditioner the default for HydrostaticFreeSurfaceModel? #2635

Closed
navidcy opened this issue Jun 30, 2022 · 6 comments
Labels
performance 🏍️ So we can get the wrong answer even faster

Comments

@navidcy
Copy link
Collaborator

navidcy commented Jun 30, 2022

Seems that #2412 suggests that this is the fastest way for grids that don't have regular horizontal spacing or have an immersed boundary.

Yet, the free surface solver constructor falls back to the MatrixBasedSolver in those cases.

default_method = is_horizontally_regular(grid) ? :FastFourierTransform : :HeptadiagonalIterativeSolver

Should we change that?

@navidcy navidcy added the performance 🏍️ So we can get the wrong answer even faster label Jun 30, 2022
@simone-silvestri
Copy link
Collaborator

Sounds good! we have to leave it only for LatitudeLongitudeGrid

@simone-silvestri
Copy link
Collaborator

I wonder about CPU execution though... because the MatrixSolver with ILU was not tested and that in my experience seemed always to be the fastest method

@glwagner
Copy link
Member

glwagner commented Jul 1, 2022

These benchmarks:

#2412

show a factor of 2 speed up on the CPU. In principle, the FFT is faster than a matrix multiply which may explain it? Or, perhaps the benchmarks test the wrong thing so we should re-run them.

As explained on that PR, some performance is left on the table, because the fastest combination would use an FFT-based preconditioner with a matrix multiply to compute the LHS.

@simone-silvestri
Copy link
Collaborator

simone-silvestri commented Jul 1, 2022

Yeah, but the ILU preconditioner doesn't seem to be tested, which I remember was quite good to reduce the number of iterations. So in case of a large time step that would be quite efficient even if we have to solver two triangular linear systems each iteration.

but anyways, maybe it's not faster, it was just I was wondering how it would compare

@glwagner
Copy link
Member

glwagner commented Jul 1, 2022

Hmm, well I guess we should add that combination to

https://github.com/CliMA/Oceananigans.jl/blob/main/benchmark/benchmark_hydrostatic_model.jl

and re-run the benchmarks.

@simone-silvestri
Copy link
Collaborator

I think we can close this as we have the SplitExplicitFreeSurface as a default now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance 🏍️ So we can get the wrong answer even faster
Projects
None yet
Development

No branches or pull requests

3 participants