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

Refactor P3M/DP3M exception mechanism #4118

Merged
merged 10 commits into from
Feb 23, 2021
Merged

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Feb 19, 2021

Fixes #4117

Description of changes:

  • raise RuntimeError when a P3M/DP3M actor is instantiated with incorrect parameters, instead of silently ignoring the error code from the core and leaving the core struct in an undefined state (e.g. an incorrect alpha would cause the core setter to return early with an unhandled error code, leaving alpha and accuracy uninitialized in the core)
  • move error messages in the P3M/DP3M setters from Cython to the core and fix misleading ELC error messages
  • remove the possibility to constrain alpha during tuning (had no effect: alpha is derived from the other parameters)
  • restore the python interface of the P3M mesh offset parameter
  • remove ~120 lines of duplicated Cython code

Convert comments to doxygen comments. Remove documentation of DP3M
variables and macros that no longer exist.
The alpha parameter cannot be constrained to a specific value.
It is always derived from the other parameters during tuning.
Invalid P3M/DP3M parameters now throw exceptions. In the previous
implementation, the returned error code was silently ignored, and a
std::runtime_error thrown by P3MGPU wasn't caught in MPI callbacks.
Code duplication between the core and python interface of P3M/DP3M
was removed.
@reinaual reinaual added the automerge Merge with kodiak label Feb 23, 2021
@kodiakhq kodiakhq bot merged commit 08207b3 into espressomd:python Feb 23, 2021
@jngrad jngrad deleted the p3m-exceptions branch February 23, 2021 17:18
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.

P3M and DP3M can silently ignore invalid parameters
2 participants