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

Remove Observable_stat external linkage #3770

Merged
merged 11 commits into from
Jun 24, 2020

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Jun 23, 2020

Description of changes:

  • re-use code in the cython interface to extract data from Observable_stat objects
  • remove obs_scalar_pressure global variable
    • write-only variable in the core -> can be calculated from obs_pressure_tensor in cython
    • simplify pressure kernels
    • less MPI communication
  • rename obs_pressure_tensor to obs_pressure for consistency with obs_energy
  • remove external linkage for obs_pressure and obs_energy
    • these globals are no longer visible outside of their translation unit
    • use a const reference getter for the script interface
    • partial fix for Remove global variables #2628
  • narrow includes of Observable_stat.hpp
  • add ELC/DLC energy corrections to the P3M/DP3M/DDS solver energy slots
    • the analyze.energy(), analyze.pressure(), analyze.pressure_tensor() functions now only reports 2 slots for Coulomb and dipolar contributions: particles contribution and electrostatics/magnetostatics solver contribution

@codecov
Copy link

codecov bot commented Jun 23, 2020

Codecov Report

Merging #3770 into python will increase coverage by 0%.
The diff coverage is 96%.

Impacted file tree graph

@@          Coverage Diff           @@
##           python   #3770   +/-   ##
======================================
  Coverage      89%     89%           
======================================
  Files         551     551           
  Lines       24468   24462    -6     
======================================
- Hits        21812   21807    -5     
+ Misses       2656    2655    -1     
Impacted Files Coverage Δ
src/core/constraints/ShapeBasedConstraint.cpp 88% <ø> (ø)
src/core/electrostatics_magnetostatics/dipole.cpp 65% <72%> (+1%) ⬆️
src/core/Observable_stat.cpp 100% <100%> (ø)
src/core/Observable_stat.hpp 100% <100%> (ø)
src/core/electrostatics_magnetostatics/coulomb.cpp 78% <100%> (ø)
src/core/energy.cpp 97% <100%> (+<1%) ⬆️
src/core/energy_inline.hpp 84% <100%> (+<1%) ⬆️
src/core/pressure.cpp 97% <100%> (-1%) ⬇️
src/core/pressure_inline.hpp 81% <100%> (-2%) ⬇️
src/core/particle_data.cpp 96% <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 030a97a...88b63bd. Read the comment docs.

@jngrad jngrad changed the title Remove obs_scalar_pressure global Remove Observable_stat external linkage Jun 23, 2020
Pass local variable obs_energy and obs_pressure to energy/pressure
kernels as mutable references to remove external linkage.
@jngrad jngrad requested a review from fweik June 23, 2020 16:05
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.

Clear improvement. I think some of the output parameters should be avoided in the cases where that is simple, see inline comments. This helps to reduce coupling.

src/python/espressomd/analyze.pyx Outdated Show resolved Hide resolved
src/core/cuda_common_cuda.cu Outdated Show resolved Hide resolved
src/core/electrostatics_magnetostatics/coulomb.cpp Outdated Show resolved Hide resolved
src/core/energy.cpp Outdated Show resolved Hide resolved
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.

I think you can remove some more includes so that we also have physical decoupling

src/core/electrostatics_magnetostatics/coulomb.hpp Outdated Show resolved Hide resolved
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

@jngrad jngrad added this to the Espresso 4.2 milestone Jun 24, 2020
@jngrad jngrad added the automerge Merge with kodiak label Jun 24, 2020
@kodiakhq kodiakhq bot merged commit 25ca96d into espressomd:python Jun 24, 2020
@jngrad jngrad deleted the pull-obs_scalar_pressure branch January 18, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants