Repository navigation
feat: write single-point LCAO DOS and PDOS in NumPy format with out_dos 2 - #8332
Stardust0831 wants to merge 16 commits into
Conversation
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
Four nonblocking coverage and maintenance suggestions below. Static source review only; no builds, tests, NumPy interoperability or MPI/CI checks were run.
|
Overall, this PR is well designed and backward compatible, and I found no blocking correctness issues.
|
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
PDOS validation failures can be lost by the integration runner.
Static source review of 3f17fd770af1: no builds, product tests, runtime reproduction or CI verification were performed.
|
Thanks for the review, Daniel! We added an |
DanielZhao0432
left a comment
There was a problem hiding this comment.
LGTM. The NPY writer/reader changes, spin-polarized Autotest, and validator failure-propagation regression cover the requested behavior, and all CI checks pass. I found no remaining code issues. Please resolve the current merge conflict with develop before merging.
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
One non-blocking call-site cleanup remains in the new total-DOS path.
Static review at c31189abd against 153ad629, with target compatibility checked through c46ae1e. Governance returned warnings without blockers; the whitespace check passed. No builds or product tests were run, and runtime/CI results remain unverified.
|
Thanks for your work on this PR! Could we store both spin channels in one |
|
Thanks for the suggestion, Daniel! Both spin channels are now stored in a single |
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
Static review at 6fc82ea7fd53; no builds or tests were run.
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
Both reported follow-ups are addressed in source at f885ee79f: the focused native DOS capture test and the named exception mask.
Static review only; no builds or tests were run, and CI was not verified.
LCAO DOS output
Set
out_dos 2in a single-point LCAO KSDFT SCF or NSCF calculation to write both total and projected DOS as NumPy arrays. The defaultout_dos 0disables output, andout_dos 1selects the existing text output. Earlier versions used mode 2 to request text PDOS and subsequently rejected that value. The INPUT metadata and user guide now document the new meaning.dos.npy. The binary64 energy field has shape(npoints,). The raw histogram, integrated histogram, smeared DOS and integrated smeared DOS each have shape(npoints, 2)fornspin=2(spin up, then spin down), or(npoints, 1)fornspin=1and4. The units match the text columns.pdos.npy. Each row holds the atom index, species, angular momentum, signed magnetic quantum number, spin mode, energy grid and spin-resolved spectrum. The text and NumPy writers share the zeta and spinor sums and the small-value threshold.ENABLE_CNPY=OFF. Rank zero writes each file and propagates binary I/O failures to all ranks. The standard-library header dependencies implement the NumPy header, and the projection interfaces return their reduced matrices in a vector.abacus-plotaccepts these files throughtdosfileandpdosfile. A directory containing both text and NumPy output for the same quantity requires an explicit file path. Both formats also work directly with the existing total and projected plotting commands.Verification
-DENABLE_CNPY=OFF.ctest --test-dir build -R '^MODULE_DOS_(cal_dos|write_dos_pw|write_pdos_text|pdos_npy_roundtrip)$'passed all four targets.GTEST_FILTER=InputParaTest.OutDosNpy ctest --test-dir build -R '^MODULE_IO_input_test_para(_4)?$'passed on one and four ranks.abacus -h out_dosandabacus --check-inputwere exercised on the Fe inputs.bash ../integrate/Autotest.sh -a "$abacus" -o 1 -n 2 -r '^scf_out_dos_spin2$' -f CASES_CPU.txtfor text, NumPy and NumPy without_app_flag 2. Both formats passed the Fe Autotest with-f CASES_GPU.txton V100. Removing or truncating eitherdos.npyorpdos.npymade Autotest return 1. Restoring the files returned 0. A two-rank run with either target made unwritable exited with status 1 and identified the path.5.0e-7. Four-rank comparisons also passed on Gamma-point H2O, GaAs with SOC and Gamma-point Si256 NSCF. A V100 diagnostic build that called both writers on the same SCF data also agreed within5.0e-7for TDOS and PDOS. Separate GPU SCF runs showed variations in individual orbital projections even with the same output format.PYTHONPATH=tools/02_postprocessing/plot-tools python3 -m unittest discover -s tools/02_postprocessing/plot-tools/tests -qpassed all 14 tests.python3 -m unittest discover -s tests/integrate/validation_tools -p test_props_basic.pypassed all five. On the CPU Fe files, the installedabacus-plot -dandabacus-plot -d -preproduced the text curves for raw total DOS, smeared total DOS and orbital-resolved projections. The largest differences were 0,4.98e-7and2.25e-6, respectively, within six-decimal text rounding including orbital sums.Si256 PDOS timings
Measurements from
0b14b35, with four MPI ranks and one OpenMP thread per rank. Medians cover four timed runs per format after a warm-up. The writer time includes stream close. The full PDOS interval includes orbital projection and MPI reduction. Sizes are for PDOS in decimal MB.