-
Notifications
You must be signed in to change notification settings - Fork 247
dsl/compiler: Extend solver_parameters handling in PETScSolve and update logging #2718
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
Conversation
…nctionality examples: Add example using argparse in conjunction with PetscInitialize
…to set petsc options
| 'ksp_type': 'gmres', | ||
| 'pc_type': 'none', | ||
| 'ksp_rtol': 1.e-5, | ||
| 'ksp_atol': 1.e-50, |
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.
That's an interesting "numerical" number
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.
It is the default one used in PETSc
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## petsc #2718 +/- ##
==========================================
- Coverage 84.89% 84.46% -0.44%
==========================================
Files 268 269 +1
Lines 52464 52832 +368
Branches 4457 4472 +15
==========================================
+ Hits 44540 44622 +82
- Misses 7155 7440 +285
- Partials 769 770 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
devito/petsc/iet/logging.py
Outdated
| Example: | ||
| -------- | ||
| >>> self.function_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.
Should self.function_list be allowed to be mutable? Ditto with self.petsc_option_mapper
JDBetteridge
left a comment
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.
Not all comments need addressing before merge
|
|
||
|
|
||
| petsc_variables = get_petsc_variables() | ||
| # TODO: Use petsctools get_petscvariables() instead? |
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.
TODO
| def get_petsc_type_mappings(): | ||
| try: | ||
| petsc_precision = petsc_variables['PETSC_PRECISION'] | ||
| except KeyError: |
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.
Shouldn't this be a hard error if the precision cannot be determined?
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 is called inside devito/passes/iet/languages/C.py so it;s not a hard error otherwise CI will break. However it's also called inside PETScSolve, so maybe this should be extended
| if petsc_precision == 'single': | ||
| mapper[ctypes.c_float] = petsc_scalar |
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 think a lot of this shouldn't be indented, but I can't tell because github has messed up the formatting.
…et_info, clean up and more tests
2d1fd0c to
09a1d20
Compare
solver_parametersdictionary inPETScSolve.solver_parametersdict.get_infoargument toPETScSolveto collect specific statistics from the solver.