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

Reduce usage of local_cells #2991

Closed
wants to merge 7 commits into from

Conversation

KaiSzuttor
Copy link
Member

@KaiSzuttor KaiSzuttor commented Jul 16, 2019

Part of the solution to #2899

@codecov
Copy link

codecov bot commented Jul 16, 2019

Codecov Report

Merging #2991 into python will increase coverage by <1%.
The diff coverage is 92%.

Impacted file tree graph

@@           Coverage Diff            @@
##           python   #2991     +/-   ##
========================================
+ Coverage      82%     82%    +<1%     
========================================
  Files         525     522      -3     
  Lines       26806   25584   -1222     
========================================
- Hits        22014   21058    -956     
+ Misses       4792    4526    -266
Impacted Files Coverage Δ
src/core/constraints/ShapeBasedConstraint.hpp 100% <ø> (ø) ⬆️
src/core/electrostatics_magnetostatics/icc.hpp 100% <ø> (ø) ⬆️
src/core/rotation.hpp 100% <ø> (ø) ⬆️
src/core/statistics_chain.cpp 96% <0%> (ø) ⬆️
src/script_interface/mpiio/si_mpiio.hpp 100% <100%> (ø) ⬆️
src/core/io/mpiio/mpiio.cpp 85% <100%> (ø) ⬆️
src/core/rattle.cpp 90% <100%> (ø) ⬆️
src/core/constraints/ShapeBasedConstraint.cpp 89% <100%> (-1%) ⬇️
src/core/rotate_system.cpp 100% <100%> (ø) ⬆️
src/core/particle_data.cpp 96% <100%> (ø) ⬆️
... and 171 more

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 182020a...83b3b7d. Read the comment docs.

@fweik
Copy link
Contributor

fweik commented Jul 16, 2019

Did you consult with @reinaual, I think he was also looking into this.

@KaiSzuttor
Copy link
Member Author

no, I'm not yet into mind reading

@fweik
Copy link
Contributor

fweik commented Jul 16, 2019

Yeah, better work organization/mind reading technique is on the agenda for when I'm back this fall. For now I'm afraid you have to talk to other people every now and then...

@KaiSzuttor
Copy link
Member Author

actually I think there is no magic behind writing a comment to an issue, also when we assign issues to somebody

Copy link
Contributor

@fweik fweik left a comment

Choose a reason for hiding this comment

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

LGTM, except for a few cases where I think the interface is too narrow. In these cases
I think a CellStructure should be passed instead (or a CellPList where sufficient).

@@ -60,10 +61,11 @@ void init_forces_ghosts();
* <li> Calculate long range interaction forces
* </ol>
*/
void force_calc();
void force_calc(const ParticleRange &particles);
Copy link
Contributor

Choose a reason for hiding this comment

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

force_calc actually needs access to the cells and to the particle index. To be clear, it should take something like a CellStructure as a parameter, which hopefully at some point in the future will encapsulate everything.

Copy link
Member Author

Choose a reason for hiding this comment

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

you mean, we should also extract the cell_structure global and the ghost_cells?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can either leave the globals, and refactor this latter, or put the {local, global}_cells, potentially as dummy methods that return the globals into CellStructure and pass that.
They should not passed next to each other, because you actually have to have the cells that belong to the cell structure that is passed, and the particles that belong to those cells.


if (integ_switch != INTEG_METHOD_STEEPEST_DESCENT) {
#ifdef ROTATION
convert_initial_torques();
convert_initial_torques(local_cells.particles());
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the ParticleRange is used multiple times in this function, you should put it into local variables (after the resort), and reuse it. The range actually has state (because it caches its size which can not be calculated in constant time), so this has performance benefits.

Copy link
Member Author

Choose a reason for hiding this comment

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

what do you mean with "after the resort"?

Copy link
Contributor

Choose a reason for hiding this comment

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

This function function calls the particle resorting. This can invalidate the particle ranges, so after the resort the ranges have to be updated.

@@ -49,16 +49,17 @@ int n_rigidbonds = 0;

/** Calculates the corrections required for each of the particle coordinates
according to the RATTLE algorithm. Invoked from \ref correct_pos_shake()*/
void compute_pos_corr_vec(int *repeat_);
void compute_pos_corr_vec(int *repeat_, const ParticleRange &particles);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as for force_calc applies, also the range should be reused withing thre function.

revert(p);
}

void correct_vel_shake() {
void correct_vel_shake(const ParticleRange &particles,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as for force_calc applies, also the range should be reused withing thre function.

@KaiSzuttor
Copy link
Member Author

handed over to @reinaual

@KaiSzuttor KaiSzuttor closed this Jul 25, 2019
bors bot added a commit that referenced this pull request Jul 25, 2019
2939: Documentation of VV, NPT, Thermostats r=RudolfWeeber a=christophlohrmann

Fixes #2680 

Description of changes:
 - Added sphinx documentation for velocity verlet, NPT
- Added/Updated sphinx documentation for Langevin, NPT, LB, DPD thermostat
- Found some papers as reference


PR Checklist
------------
 - [ ] Tests?
   - [ ] Interface
   - [ ] Core 
 - [x] Docs?


3006: Reduce usage of local cells r=fweik a=KaiSzuttor

Fixes part of #2899

Description of changes:
 - replacement for #2991 

3008: Removed from __future__ r=jngrad a=jrfinkbeiner

Fixes #3004

3015: Update checkpointing docs r=jngrad a=RudolfWeeber

Fixes #2808

Co-authored-by: Christoph Lohrmann <clohrmann@icp.uni-stuttgart.de>
Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
Co-authored-by: Kai Szuttor <kai@icp.uni-stuttgart.de>
Co-authored-by: Alexander Reinauer <st144434@stud.uni-stuttgart.de>
Co-authored-by: Jan Finkbeiner <st144298@stud.uni-stuttgart.de>
Co-authored-by: Rudolf Weeber <weeber@icp.uni-stuttgart.de>
bors bot added a commit that referenced this pull request Jul 25, 2019
2939: Documentation of VV, NPT, Thermostats r=RudolfWeeber a=christophlohrmann

Fixes #2680 

Description of changes:
 - Added sphinx documentation for velocity verlet, NPT
- Added/Updated sphinx documentation for Langevin, NPT, LB, DPD thermostat
- Found some papers as reference


PR Checklist
------------
 - [ ] Tests?
   - [ ] Interface
   - [ ] Core 
 - [x] Docs?


3006: Reduce usage of local cells r=fweik a=KaiSzuttor

Fixes part of #2899

Description of changes:
 - replacement for #2991 

Co-authored-by: Christoph Lohrmann <clohrmann@icp.uni-stuttgart.de>
Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
Co-authored-by: Kai Szuttor <kai@icp.uni-stuttgart.de>
Co-authored-by: Alexander Reinauer <st144434@stud.uni-stuttgart.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants