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

Enable two ScaFaCoS instances #4036

Merged
merged 16 commits into from
Dec 16, 2020
Merged

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Dec 10, 2020

Fixes #2636

Description of changes:

  • create two global variables: one for ScaFaCoS electrostatics and one for ScaFaCoS magnetostatics
  • ScaFaCoS can now be used for electrostatics+magnetostatics simultaneously (see test in 9b65a90)
  • hide the ScaFaCoS context (i.e. flattened position/charge/dipole arrays) in a ScafacosContext struct
  • make this struct available from outside only through a pointer to ScafacosContextBase* (type erasure)
  • make the ScaFaCoS short-range force/energy kernels inline
  • fix a bug in the dipolar_mdlc_p3m_scafacos_p2nfft.py testcase
  • fix a bug in the Cython interface of the Scafacos actor that prevented returning some parameters from the core

jngrad added 12 commits December 9, 2020 22:59
system.actors.clear() doesn't clear the DLC actor on the first pass.
In that situation, if the DLC check fails, it exits early before the
calls to `del system.actors[0]` and triggers the tearDown() method,
which cannot remove DLC. The system is then in an undetermined state
for the ScaFaCoS check, which throws an exception.
There are now two static globals: one for ScaFaCoS Coulomb and one
for ScaFaCoS dipoles. We can now in principle run a magnetostatics
method and an electrostatics method simultaneously.
Simplify the ScaFaCoS interface by hiding implementation details
behind a pointer to a class that doesn't depend on Scafacos.hpp.
@jngrad
Copy link
Member Author

jngrad commented Dec 10, 2020

@reinaual The relevant part of the PR is 6b2f51c...jngrad:scafacos-split

UBSAN report: "reference binding to null pointer of type 'double'".
When the system has no particles, the ScaFaCoS input vectors are
empty and cannot be dereferenced.
@jngrad jngrad self-assigned this Dec 11, 2020
KaiSzuttor
KaiSzuttor previously approved these changes Dec 14, 2020
@KaiSzuttor KaiSzuttor dismissed their stale review December 14, 2020 13:26

accidental approval

@jngrad jngrad added the automerge Merge with kodiak label Dec 16, 2020
@kodiakhq kodiakhq bot merged commit 9f17307 into espressomd:python Dec 16, 2020
@jngrad jngrad deleted the scafacos-split branch December 16, 2020 12:21
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.

Scafacos coulomb and dipolar should be seperated
4 participants