Commit 9a33f39
abacus_fixer
fix(test_rhog_io): keep __MPI per-target so the MPI test initializes MPI
The test aborted with "MPI_Comm_rank() called before MPI_INIT" because the
directory-level abacus_disable_feature_definitions(__MPI) in
source_estate/test stripped __MPI from every target there. With __MPI gone,
the test's main() never called MPI_Init, while the linked base/planewave
libraries still issue real MPI calls.
Add a target-level escape hatch: a new ABACUS_KEPT_FEATURE_DEFINITIONS
target property (exposed as AddTest's KEEP_FEATURE_DEFINITIONS) lets a
single target keep definitions its directory disables. Use it for this
test, link planewave instead of planewave_serial, and copy the support/
data at configure time (install() is skipped by plain make+ctest).
Also fix test bugs hidden while __MPI was stripped: drop const from kpar
(passed by reference to divide_pools), call setup_pw_basis() in the three
tests that need a valid grid, and set npwtot=1000 in InconsistentGammaOnly
to trigger the expected "planewaves not used" warning.
Verified: make MODULE_ESTATE_test_rhog_io && ctest -R
MODULE_ESTATE_test_rhog_io -> 10/10 passed.1 parent 3b6ad5e commit 9a33f39
4 files changed
Lines changed: 38 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
420 | 429 | | |
421 | 430 | | |
422 | 431 | | |
| |||
448 | 457 | | |
449 | 458 | | |
450 | 459 | | |
| 460 | + | |
451 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
452 | 466 | | |
453 | 467 | | |
454 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
118 | | - | |
| 121 | + | |
119 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
120 | 127 | | |
121 | 128 | | |
122 | 129 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
| |||
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| |||
383 | 389 | | |
384 | 390 | | |
385 | 391 | | |
386 | | - | |
| 392 | + | |
387 | 393 | | |
388 | 394 | | |
389 | 395 | | |
| |||
0 commit comments