Skip to content
Snippets Groups Projects
intel-debugger.md 2.96 KiB
Newer Older
David Hrbáč's avatar
David Hrbáč committed
# Intel Debugger

## Debugging serial applications
Lukáš Krupčík's avatar
Lukáš Krupčík committed

The intel debugger version 13.0 is available, via module intel. The debugger works for applications compiled with C and C++ compiler and the ifort fortran 77/90/95 compiler. The debugger provides java GUI environment. Use X display for running the GUI.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
    $ module load intel
    $ idb
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

The debugger may run in text mode. To debug in text mode, use

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
    $ idbc
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

To debug on the compute nodes, module intel must be loaded. The GUI on compute nodes may be accessed using the same way as in the GUI section
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Example:

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
    $ qsub -q qexp -l select=1:ncpus=16 -X -I
    qsub: waiting for job 19654.srv11 to start
    qsub: job 19654.srv11 ready

    $ module load intel
    $ module load java
    $ icc -O0 -g myprog.c -o myprog.x
    $ idb ./myprog.x
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
In this example, we allocate 1 full compute node, compile program myprog.c with debugging options -O0 -g and run the idb debugger interactively on the myprog.x executable. The GUI access is via X11 port forwarding provided by the PBS workload manager.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

David Hrbáč's avatar
David Hrbáč committed
## Debugging parallel applications

Lukáš Krupčík's avatar
Lukáš Krupčík committed
Intel debugger is capable of debugging multithreaded and MPI parallel programs as well.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

### Small number of MPI ranks

For debugging small number of MPI ranks, you may execute and debug each rank in separate xterm terminal (do not forget the X display. Using Intel MPI, this may be done in following way:
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
    $ qsub -q qexp -l select=2:ncpus=16 -X -I
    qsub: waiting for job 19654.srv11 to start
    qsub: job 19655.srv11 ready

    $ module load intel impi
    $ mpirun -ppn 1 -hostfile $PBS_NODEFILE --enable-x xterm -e idbc ./mympiprog.x
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
In this example, we allocate 2 full compute node, run xterm on each node and start idb debugger in command line mode, debugging two ranks of mympiprog.x application. The xterm will pop up for each rank, with idb prompt ready. The example is not limited to use of Intel MPI
Lukáš Krupčík's avatar
Lukáš Krupčík committed

### Large number of MPI ranks

Lukáš Krupčík's avatar
Lukáš Krupčík committed
Run the idb debugger from within the MPI debug option. This will cause the debugger to bind to all ranks and provide aggregated outputs across the ranks, pausing execution automatically just after startup. You may then set break points and step the execution manually. Using Intel MPI:
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
    $ qsub -q qexp -l select=2:ncpus=16 -X -I
    qsub: waiting for job 19654.srv11 to start
    qsub: job 19655.srv11 ready

    $ module load intel impi
    $ mpirun -n 32 -idb ./mympiprog.x
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

### Debugging multithreaded application

Lukáš Krupčík's avatar
Lukáš Krupčík committed
Run the idb debugger in GUI mode. The menu Parallel contains number of tools for debugging multiple threads. One of the most useful tools is the **Serialize Execution** tool, which serializes execution of concurrent threads for easy orientation and identification of concurrency related bugs.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

David Hrbáč's avatar
David Hrbáč committed
## Further information
Lukáš Krupčík's avatar
Lukáš Krupčík committed

David Hrbáč's avatar
David Hrbáč committed
Exhaustive manual on idb features and usage is published at [Intel website](http://software.intel.com/sites/products/documentation/doclib/stdxe/2013/composerxe/debugger/user_guide/index.htm)