Commit 3a96cd7
abacus_fixer
Test: add DeltaSpin integration tests with force/stress (PW + LCAO, nspin=2/4)
Add four fast, reproducible DeltaSpin integration cases to cover the
spin-constrained (deltaspin) code paths ahead of the planned SpinConstrain
refactor. All cases compute force and stress in addition to total energy.
New cases:
- tests/01_PW/scf_deltaspin2: PW basis, collinear (nspin=2), Z magnetization
constraint, iterative lambda optimization to target. kpar=2, pw_seed=1.
- tests/01_PW/scf_deltaspin4: PW basis, noncollinear (nspin=4), Z-only
constraint (verifies no unphysical XY components). kpar=2, pw_seed=1.
- tests/03_NAO_multik/scf_deltaspin2: LCAO basis, collinear (nspin=2),
Z constraint, Gamma k-point. Single MPI process.
- tests/03_NAO_multik/scf_deltaspin4: LCAO basis, noncollinear (nspin=4),
Z-only constraint, 2x2x2 Monkhorst-Pack. Exercises the LCAO lambda loop.
Each case carries INPUT/KPT/STRU/result.ref/README. result.ref records
etotref/etotperatomref plus totalforceref/totalstressref (sum-of-absolutes,
matching tests/integrate/tools/catch_properties.sh). Cases were each run
three times (OMP_NUM_THREADS=1) to confirm bit-identical etot before the
reference was written.
Registration:
- tests/01_PW/CASES_CPU.txt and CASES_GPU.txt: scf_deltaspin2/4 (PW runs on GPU)
- tests/03_NAO_multik/CASES_CPU.txt: scf_deltaspin2/4
Note: an LCAO gamma_only=1 DeltaSpin variant was evaluated for
tests/02_NAO_Gamma but is excluded because it hits a pre-existing latent bug
(SpinConstrain<double>::cal_mi_lcao is an empty stub, so print_Mi reads an
empty Mi_ vector and segfaults); that bug is out of scope for this change and
should be fixed separately. The LCAO coverage here uses multik instead.
Verification: abacus_max_para v3.11.0-beta8 (build_max_para_test, make -j 30);
each of the four cases run 3x with bit-identical FINAL_ETOT; force/stress
references extracted from the same runs.1 parent 370e024 commit 3a96cd7
23 files changed
Lines changed: 260 additions & 0 deletions
File tree
- tests
- 01_PW
- scf_deltaspin2
- scf_deltaspin4
- 03_NAO_multik
- scf_deltaspin2
- scf_deltaspin4
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments