Describe the bug
When KPAR > NPROC, ABACUS crashes with "Number of processes must be greater than the number of groups". A KPAR auto-adjustment exists in read_input_item_system.cpp but is guarded by para.input.device == "gpu", which is never true at the time the callback runs — because device's own reset_value callback (which resolves auto→gpu) executes after kpar's callback due to registration order.
Affected tests: 007, 026, 052, 063, 087, 088, 089, scf_out_chg_tau
026:
Error: Number of processes (1) must be greater than the number of groups (2).
---------------------------------------------------------
!NOTICE!
---------------------------------------------------------
Number of processes must be greater than the number of groups.
CHECK IN FILE : OUT.autotest/warning.log
For detailed manual of ABACUS, please see the website
https://abacus.deepmodeling.com
For any questions, propose issues on the website
https://github.com/deepmodeling/abacus-develop/issues
---------------------------------------------------------
!NOTICE!
---------------------------------------------------------
Expected behavior
ABACUS should auto-adjust KPAR <= NPROC, instead of crashing with "Number of processes must be greater than the number of groups".
To Reproduce
Case A: Clean rebuild from scratch
cmake -B build -DUSE_CUDA=1 -DCUDA_SEPARABLE_COMPILATION=OFF \
-DCMAKE_CUDA_FLAGS="--static-global-template-stub=false"
cd build && make -j`nproc`
cd tests/01_PW/026_PW_KPAR/ && /build/abacus_basic_gpu
Case B: Reuse precompiled binary (skip rebuild)
cd build && make -j$(nproc) abacus_basic_gpu
cd tests/01_PW/026_PW_KPAR/ && /build/abacus_basic_gpu
Environment
- ABACUS v3.11.0-beta.6 (GPU build with
-DUSE_CUDA=ON)
- NVIDIA RTX 4060 Laptop GPU, CUDA 13.1
- Intel(R) Core(TM) i9-14900HX
Additional Context
No response
Task list for Issue attackers (only for developers)
Describe the bug
When KPAR > NPROC, ABACUS crashes with "Number of processes must be greater than the number of groups". A KPAR auto-adjustment exists in
read_input_item_system.cppbut is guarded by para.input.device == "gpu", which is never true at the time the callback runs — because device's own reset_value callback (which resolves auto→gpu) executes after kpar's callback due to registration order.Affected tests: 007, 026, 052, 063, 087, 088, 089, scf_out_chg_tau
026:
Error: Number of processes (1) must be greater than the number of groups (2). --------------------------------------------------------- !NOTICE! --------------------------------------------------------- Number of processes must be greater than the number of groups. CHECK IN FILE : OUT.autotest/warning.log For detailed manual of ABACUS, please see the website https://abacus.deepmodeling.com For any questions, propose issues on the website https://github.com/deepmodeling/abacus-develop/issues --------------------------------------------------------- !NOTICE! ---------------------------------------------------------Expected behavior
ABACUS should auto-adjust KPAR <= NPROC, instead of crashing with "Number of processes must be greater than the number of groups".
To Reproduce
Case A: Clean rebuild from scratch
Case B: Reuse precompiled binary (skip rebuild)
Environment
-DUSE_CUDA=ON)Additional Context
No response
Task list for Issue attackers (only for developers)