Debugging and searching for memory leaks

Hi there,

I am trying to find possible memory leak in my code, and I wanted to use GDB and Valgrind for this. I have previously only used them in an interactive mode. Can you tell me how to use them when submitting a job with batch script to compute modes? Also can you tell me how can I use them for a mpi parallel code?

Thanks in advance.

Hello @Azadeh.MoradinezhadDizgah I’ve installed Valgrind for you New software installed Valgrind.

To use GDB on a compute node, you can launch your job as usual, and connect to the node where it is executed using ssh. And from here you attach gdb to your process (google for attach). For debugging mpi stuff, this is another story, and maybe valgrind may help you more.

Hi Yann,
Thank you for your response. I have two more questions related to this, First, can you tell me the command to connect to a specific node via ssh. Second, can I run short interactive job (as described on for debug node) for debugging on dpt-LE7 nodes?


you need to figure out on which node your job is running by using scontrol show job JOBID where JOBID is your jobid. Then you can connect to the node using ssh nodeXXX.

Yes you can launch interactive jobs on the partition dpt-EL7, but if it’s short and for debug purpose you’ll have much less wait time if you use the debug nodes.

1 Like