Skip to content

lmp: refactor ixnode#2971

Merged
wanghan-iapcm merged 2 commits into
deepmodeling:develfrom
njzjz:refactor-ixnode
Nov 7, 2023
Merged

lmp: refactor ixnode#2971
wanghan-iapcm merged 2 commits into
deepmodeling:develfrom
njzjz:refactor-ixnode

Conversation

@njzjz

@njzjz njzjz commented Nov 1, 2023

Copy link
Copy Markdown
Member

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 <jinzhe.zeng@rutgers.edu>
@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
@codecov

codecov Bot commented Nov 1, 2023

Copy link
Copy Markdown

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.

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

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

njzjz commented Nov 2, 2023

Copy link
Copy Markdown
Member Author

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

Got it...

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz

njzjz commented Nov 2, 2023

Copy link
Copy Markdown
Member Author

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
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