Method 1 – Debugging with GDB
Most cluster computers and high-performance computing (HPC) systems do not offer graphical user interfaces, and instead rely on command-line inputs. GDB can be installed by entering the following command in the terminal:
sudo apt-get install libc6-dbg gdb valgrind
The following commands start GDB and load the executable lmp_test
file:
[in] user@user-Main:~/lammps/test$ gdb –silent [in] (gdb) file lmp_test
The following output is expected:
[out] Reading symbols from lmp_test...done.
Since we are interested in analyzing sbmask()
, a breakpoint will be added at a line where sbmask()
is located to pause the code at that point. The following input command places a breakpoint (b
) at line 93, right after the loop over the neighbor list begins, and the corresponding output registers the breakpoint:
[in] (gdb) b pair_lj_cut.cpp:93 [out] Breakpoint 1 at 0x637e12:file/home/lammps/src/pair_lj_cut.cpp, line 93.
Then, the input...