Next: Matrix and Vector Storage Up: In-core Dense Matrices Previous: Example

## Submatrix Argument Descriptions

As previously mentioned, the ScaLAPACK routines that solve dense linear systems and eigenvalue problems assume that all global arrays are distributed in a one- or two-dimensional block cyclic fashion. After a global vector or matrix has been block-cyclicly distributed over a process grid, the user may choose to perform an operation on a portion of the global matrix. This subset of the global matrix is referred to as a ``submatrix'' and is referenced through the use of six arguments in the calling sequence: the number of rows of the submatrix `M`, the number of columns of the submatrix `N`, the local array `A` containing the global array, the row index `IA`, the column index `JA` and the array descriptor of the global array `DESCA`. This argument convention allows for a global view of the matrix operands and the global addressing of distributed matrices as illustrated in figure 4.7. This scheme allows the complete specification of the submatrix `A(IA:IA+M-1,JA:JA+N-1)` on which to be operated.

Figure 4.7: Global view of the matrix operands

The description of a global dense subarray consists of `(M, N, A, IA, JA, DESCA)`

- the number of rows and columns `M` and `N` of the global subarray,
- a pointer to the local array containing the entire global array (`A`, for example),
- the row and column indices, `(IA, JA)`, in the global array, and
- the array descriptor, `DESCA`, for the global array.

The names of the row and column indices for the global array have the form I<array_name> and J<array_name> , respectively. The array descriptor has a name of the form DESC<array_name> . The length of the array descriptor is specified by DLEN_ and varies according to the descriptor type DTYPE_.

Included in the leading comments of each subroutine (immediately preceding the Argument section), is a brief note describing the array descriptor and some commonly used expressions in calculating workspace.

The style of the argument descriptions for dense matrices is illustrated by the following example. As previously mentioned, the notations x_ used in the entries of the array descriptor denote the attributes of a global array. For readability of the code, we have associated symbolic names for the descriptor entries. For example, M_ denotes the number of rows and M_A specifically denotes the number of rows in global matrix A. Complete details can be found in section 4.3.3.

M
  (global input) INTEGER
  The number of rows of the matrix A(IA:IA+M-1,JA:JA+N-1) on which to be operated. M 0 and IA+M-1 M_A.
N
  (global input) INTEGER
  The number of columns of the matrix A(IA:IA+M-1,JA:JA+N-1) on which to be operated. N 0 and JA+N-1 N_A.
NRHS
  (global input) INTEGER
  The number of right hand side vectors, i.e. the number of columns of the matrix B(IB:IB+N-1,JB:JB+NRHS-1). NRHS 0.
A
  (local input/local output) REAL pointer into the local memory to an array of local dimension (LLD_A, LOC(JA+N-1))
IA
  (global input) INTEGER
  The row index in the global array A indicating the first row of A(IA:IA+M-1,JA:JA+N-1).
JA
  (global input) INTEGER
  The column index in the global array A indicating the first column of A(IA:IA+M-1,JA:JA+N-1).
DESCA
  (global and local input) INTEGER array of dimension DLEN_
  The array descriptor for the global matrix A.
B
  (local input/local output) REAL pointer into the local memory to an array of local dimension (LLD_B, LOC(JB+NRHS-1)).
IB
  (global input) INTEGER
  The row index in the global array B indicating the first row of B(IB:IB+N-1,JB:JB+NRHS-1).
JB
  (global input) INTEGER
  The column index in the global array B indicating the first column of B(IB:IB+N-1,JB:JB+NRHS-1).
DESCB
  (global and local input) INTEGER array of dimension DLEN_
  The array descriptor for the global matrix B.

The description of each argument gives

- A classification of the argument as (local input), (global and local input), (local input/local output), (global input), (local output), (global output), (global input/global output), (local input or local output), (local or global input), (local workspace), or (local workspace/local output).
- The type of the argument;
- For an array, its dimension(s).

  These dimensions are often expressed in terms of LOC() and LOC() calculations. For further details, please refer to section 4.3.2.

- A specification of the value(s) that must be supplied for the argument (if it is an input argument), or of the value(s) returned by the routine (if it is an output argument), or both (if it is an input/output argument). In the last case, the two parts of the description are introduced by the phrases ``On entry'' and ``On exit''.
- For a scalar input argument, any constraints that the supplied values must satisfy (such as N 0 in the example above).

Next: Matrix and Vector Storage Up: In-core Dense Matrices Previous: Example