-
Notifications
You must be signed in to change notification settings - Fork 525
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
fix(cc): fix message passing when nloc is 0 #4021
Conversation
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
This reverts commit 546c798.
This reverts commit 51a94b6.
This reverts commit 0a0870d.
This reverts commit e264828.
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
This reverts commit 3ac3ce4.
This reverts commit 767ea82.
This reverts commit 6e82ca4.
WalkthroughWalkthroughThe updates enhance the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
source/api_cc/src/DeepPotPT.cc (1)
Verify behavior for zero atoms or local atoms.
The
compute
method does not explicitly handle cases wherenatoms
ornloc
are zero. This could lead to potential issues during runtime. Please review and ensure that scenarios with zero atoms or local atoms are handled correctly.
- File:
source/api_cc/src/DeepPotPT.cc
- Lines: 38-49
Analysis chain
Line range hint
110-110
:
Verify behavior for zero atoms or local atoms.The removal of blocks handling cases where
nloc
ornatoms
are zero simplifies the control flow but may affect the method's behavior in edge cases. Ensure that the method handles scenarios with zero atoms or local atoms correctly.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the behavior of the `compute` method for zero atoms or local atoms. # Test: Search for the method usage and check for edge cases handling. rg --type cpp -A 10 $'DeepPotPT::compute'Length of output: 10872
Script:
#!/bin/bash # Description: Retrieve the complete implementation of the `compute` method to verify handling of zero atoms or local atoms. # Search for the complete implementation of the `compute` method. ast-grep --lang cpp --pattern $'void DeepPotPT::compute($_, $$$) { $$$ }'Length of output: 76
Script:
#!/bin/bash # Description: Retrieve the complete implementation of the `compute` method to verify handling of zero atoms or local atoms. # Search for the `compute` method definition and include 50 context lines to capture the full implementation. rg --type cpp -A 50 'void DeepPotPT::compute'Length of output: 20194
Script:
#!/bin/bash # Description: Retrieve the complete implementation of the `compute` method to verify handling of zero atoms or local atoms. # Search for the `compute` method definition and include 100 context lines to capture the full implementation. rg --type cpp -A 100 'void DeepPotPT::compute'Length of output: 27505
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #4021 +/- ##
==========================================
+ Coverage 82.92% 82.94% +0.01%
==========================================
Files 522 522
Lines 51010 50991 -19
Branches 3023 3022 -1
==========================================
- Hits 42301 42294 -7
+ Misses 7767 7757 -10
+ Partials 942 940 -2 ☔ View full report in Codecov by Sentry. |
Fix deepmodeling#3732. Removes the special codes for `nloc==0` which has been supported by deepmodeling#4005. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved robustness in tensor handling when inputs are empty. - Enhanced test coverage for parameters in the `test_pair_deepmd_si` and `test_pair_deepmd_mpi` functions, testing scenarios with and without balance arguments. - **Bug Fixes** - Adjusted control flow in the `compute` method to simplify handling of zero atoms or local atoms. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Fix #3732. Removes the special codes for
nloc==0
which has been supported by #4005.Summary by CodeRabbit
test_pair_deepmd_si
andtest_pair_deepmd_mpi
functions, testing scenarios with and without balance arguments.compute
method to simplify handling of zero atoms or local atoms.