Views
FrontPage
>>
Using Totalview
last edited 5 years ago by rohrle
Starting Totalview
- Running totalview on hpc (Strategy Number One)
- Run
totalview cm64-debug(Make sure you are using a debugged version) - Go to
Process->Startup Parametersand type your comfile as a Command-line argument
- Run
- Running totalview on hpc (Strategy Number Two)
- Run
totalview cm64-debug -a myfile.com
- Run
Overview of Important Commands Used in Totalview
- Type
fin totalview window allows you to search for file. For example, typemarch8_will bring up MARCH8.f which you can then place a breakpoint in. - To set a breakpoint, e.g. line 129 of MARCH8.f, just click on line 129 on left hand side of page and
a red
STOPwill cover the line number. - Click on
Goto get the programming running. You canHaltat anytime to stop at a point in the program. Note that this does not end your program, just temporarily suspend computation. - Click
Nextto step to the next active line in the code without stepping into any subroutines. (Nextsimply steps over all subroutines.) You can also simply typento go to the next line. - Click
Stepto step to the next active line, or into a subroutine. You can also clicksto go to the next line or into a subroutine. - Click
Outto go out of the current subroutine and into the next higher subroutine on the tree.
Viewing Contents of Arrays and Variables
- First option (one I never use) is to look at the
Stack Framewindow. Gives all variables on the stack. (Note that a subroutine places all local variables on the stack versus global variables which are placed on the heap. Google stack and heap and learn more information about them.) - Common means of viewing arrays are variables is to double click on them. A window will pop-up with the array values in
the window. Use that to search for values or to only look at a slice. (Use
Slicewindow.) - You can view a variable value (not an array) by simply placing the mouse pointer over that variable.
Creating Breakpoint based on Variable Values
- To set a condition breakpoint edit the properties of the breakpoint and set the Evaluation Expression to be something of the form: "if(np.eq.840) $stop"
- To set a breakpoint for writing to a variable, highlight the variable in the Expression View and create a Watchpoint (under Tools)
Tracing segmentation faults with a coredump file and totalview
- First change your
limitsto allow a coredumplimit coredumpsize unlimited - Then start from the command line your comfile, e.g.
/hpc/cmiss/bin/rs6000-aix/cm64-debug -batch "comfile" >& "outputfile" </dev/null(I would recommend to use the full path for cm64-debug instead of aliases). The option-batchsupresses any further input from stdin. - Start totalview: 'totalview':
- In the start-up window, change the box
Start a new processtoOpen a core file - Choose in the field
Programthe cm-debug executable which produced the coredump file (with its full path, e.g./hpc/cmiss/bin/rs6000-aix/cm64-debug) - Then browse for the coredump file
coreproduced by running cm64-debug - Hit the
OKbutton.
- In the start-up window, change the box
- Totalview pops-up with a window which displays (just as in normal debugging mode) the source code. An arrow points to the position at which the segmentation fault occured.
- Now, you can look at the variables, trace back subroutines, ... You can now use totalview just as you would be in normal debug-mode (of course "execute the next command"-button is not an option).
- After debugging, make sure that you remove your cordump file again. Coredump files are extremely large (can easily be >10G).
- Set your limits back such that no coredump file gets created any more:
limit coredumpsize 0