-
Notifications
You must be signed in to change notification settings - Fork 21
[GSPH] migrate solver storage to solvergraph architecture #1573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[GSPH] migrate solver storage to solvergraph architecture #1573
Conversation
Integrate GSPH module with the solvergraph framework for explicit data dependency management: - Add custom edge types for GSPH-specific data structures: - GhostHandlerEdge: wraps GSPHGhostHandler - GhostCacheEdge: wraps ghost interface cache - SerialPatchTreeEdge: wraps SerialPatchTree - MergedPatchDataEdge: wraps DistributedData<PatchDataLayer> - Update SolverStorage to use solvergraph edges for: - Ghost handling infrastructure - Merged position and patchdata - Computed fields (density, pressure, soundspeed, gradients) - Neighbor cache (reused from SPH) - Update Solver methods to use solvergraph access pattern: shambase::get_check_ref(storage.edge).get/set/free_alloc() - Keep old_axyz/old_duint as Component<ComputeField<...>> for predictor-corrector integration (matches SPH pattern)
|
Thanks @Guo-astro for opening this PR! You can do multiple things directly here: Once the workflow completes a message will appear displaying informations related to the run. Also the PR gets automatically reviewed by gemini, you can: |
Summary of ChangesHello @Guo-astro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the GSPH simulation module by integrating its core data management with the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request successfully migrates the GSPH module's solver storage to the solvergraph architecture. This involves introducing custom edge types for GSPH-specific data structures and updating the Solver and SolverStorage classes to leverage these new solvergraph patterns. The changes are well-implemented, ensuring proper data dependency management and memory handling through the free_alloc() methods on the new edge types. The re-organization of includes and Doxygen comments also improves clarity and maintainability. Additionally, a suggestion has been made to improve code readability by introducing a local reference for frequently accessed objects.
src/shammodels/gsph/src/Solver.cpp
Outdated
| const u32 ihpart_ghost | ||
| = storage.xyzh_ghost_layout->template get_field_idx<Tscal>(gsph::names::common::hpart); | ||
|
|
||
| auto &merged_xyzh = shambase::get_check_ref(storage.merged_xyzh); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repeated use of shambase::get_check_ref(storage.merged_xyzh) can make the code verbose. Consider introducing a local reference to the MergedPatchDataEdge to improve readability, especially when accessing its members multiple times within a function scope.
auto &merged_xyzh_edge = shambase::get_check_ref(storage.merged_xyzh);
// Set element counts
shambase::get_check_ref(storage.part_counts).indexes = merged_xyzh_edge.get_data().template map<u32>(
tdavidcl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do agree that migrating the ghosts to solvergraph while we wait for the native solvergraph variant is a good option. I support the overall idea of the PR.
On the diff side, this PR tries to achieve too much at once + is cluttered with many doc changes which make the diff quite hard to read for any review.
Could you do 1 PR = 1 Object migrated to Sgraph ?
(you can keep that PR opened as a stagging one to track what is left to migrate)
Side note there is already SerialPatchTreeRef available as a solvergraph edge. Essentially you build the Sptree and give it as a ref. It is done in the ramses solver if you want examples.
Migrate only the ghost_handler to solvergraph architecture, keeping other objects (serial_patch_tree, ghost_patch_cache, merged_xyzh, merged_patchdata_ghost) as Component<> storage. Changes: - Add GhostHandlerEdge.hpp for ghost handler solvergraph edge - Update SolverStorage.hpp with solver_graph and ghost_handler edge - Update Solver.cpp to register and use ghost_handler via solvergraph - Fix license headers to use correct accented characters Addresses review feedback requesting smaller, focused PRs.
|
Looks much cleaner, I'll try to review it tomorrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestion to remove clutter from the diff. AI is cool and all but i don't know why all models are so obsessed with spitting out 100 line of documentation changes that are not required
src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp
Outdated
Show resolved
Hide resolved
src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp
Outdated
Show resolved
Hide resolved
src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp
Outdated
Show resolved
Hide resolved
src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp
Outdated
Show resolved
Hide resolved
src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp
Outdated
Show resolved
Hide resolved
src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp
Outdated
Show resolved
Hide resolved
src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp
Outdated
Show resolved
Hide resolved
src/shammodels/gsph/include/shammodels/gsph/modules/SolverStorage.hpp
Outdated
Show resolved
Hide resolved
src/shammodels/gsph/include/shammodels/gsph/solvergraph/GhostHandlerEdge.hpp
Outdated
Show resolved
Hide resolved
Workflow reportworkflow report corresponding to commit 48c20e9 Light CI is enabled. This will only run the basic tests and not the full tests. Pre-commit check reportPre-commit check: ✅ Test pipeline can run. Doxygen diff with
|
|
Anything I would be better to fix? |
Summary
Migrate the ghost_handler to solvergraph architecture for explicit data dependency management.
Scope reduced per maintainer review: This PR now migrates only ONE object (ghost_handler) to solvergraph, keeping other objects as Component<> storage for separate PRs.
Changes:
GhostHandlerEdge.hppfor GSPH-specific ghost handler solvergraph edgeSolverStorageto includesolver_graphandghost_handleredgeSolvermethods to use solvergraph access pattern for ghost_handlerserial_patch_tree,ghost_patch_cache,merged_xyzh,merged_patchdata_ghostas Component<> (to be migrated in separate PRs)Note: The existing
SerialPatchTreeRefEdgeinshamrock/solvergraph/will be used for serial_patch_tree in a follow-up PR per maintainer suggestion.Test plan