deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
http://abacus.ustc.edu.cn
GNU Lesser General Public License v3.0
174 stars 136 forks source link

Return value is 0 after calculation error #5459

Open Angel-Jia opened 2 weeks ago

Angel-Jia commented 2 weeks ago

Describe the bug

While using ABACUS for calculations, I noticed that when there is an error due to incorrect INPUT format, the program's return value is 0. However, if there’s an error due to an incorrect STRU file format, the return value is 1. Is this behavior expected?

Expected behavior

I believe the return value should be non-zero when an error occurs. Otherwise, when I use ABACUS in a script, the script continues running normally even if the program encounters an error, which leads to subsequent errors.

To Reproduce

Find a system that runs successfully, duplicate a parameter in the INPUT file, and execute the abacus command. Then, check the return value using echo $?, which shows 0. Using the same system, modify the STRU file (e.g., delete a line with atomic coordinate information) to induce an error. Then, check the return value using echo $?, which shows 1. Image

Environment

abacus 3.8.0

Additional Context

No response

Task list for Issue attackers (only for developers)