You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
abacus_fixer
committed
Replace Parallel_Reduce with ParaKmeshWorld in occupy, fix ParaWorld ODR
Migrate occupy.cpp and elecstate_tools.cpp from the legacy
Parallel_Reduce::reduce_double_allpool / reduce_max / reduce_min
to the new module_parallel ParaKmeshWorld API:
- Add reduce_across_pools / reduce_max_across_pools /
reduce_min_across_pools to ParaKmeshWorld (Allreduce on the
inter-pool communicator KP_WORLD, no-op when kpar==1).
- Add a reduce-only ParaKmeshWorld() default constructor and a
no-arg make_kmesh_world() bridge overload for call sites like
calEBand that have no k-point information to pass.
- occupy.h/cpp: replace npool parameter with const ParaKmeshWorld&,
remove #include parallel_reduce.h, remove GlobalV::NPROC_IN_POOL.
- elecstate_tools.cpp: calEBand and calculate_weights now construct
kmesh via the bridge; delete the old npool/bndpar local variable.
Fix a latent ODR violation in ParaWorld that caused a free() crash
in test_occupy: the MPI_Comm comm_ member only existed under
#ifdef __MPI, so the class layout differed between translation units
compiled with and without __MPI. Replace with a void* opaque handle
(memcpy round-trip, layout-identical in both builds).
0 commit comments