Tags: deepmodeling/abacus-develop
Tags
Refactor/merge openmp (#7446) * optimize: add OpenMP parallelization to MD per-atom loops Add #pragma omp parallel for to major per-atom loops in MD module, enabling multi-threaded execution for NEP/DPMD potentials and thermostat/integrator operations. Scope (23 files): - source/source_md/: md_base, md_func, fire, msst, nhchain, verlet, run_md, md_statistics.h - source/source_esolver/: esolver_nep, esolver_dp - source/source_md/test/: 7 unit tests + md_test_fixture.h Strategy: schedule(static) with if(nat>=256), reduction clauses, atomic/critical for shared accumulators. LJ esolver excluded (upstream refactored to UnitCellLite API). Rebased onto deepmodeling/develop. Co-Authored-By: Claude <noreply@anthropic.com> * Resolve merge conflicts and fix Verlet CSVR test# Please enter the commit message for your changes. Lines starting Resolve merge conflicts and fix Verlet CSVR test# * fix(md): restore CSVR thermostat after conflict resolution --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Mohan Chen <mohanchen@pku.edu.cn>
Update source_cell module and agent governance (#7625) * resolve the wrong dependency between klist and berryphase * remove useless things * replace ucell.lc with vector<int> * change the name of a variable * remove dependency of PARAM * move test of magnetism * update magnetism * update agent governance check * update agent governance check * refactor(cell): centralize Magnetism::start_mag initialization in setup() and read_atom_positions() ### Why Previously `Magnetism::start_mag` had no well-defined single owner for memory allocation. Even though `UnitCell::setup_cell()` happened to resize it, any caller that invoked `unitcell::read_atom_positions()` directly (as most unit tests did) was required to *externally* call `ucell->magnet.start_mag.resize(ucell->ntype)` first. This undocumented implicit contract produced dozens of scattered, copy-paste pre-conditions throughout the test harness and made the API easy to misuse. ### What 1. Proactive initialization in `UnitCell::setup()` - As soon as `ntype` is set, resize `start_mag` to `ntype_in` with value 0.0. - This covers every test helper that already goes through `setup()` so the callers no longer need to manually size and zero-initialize the vector. 2. Defensive auto-resize inside `unitcell::read_atom_positions()` - Before any access to `start_mag[it]`, check that its size matches `ucell.ntype` and resize if needed. - This guards the remaining code paths that set `ntype` by hand and guarantees the consumer owns its pre-conditions. 3. Removed the now-redundant explicit resize in `UnitCell::setup_cell()`. Kept the `assert(ntype > 0)` validity check; renumbered the following step comment from `(2)` to `(1)`. 4. Cleaned up ~20+ copies of the redundant preparatory lines across the test suites: - 7 `prepare_unitcell.h` helpers (source_cell, source_cell/module_neighbor, source_estate, source_estate/module_dm, source_lcao/module_hcontainer, source_io, source_io/test_serial): removed `ucell->magnet.start_mag.resize(ntype)` and the loop body `start_mag[it] = 0.0`. - Unit tests `unitcell_test.cpp`, `unitcell_test_pw.cpp` and `unitcell_test_setupcell.cpp`: removed the now-unnecessary "mandatory preliminaries" resize block before `read_atom_positions`. ### Files touched (12) source/source_cell/unitcell.cpp source/source_cell/read_atoms.cpp source/source_cell/module_neighbor/test/prepare_unitcell.h source/source_cell/test/prepare_unitcell.h source/source_cell/test/unitcell_test.cpp source/source_cell/test/unitcell_test_setupcell.cpp source/source_cell/test_pw/unitcell_test_pw.cpp source/source_estate/test/prepare_unitcell.h source/source_estate/module_dm/test/prepare_unitcell.h source/source_io/test/prepare_unitcell.h source/source_io/test_serial/prepare_unitcell.h source/source_lcao/module_hcontainer/test/prepare_unitcell.h Behavior change: none; resize is idempotent and every removed site defaulted to the same zero value the new helpers already use. * fix bugs --------- Co-authored-by: abacus_fixer <mohanchen@pku.eud.cn>
feat(gint): enable mixed-precision (fp32/fp64) support for GPU path (#… …7207) Template the GPU grid integration kernels, batch GEMM operations, and PhiOperatorGpu class to support both single and double precision. - Template phi_operator_gpu and phi_operator_kernel for fp32/fp64 - Template dgemm_vbatch and gemm kernels for precision dispatch - Update gint_vl_gpu, gint_rho_gpu to use templated GPU operators - Propagate precision template through fvl, tau, metagga GPU paths - Remove GPU restriction for gint_precision=single/mix in input validation
PreviousNext