Refactor: drop source_cell dependency on serialization_cereal (cell->lcao) - #7612
Merged
mohanchen merged 1 commit intoJul 8, 2026
Merged
Conversation
…lcao) bcast_cell.cpp included source_lcao/module_ri/serialization_cereal.h only to call ModuleBase::bcast_data_cereal on three ABFS file-name lists, all of which are plain std::vector<std::string>. This created a reverse dependency from source_cell (L1) on source_lcao (L5). Replace the cereal-based broadcast with a small local bcast_string_vector helper built on Parallel_Common::bcast_int/bcast_string, mirroring how ucell.orbital_fn is already broadcast a few lines above. Behaviour is unchanged (broadcast from rank 0 to all ranks); the direct source_cell -> source_lcao include edge is removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mohanchen
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Part of an incremental effort to untangle the
source_*module dependency graph, so that lower layers (data structures) stop depending upward on higher layers (methods). See the module-layering discussion for the broader plan.source_cell(a foundational L1 data-structure module) currently has several reverse/lateral edges into higher layers. This PR removes one of them: the directsource_cell -> source_lcaoinclude edge.What this changes
source/source_cell/bcast_cell.cppincludedsource_lcao/module_ri/serialization_cereal.honly to callModuleBase::bcast_data_cerealon three ABFS file-name lists:exx_info.info_ri.files_abfsexx_info.info_opt_abfs.files_abfsexx_info.info_opt_abfs.files_jlesAll three are plain
std::vector<std::string>, so a full cereal (de)serialization round-trip is unnecessary here. This PR replaces those calls with a small localbcast_string_vectorhelper built onParallel_Common::bcast_int/bcast_string— mirroring howucell.orbital_fnis already broadcast a few lines above.Behaviour
Unchanged: still a broadcast from rank 0 to all ranks. Only the transport mechanism (cereal binary archive over
MPI_CHARvs. per-stringbcast_string) differs; the resulting data on every rank is identical.Verification
-fsyntax-onlypasses in two configurations:__EXX)-D__EXXadded(The only warning emitted is a pre-existing one in
source_base/math_erf_complex.h, unrelated to this change.)Scope note
This removes the direct
serialization_cereal.hinclude.bcast_cell.cppstill transitively reachessource_lcao/module_rithroughexx_info.h(which itself pulls inconv_coulomb_pot_k.h); decoupling that is a separate, larger change and is intentionally out of scope here.