-
Notifications
You must be signed in to change notification settings - Fork 32
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
Making static gravity more user friendly with custom gravity field flags #340
Conversation
…tom gravity. it exits in that case but i dont think its thread safe.
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.
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,
^
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? |
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. |
FYI, I've pulled in the clang-17 PR, so this one should be good to go once it's updated. |
…-static_grav-testing
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.
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.