Totalview® User Guide : PART IV Advanced Tools and Customization : Chapter 20 Setting Up Parallel Debugging Sessions : Debugging CoArray Fortran (CAF) Programs
Debugging CoArray Fortran (CAF) Programs
TotalView has partial support for debugging CoArray Fortran (CAF) programs on Cray platforms. This section discusses the parts of TotalView that support CAF-specific features. CoArray Fortran allows a programmer to distribute parts of an array over a set of processes using an augmented Fortran array syntax. The processes in a CAF job share the same executable. The processes are assigned "image ids" starting at image one.
NOTE >> When debugging CAF code, TotalView requires help from a CAF assistant library that your compiler vendor provides. You need to include the location of this library in your LD_LIBRARY_PATH environment variable. TotalView also provides assistants that you can use.
Because currently TotalView support is partial, expressions that attempt to re-cast CAF types or change the visible slices of CAF types are likely to fail.
Invoking TotalView
CAF programs commonly rely on an underlying parallel protocol such as MPI. They are started the same way as other programs using the same parallel technology.
On Cray machines that use aprun, invoking a four-image job on TotalView may look like this:
totalview aprun -a -n 4 caf_program caf_program_args
Viewing CAF Programs
For a CAF program, the process id in the TotalView process window shows the CAF image id. TotalView shows the correct dimensions and co-dimensions of arrays and the co-dimensions of scalars.
When diving on a CAF array or scalar, TotalView shows the data local to the current image. Diving across processes shows the entire distributed array.
 
Figure 247 – Diving on CAF array y
 
Figure 248 – Diving on CAF array y across processes
If you use the array viewer, statistics, and visualizer commands from the Tools menu when viewing a CAF array across processes, the commands treat the co-array dimensions much like standard array dimensions.
Using CLI with CAF
The dprint command in the CLI displays the data in CAF arrays in a similar way to the above. When the focus is a process, dprint lists the local values. When the focus is the shared group containing the CAF images, dprint lists the entire co‑array.