The stride, which is optional, tells TotalView to skip over elements and not display them. Adding a
stride to a slice tells the debugger to display every
stride element of the array, starting at the
lower_bound and continuing through the
upper_bound, inclusive.
For example, a slice of [0:9:9] used on a ten-element C array tells TotalView to display the first element and last element, which is the ninth element beyond the lower bound.
If the stride is negative and the lower bound is greater than the upper bound, TotalView displays a dimension with its indices reversed. That is, TotalView treats the slice as if it was defined as follows:
This syntax differs from Fortran 90 syntax in that Fortran 90 requires that you explicitly enter the upper and lower bounds when you’re reversing the order for displaying array elements.
Because the default value for the stride is 1, you can omit the stride (and the colon that precedes it) from your definition. For example, the following two definitions display array elements 0 through 9:
A slice declaration of [::2] for a C or C++ array (with a default lower bound of
0) tells TotalView to display elements with even indices of the array; that is, 0, 2, 4, and so on. However, if this were defined for a Fortran array (where the default lower bound is
1), TotalView displays elements with odd indices of the array; that is, 1, 3, 5, and so on.
Figure 211 displays a stride of
(::9,::9). This definition displays the four corners of a ten-element by ten-element Fortran array.
You can use a stride to invert the order and skip elements. For example, the following slice begins with the upper bound of the array and displays every other element until it reaches the lower bound of the array:
Using (::–2) with a Fortran
integer(10) array tells TotalView to display the elements 10, 8, 6, 4, and 2.
You can simultaneously invert the array’s order and limit its extent to display a small section of a large array. The following figure shows how to specify a
(2:3,7::–1) slice with an
integer*4(–1:5,2:10) Fortran array.