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

add InputNlist into API doc #1009

Merged
merged 3 commits into from
Aug 23, 2021
Merged

add InputNlist into API doc #1009

merged 3 commits into from
Aug 23, 2021

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Aug 21, 2021

This struct is necessary for C++ APIs. Without document, no one can understand this struct...

@Yi-FanLi I believe you need it.

Preview below:

image

This struct is necessary for C++ APIs.
@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2021

Codecov Report

Merging #1009 (b6e5f8c) into devel (472d7c4) will increase coverage by 8.26%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel    #1009      +/-   ##
==========================================
+ Coverage   74.59%   82.86%   +8.26%     
==========================================
  Files          86      119      +33     
  Lines        6921    10110    +3189     
==========================================
+ Hits         5163     8378    +3215     
+ Misses       1758     1732      -26     
Impacted Files Coverage Δ
source/api_cc/include/DeepPot.h 66.66% <ø> (ø)
deepmd/entrypoints/compress.py 80.00% <0.00%> (-1.14%) ⬇️
deepmd/train/trainer.py 70.06% <0.00%> (-0.10%) ⬇️
deepmd/fit/wfc.py 95.31% <0.00%> (ø)
deepmd/fit/polar.py 48.18% <0.00%> (ø)
deepmd/fit/dipole.py 96.92% <0.00%> (ø)
deepmd/model/ener.py 92.59% <0.00%> (ø)
deepmd/utils/data.py 90.33% <0.00%> (ø)
deepmd/model/tensor.py 89.32% <0.00%> (ø)
deepmd/infer/deep_pot.py 68.98% <0.00%> (ø)
... and 53 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 472d7c4...b6e5f8c. Read the comment docs.

std::vector<int > numneigh;
/// Array stores the core region atom's neighbor index
Copy link
Member

Choose a reason for hiding this comment

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

this comment is for numneigh. Place it above std::vector<int > numneigh;?

The dsame issue for ilist and jlist

Copy link
Member Author

@njzjz njzjz Aug 22, 2021

Choose a reason for hiding this comment

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

In #968, I see @denghuilu add the same comment to InputNlist::firstneigh. Isn't it the same thing as NeighborListData::firstneigh? Did I understand wrongly?

Copy link
Member

Choose a reason for hiding this comment

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

I think jlist stores the same thing as firstneigh

Copy link
Member

Choose a reason for hiding this comment

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

@denghuilu @njzjz jlist stores the indexes of all the neighbors. firstneigh[i] stores the location of the first neighbor of i. So the neighbors of i are stored in jlist[firstneigh[i] : firstneigh[i] + numneigh[i]

@denghuilu Please check again you code you really use the neighbor list correctly....

Copy link
Member

@denghuilu denghuilu Aug 23, 2021

Choose a reason for hiding this comment

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

@amcadmus I think you are right, so the NeighborListData is used to construct the InputNlist. From my point of view, firstneigh is a two-dimensional array that stores neighbor atom's index, even if it only refers to a series of jlist locations. I'm using the InputNlist in the custom op, so I think it's fine.

@njzjz njzjz requested a review from denghuilu August 22, 2021 02:28
source/api_cc/include/common.h Show resolved Hide resolved
source/api_cc/include/common.h Outdated Show resolved Hide resolved
std::vector<int > numneigh;
/// Array stores the core region atom's neighbor index
Copy link
Member

Choose a reason for hiding this comment

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

I think jlist stores the same thing as firstneigh

@njzjz njzjz requested review from amcadmus and denghuilu August 23, 2021 05:32
@amcadmus amcadmus merged commit 29546c1 into deepmodeling:devel Aug 23, 2021
gzq942560379 pushed a commit to HPC-AI-Team/deepmd-kit that referenced this pull request Sep 2, 2021
* add `InputNlist` into API doc

This struct is necessary for C++ APIs.

* Apply suggestions from code review

Co-authored-by: Denghui Lu <[email protected]>

* update comment for `firstneigh`

Co-authored-by: Denghui Lu <[email protected]>
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.

4 participants