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

Making static gravity more user friendly with custom gravity field flags #340

Merged
merged 16 commits into from
Oct 27, 2023

Conversation

evazlimen
Copy link
Collaborator

I have separated out the various hard coded static gravity fields with a switch statement that is determined by parameter file input. This way a user doesn't have to comment and uncomment things in the source code just to run a test.

  • added the flag "custom_grav". Used to select the appropriate custom gravity field in static_grav.h. Goes in the parameter file.
  • added a switch statment in static_grav.h to use the custom_grav flag.
    This is set up for the simple integrator, I wasn't sure if it was appropriate to also do so for VL and also wanted to be as minimally invasive as possible!
    Still have to do some cleaning up but wanted to see if I should be doing this differently.

Copy link
Collaborator

@bcaddy bcaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, anything to remove the need to comment/uncomment code for proper functionality.

I know there's some other stuff that is initialized in parse_params. I moved most of those initializations in PR #334.

I'm not entirely sure what's causing some of the HIP builds to fail. Do you have access to an AMD system to test this on? If not I can try to hunt down the issue on one of the AMD systems I have access to.

Edit: I found the issue.

hipcc -g -O3 -std=c++17 -fPIE -DCUDA -DMPI_CHOLLA -DPRECISION=2 -DPPMC -DHLLD -DMHD -DVL -DDENSITY_FLOOR -DTEMPERATURE_FLOOR -DCPU_TIME -DOUTPUT -DHDF5  -DO_HIP -DGIT_HASH='"4725f356813745761925289ad2d7e90419fc4569"' -DMACRO_FLAGS='"-DCUDA -DMPI_CHOLLA -DPRECISION=2 -DPPMC -DHLLD -DMHD -DVL -DDENSITY_FLOOR -DTEMPERATURE_FLOOR -DCPU_TIME -DOUTPUT -DHDF5  -DO_HIP -DGIT_HASH='"4725f356813745761925289ad2d7e90419fc4569"'"' -Isrc -I/usr/lib/x86_64-linux-gnu/hdf5/serial/include -I/usr/lib/x86_64-linux-gnu/openmpi/include -c src/integrators/VL_2D_cuda.cu -o src/integrators/VL_2D_cuda.o
src/integrators/VL_3D_cuda.cu:303:3: error: too few arguments to function call, expected 29, have 28
  hipLaunchKernelGGL(Update_Conserved_Variables_3D, dim1dGrid, dim1dBlock, 0, 0, dev_conserved, Q_Lx, Q_Rx, Q_Ly, Q_Ry,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/rocm-5.2.3/include/hip/amd_detail/amd_hip_runtime.h:251:46: note: expanded from macro 'hipLaunchKernelGGL'
#define hipLaunchKernelGGL(kernelName, ...)  hipLaunchKernelGGLInternal((kernelName), __VA_ARGS__)
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/rocm-5.2.3/include/hip/amd_detail/amd_hip_runtime.h:248:89: note: expanded from macro 'hipLaunchKernelGGLInternal'
        kernelName<<<(numBlocks), (numThreads), (memPerBlock), (streamId)>>>(__VA_ARGS__);         \
        ~~~~~~~~~~                                                                      ^
src/integrators/../hydro/hydro_cuda.h:18:17: note: 'Update_Conserved_Variables_3D' declared here
__global__ void Update_Conserved_Variables_3D(Real *dev_conserved, Real *Q_Lx, Real *Q_Rx, Real *Q_Ly, Real *Q_Ry,
                ^

src/global/global.cpp Outdated Show resolved Hide resolved
src/global/global.h Outdated Show resolved Hide resolved
@evazlimen
Copy link
Collaborator Author

evazlimen commented Sep 22, 2023

I changed the initialization of custom_grav and set it up for the VL integrator. I formatted with clang-17, not sure if I just have to wait for PR #330 to go through for the formatting check to pass?

@evaneschneider
Copy link
Collaborator

Awesome, yep -- we're doing a hack day over here so have a few PRs in the queue waiting on 310 and rebasing, but once #330 330 goes through the clang 17 formatting should work.

@evaneschneider
Copy link
Collaborator

FYI, I've pulled in the clang-17 PR, so this one should be good to go once it's updated.

@evazlimen evazlimen marked this pull request as ready for review October 22, 2023 23:55
@evaneschneider evaneschneider merged commit 36becaa into cholla-hydro:dev Oct 27, 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.

3 participants