intel-debugger.md 3.2 KB
Newer Older
Lukáš Krupčík's avatar
update    
Lukáš Krupčík committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Intel Debugger

IDB is no longer available since Intel Parallel Studio 2015

## Debugging Serial Applications

The intel debugger version is available, via module intel/13.5.192. 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](../../general/accessing-the-clusters/graphical-user-interface/x-window-system/) for running the GUI.

```console
$ ml intel/13.5.192
$ ml Java
$ idb
```

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

```console
$ idbc
```

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](../../general/accessing-the-clusters/graphical-user-interface/x-window-system/)

Example:

```console
$ qsub -q qexp -l select=1:ncpus=24 -X -I    # use 16 threads for Anselm
    qsub: waiting for job 19654.srv11 to start
    qsub: job 19654.srv11 ready
$ ml intel
$ ml Java
$ icc -O0 -g myprog.c -o myprog.x
$ idb ./myprog.x
```

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.

## Debugging Parallel Applications

 Intel debugger is capable of debugging multithreaded and MPI parallel programs as well.

### 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](../../general/accessing-the-clusters/graphical-user-interface/x-window-system/)). Using Intel MPI, this may be done in following way:

```console
$ qsub -q qexp -l select=2:ncpus=24 -X -I
    qsub: waiting for job 19654.srv11 to start
    qsub: job 19655.srv11 ready
$ ml intel
$ mpirun -ppn 1 -hostfile $PBS_NODEFILE --enable-x xterm -e idbc ./mympiprog.x
```

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

### Large Number of MPI Ranks

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:

```console
$ qsub -q qexp -l select=2:ncpus=24 -X -I
    qsub: waiting for job 19654.srv11 to start
    qsub: job 19655.srv11 ready
$ ml intel
$ mpirun -n 48 -idb ./mympiprog.x
```

### Debugging Multithreaded Application

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
fix    
Lukáš Krupčík committed
71
## Further Information
Lukáš Krupčík's avatar
update    
Lukáš Krupčík committed
72

73
Exhaustive manual on IDB features and usage is published at Intel website, <https://software.intel.com/sites/products/documentation/doclib/iss/2013/compiler/cpp-lin/>