TotalView is a graphical debugger with support for serial and MPI programs.  Debugging A++ & P++ code with TotalView can be a bit tricky.  Here are some tips.

typeArray with A++

A++ (and P++) implements a variety of typeArray data types, for example: realArray, floatArray and doubleArray.  For the purpose of this tutorial, let's limit ourselves to a realArray. When you dive on a realArray in TotalView, you get a list of pointers and scalars like you would with a C structure:

  • Basearray <class BaseArray>
  • Array_Descriptor <class doubleArray_Desc>
  • Array_Storage <Opperand_Storage x>
  • freepointer <class doubleArray x>
  • referenceCount <int>
  • ... etc.

It is a bit of a hassle to view the raw data in TotalView, but not impossible. Here's how you do it:

  1. Determine the array dimensions
    1. Array_Descriptor -> Array_Domain -> Size
    2. You can derive the dimensions from the Size array in the following manner:
      1. dimension[0] = size[0]
      2. dimension[1] = size[1] / size[0]
      3. dimension[2] = size[2] / size[1]
      4. ... etc.
  2. To view the data:
    1. Dive on Array_Descriptor -> Array_Data
    2. Set "Type" from "double" to
      double [dimension[n]][dimension[n-1]] ... [dimension[0]]
      Note that the dimensions are transposed because A++ stores arrays in Fortran column-major ordering.

typeArray with P++

The procedure to view P++ data using TotalView is similar to viewing typeArray with A++. The only difference: You need to first expand serialArray before Array_Descriptor

  • No labels