Pgdbg: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Draft}}
{{Draft}}
<languages />
<translate>
PGDBG is a powerful and simple tool for debugging both MPI-parallel and OpenMP thread-parallel Linux applications. It is included in the PGI compiler package and configured for OpenMP thread-parallel debugging.
=PGI Debugger (pgdbg) =
=PGI Debugger (pgdbg) =
== What is Pgdbg ? ==
== What is Pgdbg ? ==
Line 19: Line 23:
If you have set the X11 forwarding then the pgdbg will start in the graphical mode in a pop-up window. If you don't have X11 forwarding, you can run pgdbg in a text mode by adding an extra option "-text" :
If you have set the X11 forwarding then the pgdbg will start in the graphical mode in a pop-up window. If you don't have X11 forwarding, you can run pgdbg in a text mode by adding an extra option "-text" :
{{Command|pgdbg -text program arg1 arg2}}
{{Command|pgdbg -text program arg1 arg2}}
</translate>

Revision as of 17:44, 29 January 2019


This article is a draft

This is not a complete article: This is a draft, a work in progress that is intended to be published into an article, which may or may not be ready for inclusion in the main wiki. It should not necessarily be considered factual or authoritative.



Other languages:

PGDBG is a powerful and simple tool for debugging both MPI-parallel and OpenMP thread-parallel Linux applications. It is included in the PGI compiler package and configured for OpenMP thread-parallel debugging.

PGI Debugger (pgdbg)[edit]

What is Pgdbg ?[edit]

For the most of the C, C++, or Fortran 77 codes one can use a regular GNU debugger such as GDB. However, the Fortran 90/95 programs are not handled very well by the GDB. The Portland Group has developed a debugger called pgdbg which is more suited for such codes. Pgdbg is provided in two modes: a graphical mode with the enabled X11 forwarding or a text mode. Pgdbg can be used to debug codes with MPI-parallel, OpenMP thread-parallel, or MPI-OpenMP hybrid instructions.

Preparing your application[edit]

Switch to PGI compiler[edit]

Load the appropriate PGI compiler. For example, for PGI 17.3:

Question.png
[name@server ~]$ module load pgi/17.3

Compile your code[edit]

To be able to debug with pgdbg you first need to compile your code with debugging information enabled. With the pgdbg you do so by adding a debugging flag "-g":

Question.png
[name@server ~]$ pgcc -g program.c -o program

Execute your code[edit]

Once your code is compiled with the proper options, you execute it:

Question.png
[name@server ~]$ pgdbg program arg1 arg2

If you have set the X11 forwarding then the pgdbg will start in the graphical mode in a pop-up window. If you don't have X11 forwarding, you can run pgdbg in a text mode by adding an extra option "-text" :

Question.png
[name@server ~]$ pgdbg -text program arg1 arg2