Skip to content

Debugging

Tim Younkin edited this page Apr 26, 2024 · 1 revision

Debugging GITR with cuda-gdb:

To debug GITR on NVIDIA devices with CUDA turned on, you can use cuda-gdb.

  1. Set the CMAKE_BUILD_TYPE to "Debug" instead of "Release"
  2. Build using the build.sh script
  3. Go to the folder you'd like to run and execute cuda-gdb ~/path/to/GITR
  4. Set a breakpoint at a line of interest break particle_diagnostics.cpp:34
  5. Run the debugger by hitting r
  6. Once the debugger stops at the line of interest you can print and advance as necessary
  • to print particle information, like the variable x for a particle from the Particles class , you can use print particlesPointer->x.data_[indx]
  • to advance you can use s for step
  • all of these commands correspond to gdb documentation that can be found online
Clone this wiki locally