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

lmp: refactor ixnode #2971

Merged
merged 2 commits into from
Nov 7, 2023
Merged

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Nov 1, 2023

The current implementation used a complex method to ensure ixnode (int) within [0, nxnodes-1], but why not use mod ("%") to get the same behavior?

The current implementation used a complex method to ensute ixnode within [0, nxnodes), but why not using mod ("%") to get the same behavior.

Signed-off-by: Jinzhe Zeng <[email protected]>
@njzjz njzjz requested a review from wanghan-iapcm November 1, 2023 23:48
@njzjz njzjz marked this pull request as ready for review November 1, 2023 23:48
@github-actions github-actions bot added the LAMMPS label Nov 1, 2023
@njzjz njzjz changed the title refactor ixnode lmp: refactor ixnode Nov 1, 2023
Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (1529e72) 75.23% compared to head (d60fc2a) 75.26%.
Report is 1 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #2971      +/-   ##
==========================================
+ Coverage   75.23%   75.26%   +0.02%     
==========================================
  Files         245      245              
  Lines       24678    24669       -9     
  Branches     1599     1593       -6     
==========================================
  Hits        18566    18566              
+ Misses       5176     5167       -9     
  Partials      936      936              
Files Coverage Δ
source/lmp/pair_deepmd.cpp 52.59% <0.00%> (+0.52%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@wanghan-iapcm wanghan-iapcm left a comment

Choose a reason for hiding this comment

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

different from python, in c++, -1%10 == -1

@njzjz njzjz marked this pull request as draft November 2, 2023 01:36
@njzjz
Copy link
Member Author

njzjz commented Nov 2, 2023

different from python, in c++, -1%10 == -1

Got it...

Signed-off-by: Jinzhe Zeng <[email protected]>
@njzjz
Copy link
Member Author

njzjz commented Nov 2, 2023

different from python, in c++, -1%10 == -1

I follow the resolution here: https://stackoverflow.com/a/1907585/9567349

@njzjz njzjz marked this pull request as ready for review November 2, 2023 01:44
@njzjz njzjz requested a review from wanghan-iapcm November 2, 2023 01:44
@wanghan-iapcm wanghan-iapcm merged commit a40dcaa into deepmodeling:devel Nov 7, 2023
39 checks passed
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.

2 participants