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

Make LB coupling work with any skin #3025

Merged
merged 18 commits into from
Sep 9, 2019
Merged

Make LB coupling work with any skin #3025

merged 18 commits into from
Sep 9, 2019

Conversation

fweik
Copy link
Contributor

@fweik fweik commented Jul 28, 2019

Description of changes:

  • Particle coupling forces are now calculated by the
    node in whose LB domain the particle position is,
    and not by the node that owns the particle as before.
  • This now works independent of skin.
  • Also fixes the wrong sanity check in the LB, before you
    could use it with an incompatible skin if verlet lists were
    disabled, which would then crash.

@fweik fweik requested a review from RudolfWeeber July 28, 2019 12:54
@fweik fweik added this to the Espresso 4.1 milestone Jul 28, 2019
@codecov
Copy link

codecov bot commented Jul 28, 2019

Codecov Report

Merging #3025 into python will increase coverage by <1%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           python   #3025    +/-   ##
=======================================
+ Coverage      84%     84%   +<1%     
=======================================
  Files         526     526            
  Lines       26089   26091     +2     
=======================================
+ Hits        22132   22137     +5     
+ Misses       3957    3954     -3
Impacted Files Coverage Δ
src/core/grid_based_algorithms/lb.cpp 96% <ø> (ø) ⬆️
...ore/grid_based_algorithms/lb_particle_coupling.hpp 100% <ø> (ø) ⬆️
src/core/forces.cpp 100% <100%> (ø) ⬆️
...ore/grid_based_algorithms/lb_particle_coupling.cpp 98% <100%> (ø) ⬆️
src/core/particle_data.cpp 95% <0%> (-1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff32b09...157003c. Read the comment docs.

Copy link
Member

@KaiSzuttor KaiSzuttor left a comment

Choose a reason for hiding this comment

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

Any idea why the swimmer test fails? We really should get rid of those data driven tests, they don't give any insight.

* @return True iff the point is inside of the domain.
*/
bool in_local_halo(Vector3d const &pos) {
auto const halo = 0.5 * lb_lbfluid_get_lattice().agrid;
Copy link
Member

Choose a reason for hiding this comment

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

lb_lbfluid_get_agrid()

void lb_lbcoupling_calc_particle_lattice_ia(bool couple_virtual) {
void lb_lbcoupling_calc_particle_lattice_ia(
bool couple_virtual, const ParticleRange &local_particles,
const ParticleRange &more_particles) {
Copy link
Member

Choose a reason for hiding this comment

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

what are more_particles supposed to be? Please add a docstring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well propose a better name. I'd prefer just calling the function twice for each range, but that is not possible because of the GPU stuff.

Copy link
Member

Choose a reason for hiding this comment

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

okay different question: do you think that a dev in 3 years still knows whatmore_particles are supposed to be without looking into the source code?

@fweik
Copy link
Contributor Author

fweik commented Jul 29, 2019

I didn't even notice because on my machine it's skipped because vtk is missing.

@fweik
Copy link
Contributor Author

fweik commented Jul 29, 2019

I don't get it. I also don't understand why there is a ghost communication for ENGINE right before the coupling. Maybe I don't understand the algorithm.

@RudolfWeeber
Copy link
Contributor

The halo region might have to include the swimmer->second-force-center distance.
I'm also not sure about parallelizaiton. As the secnd force center might be on a different MPI rank than the corresponding particle, the criterion for coupling a particle might have to be adapted.
@hmenke?

@fweik
Copy link
Contributor Author

fweik commented Jul 30, 2019

The force centers only act on the fluid. They did couple for all particles in the halo region before, and should now. That is not the issue I think. This is some sort comm synchronization issue between ghosts and real particles, but I don't see it. I'll not further look into this, maybe we can revisit if new information comes up.

As as side note, all of this could be avoided if the force centers were just implemented with virtual sites.

@RudolfWeeber
Copy link
Contributor

RudolfWeeber commented Jul 30, 2019 via email

@fweik
Copy link
Contributor Author

fweik commented Jul 30, 2019

Yes, the reason for this PR is that I saw what you were doing for walberla and thought this might help you.

@fweik fweik changed the title Make LB coupling work with any skin WIP: Make LB coupling work with any skin Aug 5, 2019
@RudolfWeeber
Copy link
Contributor

I took another look. I have no idea how to proceed until we have a test for a singe integration step with an engine particle.

It is also not clear why the engine gpu and engine cpu tests use different reference data. If I run the engine gpu with the cpu reference data, the error is even bigger than the change cause dby this PR.

@RudolfWeeber
Copy link
Contributor

@christophlohrmann, based on your observations, should we merge this PR?

@christophlohrmann
Copy link
Contributor

I can't speak about other things, but this PR fixes the issue of the missing second force centers when crossing periodic boundaries, so it's definitely better than the current state

@RudolfWeeber
Copy link
Contributor

The fix even goes so far, that the engine_lb on the cpu can use the same reference data as on the gpu.
@hmenke, is this supposed to work on the cpu in parallel. It is not clear to me, why it should, but the test passes with 4 and 8 cores.

@RudolfWeeber RudolfWeeber changed the title WIP: Make LB coupling work with any skin Make LB coupling work with any skin Sep 5, 2019
@fweik
Copy link
Contributor Author

fweik commented Sep 5, 2019

Originally there was no parallel support. I allowed it at some point because the tests did pass and it should have worked. I did not check the tests though.

@RudolfWeeber
Copy link
Contributor

@KaiSzuttor

@RudolfWeeber
Copy link
Contributor

@KaiSzuttor, Flo answered the question about more_particles on Aug 10. I suggest to merge as is.

@KaiSzuttor
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Sep 9, 2019
3025: Make LB coupling work with any skin r=KaiSzuttor a=fweik

Description of changes:
 - Particle coupling forces are now calculated by the
   node in whose LB domain the particle position is,
   and not by the node that owns the particle as before.
 - This now works independent of skin.
 - Also fixes the wrong sanity check in the LB, before you
   could use it with an incompatible skin if verlet lists were
   disabled, which would then crash.


Co-authored-by: Florian Weik <fweik@icp.uni-stuttgart.de>
Co-authored-by: Rudolf Weeber <weeber@icp.uni-stuttgart.de>
Co-authored-by: RudolfWeeber <weeber@icp.uni-stuttgart.de>
@bors
Copy link
Contributor

bors bot commented Sep 9, 2019

Build succeeded

@bors bors bot merged commit 157003c into espressomd:python Sep 9, 2019
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.

4 participants