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

Fix hpmg for some non-ideal resolutions #1062

Conversation

AlexanderSinn
Copy link
Member

Previously there would have been an invalid device memory access in bottomsolve_gpu from cor[0]. Now, a warning is printed and a different bottomsolve is used that can make the solver converge reasonably quickly if the final MG level has around 100^2 cells or less.

  • Small enough (< few 100s of lines), otherwise it should probably be split into smaller PRs
  • Tested (describe the tests in the PR description)
  • Runs on GPU (basic: the code compiles and run well with the new module)
  • Contains an automated test (checksum and/or comparison with theory)
  • Documented: all elements (classes and their members, functions, namespaces, etc.) are documented
  • Constified (All that can be const is const)
  • Code is clean (no unwanted comments, )
  • Style and code conventions are respected at the bottom of https://github.com/Hi-PACE/hipace
  • Proper label and GitHub project, if applicable

@AlexanderSinn AlexanderSinn added the bug Something isn't working label Jan 24, 2024
Comment on lines +1165 to +1172
// Use numsweeps equal to the box length rounded up to an even number for large boxes
int numsweeps = std::max(nsweeps, (m_cor[ilev].box().length().max() + 1) / 2 * 2);
for (int is = 0; is < numsweeps; ++is) {
gsrb(is, m_domain[ilev], m_cor[ilev].array(),
m_res[ilev].const_array(), m_acf[ilev].const_array(), dx0, dy0,
m_system_type);
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@WeiqunZhang Is it good to do many gauß seidel iterations on the coarsest level in case the domain cannot be coarsened further, or could this introduce a lot of noise?

Copy link
Member

Choose a reason for hiding this comment

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

Doing more iterations on the coarsest level will not hurt the convergence. It may not help much either if it's not coarse enough, because it's not very effective at reducing the low frequency errors. If this becomes an issue, we could use a Krylov subspace solver instead of GS.

Copy link
Member

@MaxThevenet MaxThevenet 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 this PR!

@MaxThevenet MaxThevenet merged commit 12eaba9 into Hi-PACE:development Feb 22, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants