Skip to content
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

Shuffling contents of Grid3D::Update_Hydro_Grid #352

Merged
merged 5 commits into from
Nov 6, 2023

Conversation

mabruzzo
Copy link
Collaborator

@mabruzzo mabruzzo commented Nov 1, 2023

This PR shifts some of the contents of from Grid3D::Update_Grid into Grid3D::Update_Hydro_Grid.

Overall, I think that this is a useful organizational change. I also need to do something like this on a local branch and it would be convenient to get this merged upstream as soon as we can since this modification seems like it could easily introduce lots of merge-conflicts.

I would recommend that the reviewer review the changes commit-by-commit:

  1. The 1st commit literally moves everything after the Hydro-Integrator execution out of Grid3D::Update_Grid into the body of Grid3D::Update_Hydro_Grid (after the spot where it calls Grid3D::Update_Grid). I think this should be very non-controversial.

  2. The 2nd commit renames Grid3D::Update_Grid to Grid3D::Execute_Hydro_Integrator, which is a more descriptive & self-explanatory name, (I'm obviously happy to name it something else).

  3. The 3rd commit moves Slow-Cell-Averaging & timestep-calculation to after the invocation of Grackle. They were already performed after other forms of cooling/chemistry; this is now more consistent and "correct". This is the only structural change to the control flow.

    • A side effect is that slow-cell-averaging & timestep-calculation are no longer part of the Hydro timing-region (this includes the Hydro_Integrator timing-region). This is addressed in the next commit
  4. The 4th commit includes slow-cell-averaging & timestep-calculation back inside of the Hydro timing-region. The timing-regions are now consistent with the current version of dev.

    • I needed a somewhat hacky solution to do this - a more robust solution involves modifying the timing-functionality. I think this may be a little beyond the scope of this PR (I do have some ideas for refactoring this)
    • It also consolidates 4 ifdef regions down to 2.

To summarize: commit 1 is the most important change & commit 3 makes the only change to the control-flow.

If you take issue with any of the changes, I'm happy to update the PR to just include the first commit (or first 2 commits)

mabruzzo and others added 5 commits November 1, 2023 00:15
I think this is a very sensible organizational change. Plus, this
is very helpful for some stuff I'm doing on a local branch (it
would to upstream this sooner rather than later to limit merge
conflicts)
1. consolidate the ``ifdef CHEMISTRY_GPU`` and ``ifdef COOLING_GRACKLE`` regions

2. Adjust Timer calls to match profiling from before last commit. This involves a somewhat ugly hack related to timing Grackle (it seems unavoidable without modifying the timing_functions - I actually have some longer term ideas to refactor some of that code).
@evaneschneider
Copy link
Collaborator

This all looks good to me. In practice, I wouldn't worry too much about the timing - we can just add another timer for the timestep calculation, which would be more intuitive, but I appreciate you keeping it consistent for now while we are still running scaling tests.

@evaneschneider evaneschneider merged commit 468ecfc into cholla-hydro:dev Nov 6, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants