This part of the book is organized into seven areas, providing reference information for coding the Parallel ESSL message passing subroutines. It is organized as follows:
This chapter describes the Level 2 PBLAS subroutines.
This chapter describes the Level 2 PBLAS subroutines.
The Level 2 PBLAS include a subset of the standard set of distributed memory parallel versions of the Level 2 BLAS.
Note: | These subroutines are designed in accordance with the proposed Level 2 PBLAS standard. (See references [14], [15], and [17].) If these subroutines do not comply with the standard as approved, IBM will consider updating them to do so. If IBM updates these subroutines, the update could require modifications of the calling application program. |
Table 36. List of Level 2 PBLAS (Message Passing)
Descriptive Name | Long-Precision Subprogram | Page |
---|---|---|
Matrix-Vector Product for a General Matrix or Its Transpose | PDGEMV | PDGEMV--Matrix-Vector Product for a General Matrix or Its Transpose |
Matrix-Vector Product for a Real Symmetric Matrix | PDSYMV | PDSYMV--Matrix-Vector Product for a Real Symmetric Matrix |
Rank-One Update of a General Matrix | PDGER | PDGER--Rank-One Update of a General Matrix |
Rank-One Update of a Real Symmetric Matrix | PDSYR | PDSYR--Rank-One Update of a Real Symmetric Matrix |
Rank-Two Update of a Real Symmetric Matrix | PDSYR2 | PDSYR2--Rank-Two Update of a Real Symmetric Matrix |
Matrix-Vector Product for a Triangular Matrix or Its Transpose | PDTRMV | PDTRMV--Matrix-Vector Product for a Triangular Matrix or Its Transpose |
Solution of Triangular System of Equations with a Single Right-Hand Side | PDTRSV | PDTRSV--Solution of Triangular System of Equations with a Single Right-Hand Side |
This section contains the Level 2 PBLAS subroutine descriptions.
This subroutine computes one of the following matrix-vector products:
where, in the formulas above:
Note: | No data should be moved to form the matrix transpose; that is, the matrix should always be stored in its untransposed form. |
In the following three cases, no computation is performed and the subroutine returns after doing some parameter checking:
alpha, beta, A, x, y | Subprogram |
Long-precision real | PDGEMV |
Fortran | CALL PDGEMV (transa, m, n, alpha, a, ia, ja, desc_a, x, ix, jx, desc_x, incx, beta, y, iy, jy, desc_y, incy) |
C and C++ | pdgemv (transa, m, n, alpha, a, ia, ja, desc_a, x, ix, jx, desc_x, incx, beta, y, iy, jy, desc_y, incy); |
If transa = 'N', A is used in the computation.
If transa = 'T', AT is used in the computation.
Scope: global
Specified as: a single character; transa = 'N' or 'T'.
If transa = 'N', it is the number of elements in vector y.
If transa = 'T', it is the number of elements in vector x.
Scope: global
Specified as: a fullword integer; m >= 0.
If transa = 'N', it is the number of elements in vector x.
If transa = 'T', it is the number of elements in vector y.
Scope: global
Specified as: a fullword integer; n >= 0.
Scope: global
Specified as: a number of the data type indicated in Table 37.
Note: | No data should be moved to form AT; that is, the matrix A should always be stored in its untransposed form. |
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 37. Details about the block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: global
Specified as: a fullword integer; 1 <= ia <= M_A and ia+m-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A and ja+n-1 <= N_A.
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor type | DTYPE_A=1 | Global |
2 | CTXT_A | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_A | Number of rows in the global matrix |
If m = 0 or n = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If m = 0 or n = 0: N_A >= 0 Otherwise: N_A >= 1 | Global |
5 | MB_A | Row block size | MB_A >= 1 | Global |
6 | NB_A | Column block size | NB_A >= 1 | Global |
7 | RSRC_A | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_A < p | Global |
8 | CSRC_A | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_A < q | Global |
9 | LLD_A | The leading dimension of the local array | LLD_A >= max(1,LOCp(M_A)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
If transa = 'N', numx = n
If transa = 'T', numx = m
the following must be true:
Scope: local
Specified as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 37. Details about the block-cyclic data distribution of the global matrix X are stored in desc_x.
If incx = M_X, it indicates which row of global matrix X is used for vector x.
If incx = 1 and incx <> M_X, it is the row index of global matrix X, identifying the first element of vector x.
Scope: global
Specified as: a fullword integer; 1 <= ix <= M_X, and if incx = 1 and incx <> M_X, then:
If transa = 'N', then ix+n-1 <= M_X.
If transa = 'T', then ix+m-1 <= M_X.
If incx = M_X, it is the column index of global matrix X, identifying the first element of vector x.
If incx = 1 and incx <> M_X, it indicates which column of global matrix X is used for vector x.
Scope: global
Specified as: a fullword integer; 1 <= jx <= N_X, and if incx = M_X, then:
If transa = 'N', then jx+n-1 <= N_X.
If transa = 'T', then jx+m-1 <= N_X.
desc_x | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_X | Descriptor type | DTYPE_X=1 | Global |
2 | CTXT_X | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_X | Number of rows in the global matrix |
If transa = 'N' and n = 0: M_X >= 0 If transa = 'T' and m = 0: M_X >= 0 Otherwise: M_X >= 1 | Global |
4 | N_X | Number of columns in the global matrix |
If transa = 'N' and n = 0: N_X >= 0 If transa = 'T' and m = 0: N_X >= 0 Otherwise: N_X >= 1 | Global |
5 | MB_X | Row block size | MB_X >= 1 | Global |
6 | NB_X | Column block size | NB_X >= 1 | Global |
7 | RSRC_X | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_X < p | Global |
8 | CSRC_X | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_X < q | Global |
9 | LLD_X | The leading dimension of the local array | LLD_X >= max(1,LOCp(M_X)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incx = 1 or incx = M_X, where:
If incx = M_X, then x is a row-distributed vector.
If incx = 1 and incx <> M_X, then x is a column-distributed vector.
Scope: global
Specified as: a number of the data type indicated in Table 37.
If transa = 'N', numy = m
If transa = 'T', numy = n
the following must be true:
When beta is zero, y need not be set on input.
Scope: local
Specified as: an LLD_Y by (at least) LOCq(N_Y) array, containing numbers of the data type indicated in Table 37. Details about the block-cyclic data distribution of the global matrix Y are stored in desc_y.
If incy = M_Y, it indicates which row of global matrix Y is used for vector y.
If incy = 1 and incy <> M_Y, it is the row index of global matrix Y, identifying the first element of vector y.
Scope: global
Specified as: a fullword integer; 1 <= iy <= M_Y, and if incy = 1 and incy <> M_Y, then:
If transa = 'N', then iy+m-1 <= M_Y.
If transa = 'T', then iy+n-1 <= M_Y.
If incy = M_Y, it is the column index of global matrix Y, identifying the first element of vector y.
If incy = 1 and incy <> M_Y, it indicates which column of global matrix Y is used for vector y.
Scope: global
Specified as: a fullword integer; 1 <= jy <= N_Y, and if incy = M_Y, then:
If transa = 'N', then jy+m-1 <= N_Y.
If transa = 'T', then jy+n-1 <= N_Y.
desc_y | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_Y | Descriptor type | DTYPE_Y=1 | Global |
2 | CTXT_Y | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_Y | Number of rows in the global matrix |
If transa = 'N' and m = 0: M_Y >= 0 If transa = 'T' and n = 0: M_Y >= 0 Otherwise: M_Y >= 1 | Global |
4 | N_Y | Number of columns in the global matrix |
If transa = 'N' and m = 0: N_Y >= 0 If transa = 'T' and n = 0: N_Y >= 0 Otherwise: N_Y >= 1 | Global |
5 | MB_Y | Row block size | MB_Y >= 1 | Global |
6 | NB_Y | Column block size | NB_Y >= 1 | Global |
7 | RSRC_Y | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_Y < p | Global |
8 | CSRC_Y | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_Y < q | Global |
9 | LLD_Y | The leading dimension of the local array | LLD_Y >= max(1,LOCp(M_Y)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incy = 1 or incy = M_Y, where:
If incy = M_Y, then y is a row-distributed vector.
If incy = 1 and incy <> M_Y, then y is a column-distributed vector.
Scope: local
Returned as: an LLD_Y by (at least) LOCq(N_Y) array, containing numbers of the data type indicated in Table 37.
None
Unable to allocate work space
If (n = 0 and transa = 'N') or (m = 0 and transa = 'T'):
Otherwise:
In all cases:
If (m = 0 and transa = 'N') or (n = 0 and transa = 'T'):
Otherwise:
In all cases:
If m <> 0 and n <> 0:
If (n <> 0 and transa = 'N') or (m <> 0 and transa = 'T'):
If (m <> 0 and transa = 'N') or (n <> 0 and transa = 'T'):
If incx = M_X and transa = 'N':
If incx = M_X and transa = 'T':
If incx = 1( <> M_X) and transa = 'N':
If incx = 1( <> M_X) and transa = 'T':
In all cases:
If incy = M_Y and transa = 'N':
If incy = M_Y and transa = 'T':
If incy = 1( <> M_Y) and transa = 'N':
If incy = 1( <> M_Y) and transa = 'T':
In all cases:
If transa = 'N':
If transa = 'T':
In all cases:
This example computes y = alphaAx+betay using a 2 × 2 process grid. The input matrices A, X, and Y, used here, are the same as A, B, and C, used in "Example 1" for PDGEMM. The updated portion of Y is the same as for C in PDGEMM, as this computation is equivalent to a portion of the PDGEMM computation.
This example uses a global submatrix A within a global matrix A by specifying ia = 3 and ja = 1. It uses vectors x and y, which are column-distributed vectors within a column of X and Y, respectively, by specifying incx = 1, ix = 1, and jx = 2 for x and incy = 1, iy = 3, and jy = 2 for y.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) TRANSA M N ALPHA A IA JA DESC_A X IX JX | | | | | | | | | | | CALL PDGEMV( 'N' , 4 , 5 , 1.0D0 , A , 3 , 1 , DESC_A , X , 1 , 2 , DESC_X INCX BETA Y IY JY DESC_Y INCY | | | | | | | | DESC_X , 1 , 2.0D0 , Y , 3 , 2 , DESC_Y , 1 )
| Desc_A | Desc_X | Desc_Y | ||
---|---|---|---|---|---|
DTYPE_ | 1 | 1 | 1 | ||
CTXT_ | icontxt1 | icontxt1 | icontxt1 | ||
M_ | 6 | 5 | 6 | ||
N_ | 5 | 4 | 4 | ||
MB_ | 3 | 2 | 3 | ||
NB_ | 2 | 2 | 2 | ||
RSRC_ | 0 | 0 | 0 | ||
CSRC_ | 0 | 0 | 0 | ||
LLD_ | See below2 | See below2 | See below2 | ||
|
After the global matrix A is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix A. Following is the global 4 × 5 submatrix A, starting at row 3 and column 1 in global general 6 × 5 matrix A with block size 3 × 2:
B,D 0 1 2 * * | . . | . . | . | 0 | . . | . . | . | | 1.0 -1.0 | -1.0 1.0 | 2.0 | | -----------|-------------|------ | | -3.0 2.0 | 2.0 2.0 | 0.0 | 1 | 4.0 0.0 | -2.0 1.0 | -1.0 | | -1.0 -1.0 | 1.0 -3.0 | 2.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 |
---|---|---|
0 | P00 | P01 |
1 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|-----------------|------------ | . . . | . . 0 | . . . | . . | 1.0 -1.0 2.0 | -1.0 1.0 -----|-----------------|------------ | -3.0 2.0 0.0 | 2.0 2.0 1 | 4.0 0.0 -1.0 | -2.0 1.0 | -1.0 -1.0 2.0 | 1.0 -3.0
After the global matrix X is distributed over the process grid, only a portion of the global data structure is used--that is, global vector x, which is a column-distributed vector. Following is the global vector x of size 5 × 1, starting at row 1 and column 2 in 5 × 4 global matrix X with block size 2 × 2:
B,D 0 1 * * 0 | . -1.0 | . . | | . 2.0 | . . | | -----------|---------- | 1 | . 0.0 | . . | | . -1.0 | . . | | -----------|---------- | 2 | . 2.0 | . . | * *
The following is the 2 × 2 process grid:
B,D | 0 | 1 |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for x:
p,q | 0 | 1 -----|------------|----------- | . -1.0 | . . 0 | . 2.0 | . . | . 2.0 | . . -----|------------|----------- 1 | . 0.0 | . . | . -1.0 | . .
After the global matrix Y is distributed over the process grid, only a portion of the global data structure is used--that is, global vector y, which is a column-distributed vector. Following is the global vector y of size 4 × 1, starting at row 3 and column 2 in 6 × 4 global matrix Y with block size 3 × 2:
B,D 0 1 * * | . . | . . | 0 | . . | . . | | . 0.5 | . . | | -----------|---------- | | . 0.5 | . . | 1 | . 0.5 | . . | | . 0.5 | . . | * *
The following is the 2 × 2 process grid:
B,D | 0 | 1 |
---|---|---|
0 | P00 | P01 |
1 | P10 | P11 |
Local arrays for y:
p,q | 0 | 1 -----|------------|----------- | . . | . . 0 | . . | . . | . 0.5 | . . -----|------------|----------- | . 0.5 | . . 1 | . 0.5 | . . | . 0.5 | . .
Output:
After the global matrix Y is distributed over the process grid, only a portion of the global data structure is used--that is, global vector y, which is a column-distributed vector. Following is the global vector y of size 4 × 1, starting at row 3 and column 2 in 6 × 4 global matrix Y with block size 3 × 2:
B,D 0 1 * * | . . | . . | 0 | . . | . . | | . 1.0 | . . | | -----------|---------- | | . 6.0 | . . | 1 | . -6.0 | . . | | . 7.0 | . . | * *
The following is the 2 × 2 process grid:
B,D | 0 | 1 |
---|---|---|
0 | P00 | P01 |
1 | P10 | P11 |
Local arrays for y:
p,q | 0 | 1 -----|------------|----------- | . . | . . 0 | . . | . . | . 1.0 | . . -----|------------|----------- | . 6.0 | . . 1 | . -6.0 | . . | . 7.0 | . .
This example computes y = alphaAx+betay using a 2 × 2 process grid. The input matrices A, X, and Y, used here, are the same as A, B, and C, used in "Example 1" for PDGEMM.
This example uses a global submatrix A within a global matrix A by specifying ia = 2 and ja = 2. It uses vector x, which is a row-distributed vector within a row of X, by specifying incx = M_X = 5, ix = 4, and jx = 2. It uses vector y, which is a column-distributed vector within a column of Y, by specifying incy = 1, iy = 2, and jy = 3.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) TRANSA M N ALPHA A IA JA DESC_A X IX JX | | | | | | | | | | | CALL PDGEMV( 'N' , 4 , 3 , 1.0D0 , A , 2 , 2 , DESC_A , X , 4 , 2 , DESC_X INCX BETA Y IY JY DESC_Y INCY | | | | | | | | DESC_X , 5 , 2.0D0 , Y , 2 , 3 , DESC_Y , 1 )
| Desc_A | Desc_X | Desc_Y | ||
---|---|---|---|---|---|
DTYPE_ | 1 | 1 | 1 | ||
CTXT_ | icontxt1 | icontxt1 | icontxt1 | ||
M_ | 6 | 5 | 6 | ||
N_ | 5 | 4 | 4 | ||
MB_ | 3 | 2 | 3 | ||
NB_ | 2 | 2 | 2 | ||
RSRC_ | 0 | 0 | 0 | ||
CSRC_ | 0 | 0 | 0 | ||
LLD_ | See below2 | See below2 | See below2 | ||
|
After the global matrix A is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix A. Following is the global 4 × 3 submatrix A, starting at row 2 and column 2 in global general 6 × 5 matrix A with block size 3 × 2:
B,D 0 1 2 * * | . . | . . | . | 0 | . 0.0 | 1.0 1.0 | . | | . -1.0 | -1.0 1.0 | . | | -----------|-------------|----- | | . 2.0 | 2.0 2.0 | . | 1 | . 0.0 | -2.0 1.0 | . | | . . | . . | . | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 |
---|---|---|
0 | P00 | P01 |
1 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|----------------|------------ | . . . | . . 0 | . 0.0 . | 1.0 1.0 | . -1.0 . | -1.0 1.0 -----|----------------|------------ | . 2.0 . | 2.0 2.0 1 | . 0.0 . | -2.0 1.0 | . . . | . .
After the global matrix X is distributed over the process grid, only a portion of the global data structure is used--that is, global vector x, which is a row-distributed vector. Following is the global vector x of size 1 × 3, starting at row 4 and column 2 in 5 × 4 global matrix X with block size 2 × 2:
B,D 0 1 * * 0 | . . | . . | | . . | . . | | -----------|----------- | 1 | . . | . . | | . -1.0 | 1.0 -1.0 | | -----------|----------- | 2 | . . | . . | * *
The following is the 2 × 2 process grid:
B,D | 0 | 1 |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for x:
p,q | 0 | 1 -----|------------|------------ | . . | . . 0 | . . | . . | . . | . . -----|------------|------------ 1 | . . | . . | . -1.0 | 1.0 -1.0
After the global matrix Y is distributed over the process grid, only a portion of the global data structure is used--that is, global vector y, which is a column-distributed vector. Following is the global vector y of size 4 × 1, starting at row 2 and column 3 in 6 × 4 global matrix Y with block size 3 × 2:
B,D 0 1 * * | . . | . . | 0 | . . | 0.5 . | | . . | 0.5 . | | ----------|---------- | | . . | 0.5 . | 1 | . . | 0.5 . | | . . | . . | * *
The following is the 2 × 2 process grid:
B,D | 0 | 1 |
---|---|---|
0 | P00 | P01 |
1 | P10 | P11 |
Local arrays for y:
p,q | 0 | 1 -----|-----------|----------- | . . | . . 0 | . . | 0.5 . | . . | 0.5 . -----|-----------|----------- | . . | 0.5 . 1 | . . | 0.5 . | . . | . .
Output:
After the global matrix Y is distributed over the process grid, only a portion of the global data structure is used--that is, global vector y, which is a column-distributed vector. Following is the global vector y of size 4 × 1, starting at row 2 and column 3 in 6 × 4 global matrix Y with block size 3 × 2:
B,D 0 1 * * | . . | . . | 0 | . . | 1.0 . | | . . | 0.0 . | | ----------|---------- | | . . | -1.0 . | 1 | . . | -2.0 . | | . . | . . | * *
The following is the 2 × 2 process grid:
B,D | 0 | 1 |
---|---|---|
0 | P00 | P01 |
1 | P10 | P11 |
Local arrays for y:
p,q | 0 | 1 -----|-----------|----------- | . . | . . 0 | . . | 1.0 . | . . | 0.0 . -----|-----------|----------- | . . | -1.0 . 1 | . . | -2.0 . | . . | . .
This subroutine computes the following matrix-vector product:
where, in the formula above:
In the following two cases, no computation is performed and the subroutine returns after doing some parameter checking:
alpha, beta, A, x, y | Subprogram |
Long-precision real | PDSYMV |
Fortran | CALL PDSYMV (uplo, n, alpha, a, ia, ja, desc_a, x, ix, jx, desc_x, incx, beta, y, iy, jy, desc_y, incy) |
C and C++ | pdsymv (uplo, n, alpha, a, ia, ja, desc_a, x, ix, jx, desc_x, incx, beta, y, iy, jy, desc_y, incy); |
If uplo = 'U', the upper triangular part is referenced.
If uplo = 'L', the lower triangular part is referenced.
Scope: global
Specified as: a single character; uplo = 'U' or 'L'.
Scope: global
Specified as: a fullword integer; n >= 0.
Scope: global
Specified as: a number of the data type indicated in Table 38.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 38. Details about the square block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: global
Specified as: a fullword integer; 1 <= ia <= M_A and ia+n-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A and ja+n-1 <= N_A.
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor type | DTYPE_A=1 | Global |
2 | CTXT_A | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_A | Number of rows in the global matrix |
If n = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If n = 0: N_A >= 0 Otherwise: N_A >= 1 | Global |
5 | MB_A | Row block size | MB_A >= 1 | Global |
6 | NB_A | Column block size | NB_A >= 1 | Global |
7 | RSRC_A | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_A < p | Global |
8 | CSRC_A | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_A < q | Global |
9 | LLD_A | The leading dimension of the local array | LLD_A >= max(1,LOCp(M_A)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Specified as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 38. Details about the block-cyclic data distribution of the global matrix X are stored in desc_x.
If incx = M_X, it indicates which row of global matrix X is used for vector x.
If incx = 1 and incx <> M_X, it is the row index of global matrix X, identifying the first element of vector x.
Scope: global
Specified as: a fullword integer; 1 <= ix <= M_X and:
If incx = 1 and incx <> M_X, then ix+n-1 <= M_X.
If incx = M_X, it is the column index of global matrix X, identifying the first element of vector x.
If incx = 1 and incx <> M_X, it indicates which column of global matrix X is used for vector x.
Scope: global
Specified as: a fullword integer; 1 <= jx <= N_X and:
If incx = M_X, then jx+n-1 <= N_X.
desc_x | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_X | Descriptor type | DTYPE_X=1 | Global |
2 | CTXT_X | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_X | Number of rows in the global matrix |
If n = 0: M_X >= 0 Otherwise: M_X >= 1 | Global |
4 | N_X | Number of columns in the global matrix |
If n = 0: N_X >= 0 Otherwise: N_X >= 1 | Global |
5 | MB_X | Row block size | MB_X >= 1 | Global |
6 | NB_X | Column block size | NB_X >= 1 | Global |
7 | RSRC_X | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_X < p | Global |
8 | CSRC_X | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_X < q | Global |
9 | LLD_X | The leading dimension of the local array | LLD_X >= max(1,LOCp(M_X)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incx = 1 or incx = M_X, where:
If incx = M_X, then x is a row-distributed vector.
If incx = 1 and incx <> M_X, then x is a column-distributed vector.
Scope: global
Specified as: a number of the data type indicated in Table 38.
When beta is zero, y need not be set on input.
Scope: local
Specified as: an LLD_Y by (at least) LOCq(N_Y) array, containing numbers of the data type indicated in Table 38. Details about the block-cyclic data distribution of the global matrix Y are stored in desc_y.
If incy = M_Y, it indicates which row of global matrix Y is used for vector y.
If incy = 1 and incy <> M_Y, it is the row index of global matrix Y, identifying the first element of vector y.
Scope: global
Specified as: a fullword integer; 1 <= iy <= M_Y and:
If incy = 1 and incy <> M_Y, then iy+n-1 <= M_Y.
If incy = M_Y, it is the column index of global matrix Y, identifying the first element of vector y.
If incy = 1 and incy <> M_Y, it indicates which column of global matrix Y is used for vector y.
Scope: global
Specified as: a fullword integer; 1 <= jy <= N_Y and:
If incy = M_Y, then jy+n-1 <= N_Y.
desc_y | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_Y | Descriptor type | DTYPE_Y=1 | Global |
2 | CTXT_Y | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_Y | Number of rows in the global matrix |
If n = 0: M_Y >= 0 Otherwise: M_Y >= 1 | Global |
4 | N_Y | Number of columns in the global matrix |
If n = 0: N_Y >= 0 Otherwise: N_Y >= 1 | Global |
5 | MB_Y | Row block size | MB_Y >= 1 | Global |
6 | NB_Y | Column block size | NB_Y >= 1 | Global |
7 | RSRC_Y | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_Y < p | Global |
8 | CSRC_Y | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_Y < q | Global |
9 | LLD_Y | The leading dimension of the local array | LLD_Y >= max(1,LOCp(M_Y)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incy = 1 or incy = M_X, where:
If incy = M_Y, then y is a row-distributed vector.
If incy = 1 and incy <> M_Y, then y is a column-distributed vector.
Scope: local
Returned as: an LLD_Y by (at least) LOCq(N_Y) array, containing numbers of the data type indicated in Table 38.
None
Unable to allocate work space
If n <> 0:
If incx = M_X and incy = M_Y:
If incx = 1( <> M_X) and incy = 1( <> M_Y):
Otherwise:
This example computes y = alphaAx+betay using a 2 × 2 process grid.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO N ALPHA A IA JA DESC_A X IX JX | | | | | | | | | | CALL PDSYMV( 'U' , 8 , 1.0D0 , A , 1 , 1 , DESC_A , X , 1 , 1 , DESC_X INCX BETA Y IY JY DESC_Y INCY | | | | | | | | DESC_X , 1 , 0.0D0 , Y , 1 , 1 , DESC_Y , 1 )
| Desc_A | Desc_X | Desc_Y | ||
---|---|---|---|---|---|
DTYPE_ | 1 | 1 | 1 | ||
CTXT_ | icontxt1 | icontxt1 | icontxt1 | ||
M_ | 8 | 8 | 8 | ||
N_ | 8 | 1 | 1 | ||
MB_ | 2 | 2 | 2 | ||
NB_ | 2 | 2 | 2 | ||
RSRC_ | 0 | 0 | 0 | ||
CSRC_ | 0 | 0 | 0 | ||
LLD_ | See below2 | See below2 | See below2 | ||
|
Global symmetric matrix A of order 8 with block size 2 × 2:
B,D 0 1 2 3 * * 0 | 0.0 -1.0 | -1.0 0.0 | 0.0 0.0 | 0.0 0.0 | | . 1.0 | 0.0 1.0 | 0.0 1.0 | 0.0 1.0 | | -----------|-------------|-------------|----------- | 1 | . . | -1.0 -1.0 | 0.0 0.0 | 1.0 0.0 | | . . | . -1.0 | 1.0 1.0 | 0.0 1.0 | | -----------|-------------|-------------|----------- | 2 | . . | . . | -1.0 0.0 | 0.0 0.0 | | . . | . . | . 1.0 | 0.0 0.0 | | -----------|-------------|-------------|----------- | 3 | . . | . . | . . | 0.0 0.0 | | . . | . . | . . | . 0.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 3 |
---|---|---|
0
2 | P00 | P01 |
1
3 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|----------------------|---------------------- | 0.0 -1.0 0.0 0.0 | -1.0 0.0 0.0 0.0 | . 1.0 0.0 1.0 | 0.0 1.0 0.0 1.0 0 | . . -1.0 0.0 | . . 0.0 0.0 | . . . 1.0 | . . 0.0 0.0 -----|----------------------|---------------------- | . . 0.0 0.0 | -1.0 -1.0 1.0 0.0 | . . 1.0 1.0 | . -1.0 0.0 1.0 1 | . . . . | . . 0.0 0.0 | . . . . | . . . 0.0
Global vector x of size 8 × 1 with block size 2:
B,D 0 * * 0 | 1.0 | | 1.0 | | ---- | 1 | 1.0 | | 1.0 | | ---- | 2 | 1.0 | | 1.0 | | ---- | 3 | 1.0 | | 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- |
---|---|---|
0
2 | P00 | P01 |
1
3 | P10 | P11 |
Local arrays for x:
p,q | 0 -----|------ | 1.0 | 1.0 0 | 1.0 | 1.0 -----|------ | 1.0 | 1.0 1 | 1.0 | 1.0
Output:
Global vector y of size 8 × 1 with block size 2 × 1:
B,D 0 * * 0 | -2.0 | | 3.0 | | ---- | 1 | -2.0 | | 2.0 | | ---- | 2 | 0.0 | | 3.0 | | ---- | 3 | 1.0 | | 2.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- |
---|---|---|
0
2 | P00 | P01 |
1
3 | P10 | P11 |
Local arrays for y:
p,q | 0 -----|------ | -2.0 | 3.0 0 | 0.0 | 3.0 -----|------ | -2.0 | 2.0 1 | 1.0 | 2.0
This subroutine computes the following rank-one update:
where, in the formula above:
Note: | No data should be moved to form the vector transpose; that is, the vector should always be stored in its untransposed form. |
In the following three cases, no computation is performed and the subroutine returns after doing some parameter checking:
alpha, A, x, y | Subprogram |
Long-precision real | PDGER |
Fortran | CALL PDGER (m, n, alpha, x, ix, jx, desc_x, incx, y, iy, jy, desc_y, incy, a, ia, ja, desc_a) |
C and C++ | pdger (m, n, alpha, x, ix, jx, desc_x, incx, y, iy, jy, desc_y, incy, a, ia, ja, desc_a); |
Scope: global
Specified as: a fullword integer; m >= 0.
Scope: global
Specified as: a fullword integer; n >= 0.
Scope: global
Specified as: a number of the data type indicated in Table 39.
Scope: local
Specified as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 39. Details about the block-cyclic data distribution of the global matrix X are stored in desc_x.
If incx = M_X, it indicates which row of global matrix X is used for vector x.
If incx = 1 and incx <> M_X, it is the row index of global matrix X, identifying the first element of vector x.
Scope: global
Specified as: a fullword integer; 1 <= ix <= M_X and:
If incx = 1 and incx <> M_X, then ix+m-1 <= M_X.
If incx = M_X, it is the column index of global matrix X, identifying the first element of vector x.
If incx = 1 and incx <> M_X, it indicates which column of global matrix X is used for vector x.
Scope: global
Specified as: a fullword integer; 1 <= jx <= N_X and:
If incx = M_X, then jx+m-1 <= N_X.
desc_x | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_X | Descriptor type | DTYPE_X=1 | Global |
2 | CTXT_X | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_X | Number of rows in the global matrix |
If m = 0: M_X >= 0 Otherwise: M_X >= 1 | Global |
4 | N_X | Number of columns in the global matrix |
If m = 0: N_X >= 0 Otherwise: N_X >= 1 | Global |
5 | MB_X | Row block size | MB_X >= 1 | Global |
6 | NB_X | Column block size | NB_X >= 1 | Global |
7 | RSRC_X | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_X < p | Global |
8 | CSRC_X | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_X < q | Global |
9 | LLD_X | The leading dimension of the local array | LLD_X >= max(1,LOCp(M_X)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incx = 1 or incx = M_X, where:
If incx = M_X, then x is a row-distributed vector.
If incx = 1 and incx <> M_X, then x is a column-distributed vector.
Note: | No data should be moved to form yT; that is, the vector y should always be stored in its untransposed form. |
Scope: local
Specified as: an LLD_Y by (at least) LOCq(N_Y) array, containing numbers of the data type indicated in Table 39. Details about the block-cyclic data distribution of the global matrix Y are stored in desc_y.
If incy = M_Y, it indicates which row of global matrix Y is used for vector y.
If incy = 1 and incy <> M_Y, it is the row index of global matrix Y, identifying the first element of vector y.
Scope: global
Specified as: a fullword integer; 1 <= iy <= M_Y and:
If incy = 1 and incy <> M_Y, then iy+n-1 <= M_Y.
If incy = M_Y, it is the column index of global matrix Y, identifying the first element of vector y.
If incy = 1 and incy <> M_Y, it indicates which column of global matrix Y is used for vector y.
Scope: global
Specified as: a fullword integer; 1 <= jy <= N_Y and:
If incy = M_Y, then jy+n-1 <= N_Y.
desc_y | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_Y | Descriptor type | DTYPE_Y=1 | Global |
2 | CTXT_Y | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_Y | Number of rows in the global matrix |
If n = 0: M_Y >= 0 Otherwise: M_Y >= 1 | Global |
4 | N_Y | Number of columns in the global matrix |
If n = 0: N_Y >= 0 Otherwise: N_Y >= 1 | Global |
5 | MB_Y | Row block size | MB_Y >= 1 | Global |
6 | NB_Y | Column block size | NB_Y >= 1 | Global |
7 | RSRC_Y | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_Y < p | Global |
8 | CSRC_Y | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_Y < q | Global |
9 | LLD_Y | The leading dimension of the local array | LLD_Y >= max(1,LOCp(M_Y)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incy = 1 or incy = M_X, where:
If incy = M_Y, then y is a row-distributed vector.
If incy = 1 and incy <> M_Y, then y is a column-distributed vector.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 39. Details about the block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: global
Specified as: a fullword integer; 1 <= ia <= M_A and ia+m-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A and ja+n-1 <= N_A.
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor type | DTYPE_A=1 | Global |
2 | CTXT_A | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_A | Number of rows in the global matrix |
If m = 0 or n = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If m = 0 or n = 0: N_A >= 0 Otherwise: N_A >= 1 | Global |
5 | MB_A | Row block size | MB_A >= 1 | Global |
6 | NB_A | Column block size | NB_A >= 1 | Global |
7 | RSRC_A | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_A < p | Global |
8 | CSRC_A | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_A < q | Global |
9 | LLD_A | The leading dimension of the local array | LLD_A >= max(1,LOCp(M_A)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Returned as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 39.
None
Unable to allocate work space
If m <> 0 and n <> 0:
If m <> 0:
If n <> 0:
If incx = M_X:
If incx = 1( <> M_X):
Otherwise:
If incy = M_Y:
If incy = 1( <> M_Y):
Otherwise:
This example computes A = alphaxyT+A using a 2 × 2 process grid. It uses a global submatrix A within a global matrix A by specifying ia = 2 and ja = 2. It uses vector x, which is a column-distributed vector within a column of global matrix X, by specifying incx = 1, ix = 2, and jx = 1. It uses vector y, which is a row-distributed vector within a row of global matrix Y, by specifying incy = M_Y = 5, iy = 1, and jy = 2.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) M N ALPHA X IX JX DESC_X INCX Y IY JY | | | | | | | | | | | CALL PDGER( 9 , 9 , 1.0D0 , X , 2 , 1 , DESC_X , 1 , Y , 1 , 2 , DESC_Y INCY A IA JA DESC_A | | | | | | DESC_Y , 1 , A , 2 , 2 , DESC_A )
| Desc_A | Desc_X | Desc_Y | ||
---|---|---|---|---|---|
DTYPE_ | 1 | 1 | 1 | ||
CTXT_ | icontxt1 | icontxt1 | icontxt1 | ||
M_ | 10 | 11 | 1 | ||
N_ | 10 | 1 | 11 | ||
MB_ | 4 | 4 | 1 | ||
NB_ | 4 | 10 | 4 | ||
RSRC_ | 0 | 0 | 0 | ||
CSRC_ | 0 | 0 | 0 | ||
LLD_ | See below2 | See below2 | See below2 | ||
|
After the global matrix A is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix A. Following is the global 9 × 9 submatrix A, starting at row 2 and column 2 in global general 10 × 10 matrix A with block size 4 × 4:
B,D 0 1 2 * * | . . . . | . . . . | . . | | . 12.0 22.0 32.0 | 42.0 52.0 62.0 72.0 | 82.0 92.0 | 0 | . 13.0 23.0 33.0 | 43.0 53.0 63.0 73.0 | 83.0 93.0 | | . 14.0 24.0 34.0 | 44.0 54.0 64.0 74.0 | 84.0 94.0 | | -------------------------|---------------------------|------------- | | . 15.0 25.0 35.0 | 45.0 55.0 65.0 75.0 | 85.0 95.0 | | . 16.0 26.0 36.0 | 46.0 56.0 66.0 76.0 | 86.0 96.0 | 1 | . 17.0 27.0 37.0 | 47.0 57.0 67.0 77.0 | 87.0 97.0 | | . 18.0 28.0 38.0 | 48.0 58.0 68.0 78.0 | 88.0 98.0 | | -------------------------|---------------------------|------------- | 2 | . 19.0 29.0 39.0 | 49.0 59.0 69.0 79.0 | 89.0 99.0 | | . 20.0 30.0 40.0 | 50.0 60.0 70.0 80.0 | 90.0 100.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|--------------------------------------|-------------------------- | . . . . . . | . . . . | . 12.0 22.0 32.0 82.0 92.0 | 42.0 52.0 62.0 72.0 | . 13.0 23.0 33.0 83.0 93.0 | 43.0 53.0 63.0 73.0 0 | . 14.0 24.0 34.0 84.0 94.0 | 44.0 54.0 64.0 74.0 | . 19.0 29.0 39.0 89.0 99.0 | 49.0 59.0 69.0 79.0 | . 20.0 30.0 40.0 90.0 100.0 | 50.0 60.0 70.0 80.0 -----|--------------------------------------|-------------------------- | . 15.0 25.0 35.0 85.0 95.0 | 45.0 55.0 65.0 75.0 | . 16.0 26.0 36.0 86.0 96.0 | 46.0 56.0 66.0 76.0 1 | . 17.0 27.0 37.0 87.0 97.0 | 47.0 57.0 67.0 77.0 | . 18.0 28.0 38.0 88.0 98.0 | 48.0 58.0 68.0 78.0
After the global matrix X is distributed over the process grid, only a portion of the global data structure is used--that is, global vector x, which is a column-distributed vector. Following is the global vector x of size 9 × 1, starting at row 2 and column 1 in 11 × 1 global matrix X with block size 4:
B,D 0 * * | . | | 1.0 | 0 | 1.0 | | 1.0 | | ---- | | 1.0 | | 1.0 | 1 | 1.0 | | 1.0 | | ---- | | 1.0 | 2 | 1.0 | | . | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for x:
p,q | 0 -----|------ | . | 1.0 | 1.0 0 | 1.0 | 1.0 | 1.0 | . -----|------ | 1.0 | 1.0 1 | 1.0 | 1.0
After the global matrix Y is distributed over the process grid, only a portion of the global data structure is used--that is, global vector y, which is a row-distributed vector. Following is the global vector y of size 1 × 9, starting at row 1 and column 2 in 1 × 11 global matrix Y with block size 4:
B,D 0 1 2 * * 0 | . 2.0 3.0 4.0 | 5.0 6.0 7.0 8.0 | 9.0 10.0 . | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 |
---|---|---|
0 | P00 | P01 |
-- | P10 | P11 |
Local arrays for y:
p,q | 0 | 1 -----|-------------------------------------|---------------------- 0 | . 2.0 3.0 4.0 9.0 10.0 . | 5.0 6.0 7.0 8.0
Output:
After the global matrix A is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix A. Following is the global 9 × 9 submatrix A, starting at row 2 and column 2 in global general 10 × 10 matrix A with block size 4 × 4:
B,D 0 1 2 * * | . . . . | . . . . | . . | | . 14.0 25.0 36.0 | 47.0 58.0 69.0 80.0 | 91.0 102.0 | 0 | . 15.0 26.0 37.0 | 48.0 59.0 70.0 81.0 | 92.0 103.0 | | . 16.0 27.0 38.0 | 49.0 60.0 71.0 82.0 | 93.0 104.0 | | -------------------------|---------------------------|------------- | | . 17.0 28.0 39.0 | 50.0 61.0 72.0 83.0 | 94.0 105.0 | | . 18.0 29.0 40.0 | 51.0 62.0 73.0 84.0 | 95.0 106.0 | 1 | . 19.0 30.0 41.0 | 52.0 63.0 74.0 85.0 | 96.0 107.0 | | . 20.0 31.0 42.0 | 53.0 64.0 75.0 86.0 | 97.0 108.0 | | -------------------------|---------------------------|------------- | 2 | . 21.0 32.0 43.0 | 54.0 65.0 76.0 87.0 | 98.0 109.0 | | . 22.0 33.0 44.0 | 55.0 66.0 77.0 88.0 | 99.0 110.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|-------------------------------------|-------------------------- | . . . . . . | . . . . | . 14.0 25.0 36.0 91.0 102.0 | 47.0 58.0 69.0 80.0 | . 15.0 26.0 37.0 92.0 103.0 | 48.0 59.0 70.0 81.0 0 | . 16.0 27.0 38.0 93.0 104.0 | 49.0 60.0 71.0 82.0 | . 21.0 32.0 43.0 98.0 109.0 | 54.0 65.0 76.0 87.0 | . 22.0 33.0 44.0 99.0 110.0 | 55.0 66.0 77.0 88.0 -----|-------------------------------------|-------------------------- | . 17.0 28.0 39.0 94.0 105.0 | 50.0 61.0 72.0 83.0 | . 18.0 29.0 40.0 95.0 106.0 | 51.0 62.0 73.0 84.0 1 | . 19.0 30.0 41.0 96.0 107.0 | 52.0 63.0 74.0 85.0 | . 20.0 31.0 42.0 97.0 108.0 | 53.0 64.0 75.0 86.0
This subroutine computes the following rank-one update:
where, in the formula above:
Note: | No data should be moved to form the vector transpose; that is, the vector should always be stored in its untransposed form. |
In the following two cases, no computation is performed and the subroutine returns after doing some parameter checking:
A, x, alpha | Subprogram |
Long-precision real | PDSYR |
Fortran | CALL PDSYR (uplo, n, alpha, x, ix, jx, desc_x, incx, a, ia, ja, desc_a) |
C and C++ | pdsyr (uplo, n, alpha, x, ix, jx, desc_x, incx, a, ia, ja, desc_a); |
If uplo = 'U', the upper triangular part is referenced.
If uplo = 'L', the lower triangular part is referenced.
Scope: global
Specified as: a single character; uplo = 'U' or 'L'.
Scope: global
Specified as: a fullword integer; n >= 0.
Scope: global
Specified as: a number of the data type indicated in Table 40.
Note: | No data should be moved to form xT; that is, the vector x should always be stored in its untransposed form. |
Scope: local
Specified as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 40. Details about the block-cyclic data distribution of the global matrix X are stored in desc_x.
If incx = M_X, it indicates which row of global matrix X is used for vector x.
If incx = 1 and incx <> M_X, it is the row index of global matrix X, identifying the first element of vector x.
Scope: global
Specified as: a fullword integer; 1 <= ix <= M_X and:
If incx = 1 and incx <> M_X, then ix+n-1 <= M_X.
If incx = M_X, it is the column index of global matrix X, identifying the first element of vector x.
If incx = 1 and incx <> M_X, it indicates which column of global matrix X is used for vector x.
Scope: global
Specified as: a fullword integer; 1 <= jx <= N_X and:
If incx = M_X, then jx+n-1 <= N_X.
desc_x | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_X | Descriptor type | DTYPE_X=1 | Global |
2 | CTXT_X | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_X | Number of rows in the global matrix |
If n = 0: M_X >= 0 Otherwise: M_X >= 1 | Global |
4 | N_X | Number of columns in the global matrix |
If n = 0: N_X >= 0 Otherwise: N_X >= 1 | Global |
5 | MB_X | Row block size | MB_X >= 1 | Global |
6 | NB_X | Column block size | NB_X >= 1 | Global |
7 | RSRC_X | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_X < p | Global |
8 | CSRC_X | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_X < q | Global |
9 | LLD_X | The leading dimension of the local array | LLD_X >= max(1,LOCp(M_X)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incx = 1 or incx = M_X, where:
If incx = M_X, then x is a row-distributed vector.
If incx = 1 and incx <> M_X, then x is a column-distributed vector.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 40. Details about the square block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: global
Specified as: a fullword integer; 1 <= ia <= M_A and ia+n-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A and ja+n-1 <= N_A.
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor type | DTYPE_A=1 | Global |
2 | CTXT_A | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_A | Number of rows in the global matrix |
If n = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If n = 0: N_A >= 0 Otherwise: N_A >= 1 | Global |
5 | MB_A | Row block size | MB_A >= 1 | Global |
6 | NB_A | Column block size | NB_A >= 1 | Global |
7 | RSRC_A | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_A < p | Global |
8 | CSRC_A | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_A < q | Global |
9 | LLD_A | The leading dimension of the local array | LLD_A >= max(1,LOCp(M_A)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Returned as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 40.
None
Unable to allocate work space
If n <> 0:
If incx = M_X:
If incx = 1( <> M_X):
Otherwise:
This example computes A = alphaxxT+A using a 2 × 2 process grid.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO N ALPHA X IX JX DESC_X INCX A IA JA DESC_A | | | | | | | | | | | | CALL PDSYR( 'L' , 9 , 1.0D0 , X , 1 , 1 , DESC_X , 1 , A , 1 , 1 , DESC_A)
| Desc_A | Desc_X | ||
---|---|---|---|---|
DTYPE_ | 1 | 1 | ||
CTXT_ | icontxt1 | icontxt1 | ||
M_ | 9 | 9 | ||
N_ | 9 | 1 | ||
MB_ | 4 | 4 | ||
NB_ | 4 | 1 | ||
RSRC_ | 0 | 0 | ||
CSRC_ | 0 | 0 | ||
LLD_ | See below2 | See below2 | ||
|
Global symmetric matrix A of order 9 with block size 4 × 4:
B,D 0 1 2 * * | 1.0 . . . | . . . . | . | | 2.0 12.0 . . | . . . . | . | 0 | 3.0 13.0 23.0 . | . . . . | . | | 4.0 14.0 24.0 34.0 | . . . . | . | | -------------------------|---------------------------|------- | | 5.0 15.0 25.0 35.0 | 45.0 . . . | . | | 6.0 16.0 26.0 36.0 | 46.0 56.0 . . | . | 1 | 7.0 17.0 27.0 37.0 | 47.0 57.0 67.0 . | . | | 8.0 18.0 28.0 38.0 | 48.0 58.0 68.0 78.0 | . | | -------------------------|---------------------------|------- | 2 | 9.0 19.0 29.0 39.0 | 49.0 59.0 69.0 79.0 | 89.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|--------------------------------|-------------------------- | 1.0 . . . . | . . . . | 2.0 12.0 . . . | . . . . 0 | 3.0 13.0 23.0 . . | . . . . | 4.0 14.0 24.0 34.0 . | . . . . | 9.0 19.0 29.0 39.0 89.0 | 49.0 59.0 69.0 79.0 -----|--------------------------------|-------------------------- | 5.0 15.0 25.0 35.0 . | 45.0 . . . | 6.0 16.0 26.0 36.0 . | 46.0 56.0 . . 1 | 7.0 17.0 27.0 37.0 . | 47.0 57.0 67.0 . | 8.0 18.0 28.0 38.0 . | 48.0 58.0 68.0 78.0
Global vector x of size 9 × 1 with block size 4:
B,D 0 * * | 1.0 | | 1.0 | 0 | 1.0 | | 1.0 | | ---- | | 1.0 | | 1.0 | 1 | 1.0 | | 1.0 | | ---- | 2 | 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for x:
p,q | 0 -----|------ | 1.0 | 1.0 0 | 1.0 | 1.0 | 1.0 -----|------ | 1.0 | 1.0 1 | 1.0 | 1.0
Output:
Global matrix A of order 9 with block size 4 × 4:
B,D 0 1 2 * * | 2.0 . . . | . . . . | . | | 3.0 13.0 . . | . . . . | . | 0 | 4.0 14.0 24.0 . | . . . . | . | | 5.0 15.0 25.0 35.0 | . . . . | . | | -------------------------|---------------------------|------- | | 6.0 16.0 26.0 36.0 | 46.0 . . . | . | | 7.0 17.0 27.0 37.0 | 47.0 57.0 . . | . | 1 | 8.0 18.0 28.0 38.0 | 48.0 58.0 68.0 . | . | | 9.0 19.0 29.0 39.0 | 49.0 59.0 69.0 79.0 | . | | -------------------------|---------------------------|------- | 2 | 10.0 20.0 30.0 40.0 | 50.0 60.0 70.0 80.0 | 90.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|--------------------------------|-------------------------- | 2.0 . . . . | . . . . | 3.0 13.0 . . . | . . . . 0 | 4.0 14.0 24.0 . . | . . . . | 5.0 15.0 25.0 35.0 . | . . . . | 10.0 20.0 30.0 40.0 90.0 | 50.0 60.0 70.0 80.0 -----|--------------------------------|-------------------------- | 6.0 16.0 26.0 36.0 . | 46.0 . . . | 7.0 17.0 27.0 37.0 . | 47.0 57.0 . . 1 | 8.0 18.0 28.0 38.0 . | 48.0 58.0 68.0 . | 9.0 19.0 29.0 39.0 . | 49.0 59.0 69.0 79.0
This subroutine computes the following rank-two update:
where, in the formula above:
Note: | No data should be moved to form the vector transposes; that is, the vectors should always be stored in their untransposed form. |
In the following two cases, no computation is performed and the subroutine returns after doing some parameter checking:
A, x, y, alpha | Subprogram |
Long-precision real | PDSYR2 |
Fortran | CALL PDSYR2 (uplo, n, alpha, x, ix, jx, desc_x, incx, y, iy, jy, desc_y, incy, a, ia, ja, desc_a) |
C and C++ | pdsyr2 (uplo, n, alpha, x, ix, jx, desc_x, incx, y, iy, jy, desc_y, incy, a, ia, ja, desc_a); |
If uplo = 'U', the upper triangular part is referenced.
If uplo = 'L', the lower triangular part is referenced.
Scope: global
Specified as: a single character; uplo = 'U' or 'L'.
Scope: global
Specified as: a fullword integer; n >= 0.
Scope: global
Specified as: a number of the data type indicated in Table 41.
Note: | No data should be moved to form xT; that is, the vector x should always be stored in its untransposed form. |
Scope: local
Specified as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 41. Details about the block-cyclic data distribution of the global matrix X are stored in desc_x.
If incx = M_X, it indicates which row of global matrix X is used for vector x.
If incx = 1 and incx <> M_X, it is the row index of global matrix X, identifying the first element of vector x.
Scope: global
Specified as: a fullword integer; 1 <= ix <= M_X and:
If incx = 1 and incx <> M_X, then ix+n-1 <= M_X.
If incx = M_X, it is the column index of global matrix X, identifying the first element of vector x.
If incx = 1 and incx <> M_X, it indicates which column of global matrix X is used for vector x.
Scope: global
Specified as: a fullword integer; 1 <= jx <= N_X and:
If incx = M_X, then jx+n-1 <= N_X.
desc_x | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_X | Descriptor type | DTYPE_X=1 | Global |
2 | CTXT_X | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_X | Number of rows in the global matrix |
If n = 0: M_X >= 0 Otherwise: M_X >= 1 | Global |
4 | N_X | Number of columns in the global matrix |
If n = 0: N_X >= 0 Otherwise: N_X >= 1 | Global |
5 | MB_X | Row block size | MB_X >= 1 | Global |
6 | NB_X | Column block size | NB_X >= 1 | Global |
7 | RSRC_X | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_X < p | Global |
8 | CSRC_X | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_X < q | Global |
9 | LLD_X | The leading dimension of the local array | LLD_X >= max(1,LOCp(M_X)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incx = 1 or incx = M_X, where:
If incx = M_X, then x is a row-distributed vector.
If incx = 1 and incx <> M_X, then x is a column-distributed vector.
Scope: local
Specified as: an LLD_Y by (at least) LOCq(N_Y) array, containing numbers of the data type indicated in Table 41. Details about the block-cyclic data distribution of the global matrix Y are stored in desc_y.
If incy = M_Y, it indicates which row of global matrix Y is used for vector y.
If incy = 1 and incy <> M_Y, it is the row index of global matrix Y, identifying the first element of vector y.
Scope: global
Specified as: a fullword integer; 1 <= iy <= M_Y and:
If incy = 1 and incy <> M_Y, then iy+n-1 <= M_Y.
If incy = M_Y, it is the column index of global matrix Y, identifying the first element of vector y.
If incy = 1 and incy <> M_Y, it indicates which column of global matrix Y is used for vector y.
Scope: global
Specified as: a fullword integer; 1 <= jy <= N_Y and:
If incy = M_Y, then jy+n-1 <= N_Y.
desc_y | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_Y | Descriptor type | DTYPE_Y=1 | Global |
2 | CTXT_Y | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_Y | Number of rows in the global matrix |
If n = 0: M_Y >= 0 Otherwise: M_Y >= 1 | Global |
4 | N_Y | Number of columns in the global matrix |
If n = 0: N_Y >= 0 Otherwise: N_Y >= 1 | Global |
5 | MB_Y | Row block size | MB_Y >= 1 | Global |
6 | NB_Y | Column block size | NB_Y >= 1 | Global |
7 | RSRC_Y | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_Y < p | Global |
8 | CSRC_Y | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_Y < q | Global |
9 | LLD_Y | The leading dimension of the local array | LLD_Y >= max(1,LOCp(M_Y)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incy = 1 or incy = M_X, where:
If incy = M_Y, then y is a row-distributed vector.
If incy = 1 and incy <> M_Y, then y is a column-distributed vector.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 41. Details about the square block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: global
Specified as: a fullword integer; 1 <= ia <= M_A and ia+n-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A and ja+n-1 <= N_A.
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor type | DTYPE_A=1 | Global |
2 | CTXT_A | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_A | Number of rows in the global matrix |
If n = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If n = 0: N_A >= 0 Otherwise: N_A >= 1 | Global |
5 | MB_A | Row block size | MB_A >= 1 | Global |
6 | NB_A | Column block size | NB_A >= 1 | Global |
7 | RSRC_A | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_A < p | Global |
8 | CSRC_A | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_A < q | Global |
9 | LLD_A | The leading dimension of the local array | LLD_A >= max(1,LOCp(M_A)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Returned as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 41.
None
Unable to allocate work space
If n <> 0:
If incx = M_X:
If incx = 1( <> M_X):
Otherwise:
If incy = M_Y:
If incy = 1( <> M_Y):
Otherwise:
This example computes A = alphaxyT+alphayxT+A using a 2 × 2 process grid.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO N ALPHA X IX JX DESC_X INCX Y IY JY | | | | | | | | | | | CALL PDSYR2( 'L' , 9 , 1.0D0 , X , 1 , 1 , DESC_X , 1 , Y , 1 , 1 , DESC_Y INCY A IA JA DESC_A | | | | | | DESC_Y , 1 , A , 1 , 1 , DESC_A )
| Desc_A | Desc_X | Desc_Y | ||
---|---|---|---|---|---|
DTYPE_ | 1 | 1 | 1 | ||
CTXT_ | icontxt1 | icontxt1 | icontxt1 | ||
M_ | 9 | 9 | 9 | ||
N_ | 9 | 1 | 1 | ||
MB_ | 4 | 4 | 4 | ||
NB_ | 4 | 1 | 1 | ||
RSRC_ | 0 | 0 | 0 | ||
CSRC_ | 0 | 0 | 0 | ||
LLD_ | See below2 | See below2 | See below2 | ||
|
Global symmetric matrix A of order 9 with block size 4 × 4:
B,D 0 1 2 * * | 1.0 . . . | . . . . | . | | 2.0 12.0 . . | . . . . | . | 0 | 3.0 13.0 23.0 . | . . . . | . | | 4.0 14.0 24.0 34.0 | . . . . | . | | -------------------------|---------------------------|------- | | 5.0 15.0 25.0 35.0 | 45.0 . . . | . | | 6.0 16.0 26.0 36.0 | 46.0 56.0 . . | . | 1 | 7.0 17.0 27.0 37.0 | 47.0 57.0 67.0 . | . | | 8.0 18.0 28.0 38.0 | 48.0 58.0 68.0 78.0 | . | | -------------------------|---------------------------|------- | 2 | 9.0 19.0 29.0 39.0 | 49.0 59.0 69.0 79.0 | 89.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|--------------------------------|-------------------------- | 1.0 . . . . | . . . . | 2.0 12.0 . . . | . . . . 0 | 3.0 13.0 23.0 . . | . . . . | 4.0 14.0 24.0 34.0 . | . . . . | 9.0 19.0 29.0 39.0 89.0 | 49.0 59.0 69.0 79.0 -----|--------------------------------|-------------------------- | 5.0 15.0 25.0 35.0 . | 45.0 . . . | 6.0 16.0 26.0 36.0 . | 46.0 56.0 . . 1 | 7.0 17.0 27.0 37.0 . | 47.0 57.0 67.0 . | 8.0 18.0 28.0 38.0 . | 48.0 58.0 68.0 78.0
Global vector x of size 9 × 1 with block size 4:
B,D 0 * * | 1.0 | | 1.0 | 0 | 1.0 | | 1.0 | | ---- | | 1.0 | | 1.0 | 1 | 1.0 | | 1.0 | | ---- | 2 | 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for x:
p,q | 0 -----|------ | 1.0 | 1.0 0 | 1.0 | 1.0 | 1.0 -----|------ | 1.0 | 1.0 1 | 1.0 | 1.0
Global vector y of size 9 × 1 with block size 4:
B,D 0 * * | 2.0 | | 2.0 | 0 | 2.0 | | 2.0 | | ---- | | 2.0 | | 2.0 | 1 | 2.0 | | 2.0 | | ---- | 2 | 2.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for y:
p,q | 0 -----|------ | 2.0 | 2.0 0 | 2.0 | 2.0 | 2.0 -----|------ | 2.0 | 2.0 1 | 2.0 | 2.0
Output:
Global matrix A of order 9 with block size 4 × 4:
B,D 0 1 2 * * | 5.0 . . . | . . . . | . | | 6.0 16.0 . . | . . . . | . | 0 | 7.0 17.0 27.0 . | . . . . | . | | 8.0 18.0 28.0 38.0 | . . . . | . | | -------------------------|---------------------------|------- | | 9.0 19.0 29.0 39.0 | 49.0 . . . | . | | 10.0 20.0 30.0 40.0 | 50.0 60.0 . . | . | 1 | 11.0 21.0 31.0 41.0 | 51.0 61.0 71.0 . | . | | 12.0 22.0 32.0 42.0 | 52.0 62.0 72.0 82.0 | . | | -------------------------|---------------------------|------- | 2 | 13.0 23.0 33.0 43.0 | 53.0 63.0 73.0 83.0 | 93.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 |
---|---|---|
0
2 | P00 | P01 |
1 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|--------------------------------|-------------------------- | 5.0 . . . . | . . . . | 6.0 16.0 . . . | . . . . 0 | 7.0 17.0 27.0 . . | . . . . | 8.0 18.0 28.0 38.0 . | . . . . | 13.0 23.0 33.0 43.0 93.0 | 53.0 63.0 73.0 83.0 -----|--------------------------------|-------------------------- | 9.0 19.0 29.0 39.0 . | 49.0 . . . | 10.0 20.0 30.0 40.0 . | 50.0 60.0 . . 1 | 11.0 21.0 31.0 41.0 . | 51.0 61.0 71.0 . | 12.0 22.0 32.0 42.0 . | 52.0 62.0 72.0 82.0
This subroutine computes one of the following matrix-vector products:
where, in the formulas above:
Note: | No data should be moved to form the matrix transpose; that is, the matrix should always be stored in its untransposed form. |
If n = 0, no computation is performed and the subroutine
returns after doing some parameter checking. See references [14] and [15].
A, x | Subprogram |
Long-precision real | PDTRMV |
Fortran | CALL PDTRMV (uplo, transa, diag, n, a, ia, ja, desc_a, x, ix, jx, desc_x, incx) |
C and C++ | pdtrmv (uplo, transa, diag, n, a, ia, ja, desc_a, x, ix, jx, desc_x, incx); |
If uplo = 'U', the upper triangular part is referenced.
If uplo = 'L', the lower triangular part is referenced.
Scope: global
Specified as: a single character; uplo = 'U' or 'L'.
If transa = 'N', A is used in the computation, resulting in equation 1.
If transa = 'T', AT is used in the computation, resulting in equation 2.
Scope: global
Specified as: a single character; transa = 'N' or 'T'.
If diag = 'U', A is a unit triangular matrix.
If diag = 'N', A is not a unit triangular matrix.
Scope: global
Specified as: a single character; diag = 'U' or 'N'.
Scope: global
Specified as: a fullword integer; n >= 0.
Note: | No data should be moved to form AT; that is, the matrix A should always be stored in its untransposed form. |
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 42. Details about the block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: global
Specified as: a fullword integer; 1 <= ia and ia+n-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja and ja+n-1 <= N_A.
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor type | DTYPE_A=1 | Global |
2 | CTXT_A | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_A | Number of rows in the global matrix |
If n = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If n = 0: N_A >= 0 Otherwise: M_A >= 1 | Global |
5 | MB_A | Row block size | MB_A >= 1 | Global |
6 | NB_A | Column block size | NB_A >= 1 | Global |
7 | RSRC_A | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_A < p | Global |
8 | CSRC_A | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_A < q | Global |
9 | LLD_A | The leading dimension of the local array | LLD_A >= max(1,LOCp(M_A)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Specified as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 42. Details about the block-cyclic data distribution of the global matrix X are stored in desc_x.
If incx = M_X, it indicates which row of global matrix X is used for vector x.
If incx = 1 and incx <> M_X, it is the row index of global matrix X, identifying the first element of vector x.
Scope: global
Specified as: a fullword integer; 1 <= ix <= M_X and:
If incx = 1 and incx <> M_X, then ix+n-1 <= M_X.
If incx = M_X, it is the column index of global matrix X, identifying the first element of vector x.
If incx = 1 and incx <> M_X, it indicates which column of global matrix X is used for vector x.
Scope: global
Specified as: a fullword integer; 1 <= jx <= N_X and:
If incx = M_X, then jx+n-1 <= N_X.
desc_x | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_X | Descriptor type | DTYPE_X=1 | Global |
2 | CTXT_X | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_X | Number of rows in the global matrix |
If n = 0: M_X >= 0 Otherwise: M_X >= 1 | Global |
4 | N_X | Number of columns in the global matrix |
If n = 0: N_X >= 0 Otherwise: M_X >= 1 | Global |
5 | MB_X | Row block size | MB_X >= 1 | Global |
6 | NB_X | Column block size | NB_X >= 1 | Global |
7 | RSRC_X | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_X < p | Global |
8 | CSRC_X | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_X < q | Global |
9 | LLD_X | The leading dimension of the local array | LLD_X >= max(1,LOCp(M_X)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incx = 1 or incx = M_X, where:
If incx = M_X, then x is a row-distributed vector.
If incx = 1 and incx <> M_X, then x is a column-distributed vector.
Scope: local
Returned as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 42.
None
Unable to allocate work space
If n <> 0:
If incx = M_X:
If incx = 1( <> M_X):
Otherwise:
This example computes x = Ax using a 2 × 2 process grid. It uses a global submatrix A within a global matrix A by specifying ia = 2 and ja = 2. It uses vector x, which is a column-distributed vector within a column of X, by specifying incx = 1, ix = 2, and jx = 1.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO TRANSA DIAG N A IA JA DESC_A X IX JX | | | | | | | | | | | CALL PDTRMV( 'U' , 'N' , 'N' , 12 , A , 2 , 2 , DESC_A , X , 2 , 1 , DESC_X INCX | | DESC_X , 1 )
| Desc_A | Desc_X | ||
---|---|---|---|---|
DTYPE_ | 1 | 1 | ||
CTXT_ | icontxt1 | icontxt1 | ||
M_ | 13 | 13 | ||
N_ | 13 | 1 | ||
MB_ | 3 | 3 | ||
NB_ | 3 | 3 | ||
RSRC_ | 0 | 0 | ||
CSRC_ | 0 | 0 | ||
LLD_ | See below2 | See below2 | ||
|
After the global matrix A is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix A. Following is the global submatrix A of order 12, starting at row 2 and column 2 in global triangular matrix A of order 13 with block size 3 × 3:
B,D 0 1 2 3 4 * * | . . . | . . . | . . . | . . . | . | 0 | . 1.0 2.0 | 1.0 2.0 1.0 | 1.0 3.0 1.0 | 1.0 2.0 3.0 | 2.0 | | . . 3.0 | 2.0 3.0 1.0 | 2.0 3.0 1.0 | 1.0 2.0 3.0 | 3.0 | | ----------------|------------------|------------------|------------------|------ | | . . . | 3.0 1.0 3.0 | 2.0 1.0 2.0 | 1.0 2.0 3.0 | 1.0 | 1 | . . . | . 1.0 2.0 | 2.0 1.0 1.0 | 1.0 2.0 3.0 | 2.0 | | . . . | . . 2.0 | 1.0 2.0 2.0 | 1.0 2.0 3.0 | 3.0 | | ----------------|------------------|------------------|------------------|------ | | . . . | . . . | 1.0 2.0 1.0 | 1.0 2.0 3.0 | 1.0 | 2 | . . . | . . . | . 2.0 1.0 | 1.0 2.0 3.0 | 2.0 | | . . . | . . . | . . 2.0 | 1.0 2.0 3.0 | 3.0 | | ----------------|------------------|------------------|------------------|------ | | . . . | . . . | . . . | 3.0 1.0 3.0 | 1.0 | 3 | . . . | . . . | . . . | . 2.0 2.0 | 2.0 | | . . . | . . . | . . . | . . 1.0 | 3.0 | | ----------------|------------------|------------------|------------------|------ | 4 | . . . | . . . | . . . | . . . | 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 4 | 1 3 |
---|---|---|
0
2 4 | P00 | P01 |
1
3 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|-------------------------------------|-------------------------------- | . . . . . . . | . . . . . . | . 1.0 2.0 1.0 3.0 1.0 2.0 | 1.0 2.0 1.0 1.0 2.0 3.0 | . . 3.0 2.0 3.0 1.0 3.0 | 2.0 3.0 1.0 1.0 2.0 3.0 0 | . . . 1.0 2.0 1.0 1.0 | . . . 1.0 2.0 3.0 | . . . . 2.0 1.0 2.0 | . . . 1.0 2.0 3.0 | . . . . . 2.0 3.0 | . . . 1.0 2.0 3.0 | . . . . . . 1.0 | . . . . . . -----|-------------------------------------|-------------------------------- | . . . 2.0 1.0 2.0 1.0 | 3.0 1.0 3.0 1.0 2.0 3.0 | . . . 2.0 1.0 1.0 2.0 | . 1.0 2.0 1.0 2.0 3.0 | . . . 1.0 2.0 2.0 3.0 | . . 2.0 1.0 2.0 3.0 1 | . . . . . . 1.0 | . . . 3.0 1.0 3.0 | . . . . . . 2.0 | . . . . 2.0 2.0 | . . . . . . 3.0 | . . . . . 1.0
After the global matrix X is distributed over the process grid, only a portion of the global data structure is used--that is, global vector x, which is a column-distributed vector. Following is the global vector x of size 12 × 1, starting at row 2 in 13 × 1 global matrix X with block size 3:
B,D 0 * * | . | 0 | 2.0 | | 3.0 | | ---- | | 1.0 | 1 | 2.0 | | 3.0 | | ---- | | 1.0 | 2 | 2.0 | | 3.0 | | ---- | | 1.0 | 3 | 2.0 | | 3.0 | | ---- | 4 | 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- |
---|---|---|
0
2 4 | P00 | P01 |
1
3 | P10 | P11 |
Local arrays for x:
p,q | 0 -----|------ | . | 2.0 | 3.0 0 | 1.0 | 2.0 | 3.0 | 1.0 -----|------ | 1.0 | 2.0 | 3.0 1 | 1.0 | 2.0 | 3.0
Output:
After the global matrix X is distributed over the process grid, only a portion of the global data structure is used--that is, global vector x, which is a column-distributed vector. Following is the global vector x of size 12 × 1, starting at row 2 in 13 × 1 global matrix X with block size 3:
B,D 0 * * | . | 0 | 42.0 | | 48.0 | | ----- | | 39.0 | 1 | 31.0 | | 34.0 | | ----- | | 23.0 | 2 | 23.0 | | 23.0 | | ----- | | 15.0 | 3 | 12.0 | | 6.0 | | ----- | 4 | 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- |
---|---|---|
0
2 4 | P00 | P01 |
1
3 | P10 | P11 |
Local arrays for x:
p,q | 0 -----|------- | . | 42.0 | 48.0 0 | 23.0 | 23.0 | 23.0 | 1.0 -----|------- | 39.0 | 31.0 | 34.0 1 | 15.0 | 12.0 | 6.0
This subroutine performs one of the following solves for a triangular
system of equations with a single right-hand side:
Solution | Equation |
|
---|---|---|
1. x <-- A-1x | Ax = b |
|
2. x <-- A-Tx | ATx = b |
|
where, in the formulas above:
Notes:
If n = 0, no computation is performed and the subroutine
returns after doing some parameter checking. See references [14] and [15].
A, x | Subprogram |
Long-precision real | PDTRSV |
Fortran | CALL PDTRSV (uplo, transa, diag, n, a, ia, ja, desc_a, x, ix, jx, desc_x, incx) |
C and C++ | pdtrsv (uplo, transa, diag, n, a, ia, ja, desc_a, x, ix, jx, desc_x, incx); |
If uplo = 'U', the upper triangular part is referenced.
If uplo = 'L', the lower triangular part is referenced.
Scope: global
Specified as: a single character; uplo = 'U' or 'L'.
If transa = 'N', A is used in the system of equations, resulting in solution 1.
If transa = 'T', AT is used in the system of equations, resulting in solution 2.
Scope: global
Specified as: a single character; transa = 'N' or 'T'.
If diag = 'U', A is a unit triangular matrix.
If diag = 'N', A is not a unit triangular matrix.
Scope: global
Specified as: a single character; diag = 'U' or 'N'.
Scope: global
Specified as: a fullword integer; n >= 0.
Note: | No data should be moved to form AT; that is, the matrix A should always be stored in its untransposed form. |
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 43. Details about the block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: global
Specified as: a fullword integer; 1 <= ia and ia+n-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja and ja+n-1 <= N_A.
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor type | DTYPE_A=1 | Global |
2 | CTXT_A | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_A | Number of rows in the global matrix |
If n = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If n = 0: N_A >= 0 Otherwise: M_A >= 1 | Global |
5 | MB_A | Row block size | MB_A >= 1 | Global |
6 | NB_A | Column block size | NB_A >= 1 | Global |
7 | RSRC_A | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_A < p | Global |
8 | CSRC_A | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_A < q | Global |
9 | LLD_A | The leading dimension of the local array | LLD_A >= max(1,LOCp(M_A)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Specified as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 43. Details about the block-cyclic data distribution of the global matrix X are stored in desc_x.
If incx = M_X, it indicates which row of global matrix X is used for vector x.
If incx = 1 and incx <> M_X, it is the row index of global matrix X, identifying the first element of vector x.
Scope: global
Specified as: a fullword integer; 1 <= ix <= M_X and:
If incx = 1 and incx <> M_X, then ix+n-1 <= M_X.
If incx = M_X, it is the column index of global matrix X, identifying the first element of vector x.
If incx = 1 and incx <> M_X, it indicates which column of global matrix X is used for vector x.
Scope: global
Specified as: a fullword integer; 1 <= jx <= N_X and:
If incx = M_X, then jx+n-1 <= N_X.
desc_x | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_X | Descriptor type | DTYPE_X=1 | Global |
2 | CTXT_X | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_X | Number of rows in the global matrix |
If n = 0: M_X >= 0 Otherwise: M_X >= 1 | Global |
4 | N_X | Number of columns in the global matrix |
If n = 0: N_X >= 0 Otherwise: M_X >= 1 | Global |
5 | MB_X | Row block size | MB_X >= 1 | Global |
6 | NB_X | Column block size | NB_X >= 1 | Global |
7 | RSRC_X | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_X < p | Global |
8 | CSRC_X | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_X < q | Global |
9 | LLD_X | The leading dimension of the local array | LLD_X >= max(1,LOCp(M_X)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incx = 1 or incx = M_X, where:
If incx = M_X, then x is a row-distributed vector.
If incx = 1 and incx <> M_X, then x is a column-distributed vector.
Scope: local
Returned as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 43.
None
Unable to allocate work space
If n <> 0:
If incx = M_X:
If incx = 1( <> M_X):
Otherwise:
This example solves x <-- A-1x using a 2 × 2 process grid, where A is a unit triangular matrix. It uses a global submatrix A within a global matrix A by specifying ia = 2 and ja = 2. It uses vector x, which is a row-distributed vector within a row of global matrix X, by specifying specifying incx = M_X = 1, ix = 1, and jx = 2.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO TRANSA DIAG N A IA JA DESC_A X IX JX | | | | | | | | | | | CALL PDTRSV( 'L' , 'N' , 'U' , 12 , A , 2 , 2 , DESC_A , X , 1 , 2 , DESC_X INCX | | DESC_X , 1 )
| Desc_A | Desc_X | ||
---|---|---|---|---|
DTYPE_ | 1 | 1 | ||
CTXT_ | icontxt1 | icontxt1 | ||
M_ | 13 | 1 | ||
N_ | 13 | 13 | ||
MB_ | 3 | 3 | ||
NB_ | 3 | 3 | ||
RSRC_ | 0 | 0 | ||
CSRC_ | 0 | 0 | ||
LLD_ | See below2 | See below2 | ||
|
After the global matrix A is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix A. Following is the global submatrix A of order 12, starting at row 2 and column 2 in global triangular matrix A of order 13 with block size 3 × 3:
B,D 0 1 2 3 4 * * | . . . | . . . | . . . | . . . | . | 0 | . 1.0 . | . . . | . . . | . . . | . | | . 2.0 1.0 | . . . | . . . | . . . | . | | ----------------|------------------|------------------|------------------|------ | | . 3.0 2.0 | 1.0 . . | . . . | . . . | . | 1 | . 1.0 3.0 | 2.0 1.0 . | . . . | . . . | . | | . 2.0 1.0 | 3.0 2.0 1.0 | . . . | . . . | . | | ----------------|------------------|------------------|------------------|------ | | . 3.0 2.0 | 1.0 3.0 2.0 | 1.0 . . | . . . | . | 2 | . 1.0 3.0 | 2.0 1.0 3.0 | 2.0 1.0 . | . . . | . | | . 2.0 1.0 | 3.0 2.0 1.0 | 3.0 2.0 1.0 | . . . | . | | ----------------|------------------|------------------|------------------|------ | | . 3.0 2.0 | 1.0 3.0 2.0 | 1.0 3.0 2.0 | 1.0 . . | . | 3 | . 1.0 3.0 | 2.0 1.0 3.0 | 2.0 1.0 3.0 | 2.0 1.0 . | . | | . 2.0 1.0 | 3.0 2.0 1.0 | 3.0 2.0 1.0 | 3.0 2.0 1.0 | . | | ----------------|------------------|------------------|------------------|------ | 4 | . 3.0 2.0 | 1.0 3.0 2.0 | 1.0 3.0 2.0 | 1.0 3.0 2.0 | 1.0 | * *
Note: | Because matrix A is unit triangular, the diagonal elements are not referenced. This subroutine assumes a value of 1.0 for the diagonal elements. |
The following is the 2 × 2 process grid:
B,D | 0 2 4 | 1 3 |
---|---|---|
0
2 4 | P00 | P01 |
1
3 | P10 | P11 |
Local arrays for A:
p,q | 0 | 1 -----|------------------------------------|-------------------------------- | . . . . . . . | . . . . . . | . . . . . . . | . . . . . . | . 2.0 . . . . . | . . . . . . 0 | . 3.0 2.0 . . . . | 1.0 3.0 2.0 . . . | . 1.0 3.0 2.0 . . . | 2.0 1.0 3.0 . . . | . 2.0 1.0 3.0 2.0 . . | 3.0 2.0 1.0 . . . | . 3.0 2.0 1.0 3.0 2.0 . | 1.0 3.0 2.0 1.0 3.0 2.0 -----|------------------------------------|-------------------------------- | . 3.0 2.0 . . . . | . . . . . . | . 1.0 3.0 . . . . | 2.0 . . . . . | . 2.0 1.0 . . . . | 3.0 2.0 . . . . 1 | . 3.0 2.0 1.0 3.0 2.0 . | 1.0 3.0 2.0 . . . | . 1.0 3.0 2.0 1.0 3.0 . | 2.0 1.0 3.0 2.0 . . | . 2.0 1.0 3.0 2.0 1.0 . | 3.0 2.0 1.0 3.0 2.0 .
After the global matrix X is distributed over the process grid, only a portion of the global data structure is used--that is, global vector x, which is a row-distributed vector. Following is the global vector x of size 1 × 12, starting at row 1 and column 2 in 1 × 13 global matrix X with block size 3:
B,D 0 1 2 3 4 * * 0 | . 2.0 7.0 | 13.0 15.0 17.0 | 26.0 28.0 27.0 | 39.0 41.0 37.0 | 52.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 4 | 1 3 |
---|---|---|
0 | P00 | P01 |
-- | P10 | P11 |
Local arrays for x:
p,q | 0 | 1 -----|-------------------------------------|-------------------------------- 0 | . 2.0 7.0 26.0 28.0 27.0 52.0 | 13.0 15.0 17.0 39.0 41.0 37.0
Output:
After the global matrix X is distributed over the process grid, only a portion of the global data structure is used--that is, global vector x, which is a row-distributed vector. Following is the global vector x of size 1 × 12, starting at row 1 and column 2 in 1 × 13 global matrix X with block size 3:
B,D 0 1 2 3 4 * * 0 | . 2.0 3.0 | 1.0 2.0 3.0 | 1.0 2.0 3.0 | 1.0 2.0 3.0 | 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 4 | 1 3 |
---|---|---|
0 | P00 | P01 |
-- | P10 | P11 |
Local arrays for x:
p,q | 0 | 1 -----|-------------------------------------|-------------------------------- 0 | . 2.0 3.0 1.0 2.0 3.0 1.0 | 1.0 2.0 3.0 1.0 2.0 3.0