-
Notifications
You must be signed in to change notification settings - Fork 189
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
Short range #1197
Short range #1197
Conversation
independent of the cell system. New function short_range_loop that ties together Espresso globals (skin...) and cell system specific distance calculation, and runs caller-supplied kernels on the pairs. Addapted icc, energy, force and pressure calculation to use these new functions. Tests for link_cell and verler_ia. Sorry for the monolithic commit.
Since I plan to use this, two quick questions:
|
This is currently under review and is supposed to be part of the upcoming release. I haven't started any further cell system abstraction, but I have a plan on how to do it. Some parts are obvious, those currently solved by function pointers and the switch statements in cells.cpp can be easily solved by dynamic polymorphism. I think we can stay with the free short-range algorithm as in this pull request, and can than use some form of tag dispatch to select the distance function, I think we can not use virtual functions for that for performance reasons, but I think the 3 cases implemented in this PR should be sufficient, so we can largely keep that generic. |
A comment on the distance functors: At some point in time we talked about not folding the particles during ghost exchange anymore and fulfilling the minimum image convention of particle pairs where a ghost cells is involved by explicitly applying it in this case. With the proposed changes, this is not possible anymore as the distance functors only have the particles as parameters. The only option is to test |
I'm not sure that I follow. If the ghosts are not folded but just have their "real" position, MI can just be applied always. |
But you can save the MI overhead in the interior as non-ghost particles are folded into their cells in the exchange. To do this you need to discriminate between local-local and local-ghost (cell) pairs in the distance function. |
Check && in args in algorithm/.hpp |
get_pairs() in parallel |
Let me quickly do a follow up on my last comments: My aim was to create as few ghost cells as possible and stop shifting the particles as this is quite complicated for non-regular domain decomposition. If we do not require ghost particles to be shifted during ghost communication, we need to use The only option to support this is to have a distance functor also taking the cells/neighbors and then marking them as "needs get_mi_vector". Any comments or suggestions on this problem? |
We should check if something else is affected if cells are not there own neighbors anymore, this would save another irregular branch in the hot path. |
@KaiSzuttor and I reviewed the code as compared to the common ancestor. Generally, this pr brings much more clarity and a ton of (nearly) duplicate code is removed. The following issues arose:
|
Done. The effective pair max_cut could also be precalculated, but this has to
There kernels nor all are forwarding refs, the Ranges are passed by value because they
Done.
Done.
This is not mine, it was like this in the original implementation. It's shifted because cells[0] is the lower ghost cell. So yes, this is intentional and correct.
Also from the original.
Cells were only their own neighbors for dd, I dropped that which seems not to break anything and removed the check in the pair algos. |
Codecov Report
@@ Coverage Diff @@
## python #1197 +/- ##
==========================================
+ Coverage 43.19% 43.69% +0.49%
==========================================
Files 371 377 +6
Lines 29593 29481 -112
Branches 5613 5515 -98
==========================================
+ Hits 12784 12881 +97
+ Misses 16785 16576 -209
Partials 24 24
Continue to review full report at Codecov.
|
This makes the code considerably slower in debug mode, it's getting close to the 10 minute limit on travis (e.g. langevin_thermostat). |
@RudolfWeeber ready to be reviewed again. Docs could be more, but it is not clear to me which part of the algorithms would not be selfexplainatory. If you want a more detailed description please let me know what needs more explaining and I will extend the docs. Also this now contains a bugfix for the layered cell system, which fixes an issue that showed up with the new tests. |
Can be merged. |
…mit interaction_bonded to 2 cores becausde it does not work with 3 due to box size restrictions.
Description of changes:
Performance has slightly improved:
For a 1/1 wca system with 2362 parts, it improved from 600 ms / 1000 steps to
500 ms / 1000 steps.
Encapsulation is not perfect, but this is only a transient state, will improve further
with cell system abstraction.
PR Checklist