PDSYRK and PZSYRK compute one of the following rank-k updates:
PZHERK computes one of the following rank-k updates:
where, in the formulas above:
and:
In the following two cases, no computation is performed and the subroutine returns after doing some parameter checking:
A, C | alpha, beta | Subprogram |
Long-precision real | Long-precision real | PDSYRK |
Long-precision complex | Long-precision complex | PZSYRK |
Long-precision complex | Long-precision real | PZHERK |
Fortran | CALL PDSYRK | PZSYRK | PZHERK (uplo, trans, n, k, alpha, a, ia, ja, desc_a, beta, c, ic, jc, desc_c) |
C and C++ | pdsyrk | pzsyrk | pzherk (uplo, trans, n, k, alpha, a, ia, ja, desc_a, beta, c, ic, jc, desc_c); |
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 trans = 'N', A is used.
If trans = 'T', AT is used.
If trans = 'C', AH is used.
Scope: global
Specified as: a single character, where:
For PDSYRK, it must be 'N', 'T', or 'C'.
For PZSYRK, it must be 'N' or 'T'.
For PZHERK, it must be 'N' or 'C'.
If trans = 'N', it is the number of rows in submatrix A used in the computation.
If trans = 'T' or 'C', it is the number of columns in submatrix A used in the computation.
Scope: global
Specified as: a fullword integer; n >= 0.
If trans = 'N', it is the number of columns in submatrix A used in the computation.
If trans = 'T' or 'C', it is the number of rows in submatrix A used in the computation.
Scope: global
Specified as: a fullword integer; k >= 0.
Scope: global
Specified as: a number of the data type indicated in Table 51.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 51. 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:
If trans = 'N', then ia+n-1 <= M_A.
If trans = 'T' or 'C', then ia+k-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A, and:
If trans = 'N', then ja+k-1 <= N_A.
If trans = 'T' or 'C', then 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 or k = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If n = 0 or k = 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: global
Specified as: a number of the data type indicated in Table 51.
When beta is zero, C need not be set on input.
Scope: local
Specified as: an LLD_C by (at least) LOCq(N_C) array, containing numbers of the data type indicated in Table 51. Details about the block-cyclic data distribution of global matrix C are stored in desc_c.
Scope: global
Specified as: a fullword integer; 1 <= ic <= M_C and ic+n-1 <= M_C.
Scope: global
Specified as: a fullword integer; 1 <= jc <= N_C and jc+n-1 <= N_C.
desc_c | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_C | Descriptor type | DTYPE_C=1 | Global |
2 | CTXT_C | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_C | Number of rows in the global matrix |
If n = 0: M_C >= 0 Otherwise: M_C >= 1 | Global |
4 | N_C | Number of columns in the global matrix |
If n = 0: N_C >= 0 Otherwise: N_C >= 1 | Global |
5 | MB_C | Row block size | MB_C >= 1 | Global |
6 | NB_C | Column block size | NB_C >= 1 | Global |
7 | RSRC_C | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_C < p | Global |
8 | CSRC_C | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_C < q | Global |
9 | LLD_C | The leading dimension of the local array | LLD_C >= max(1,LOCp(M_C)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Returned as: an LLD_C by (at least) LOCq(N_C) array, containing numbers of the data type indicated in Table 51.
then:
None
Unable to allocate work space
If n <> 0 and k <> 0:
If n <> 0:
and NB_C <> MB_C.
If C is not contained within a single block:
If C is contained within a single block:
This example computes C = alphaAAT+betaC using a 2 × 3 process grid.
ORDER = 'R' NPROW = 2 NPCOL = 3 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO TRANS N K ALPHA A IA JA DESC_A BETA | | | | | | | | | | CALL PDSYRK( 'L' , 'N' , 8 , 5 , 1.0D0 , A , 1 , 1 , DESC_A , 1.0D0 , C IC JC DESC_C | | | | C , 1 , 1 , DESC_C )
| Desc_A | Desc_C |
---|---|---|
DTYPE_ | 1 | 1 |
CTXT_ | icontxt(IOBG26) | icontxt(IOBG26) |
M_ | 8 | 8 |
N_ | 5 | 8 |
MB_ | 2 | 2 |
NB_ | 2 | 2 |
RSRC_ | 0 | 0 |
CSRC_ | 0 | 0 |
LLD_ | See below(EPSSL26) | See below(EPSSL26) |
Notes: |
Global general 8 × 5 matrix A with block size 2 × 2:
B,D 0 1 2 * * 0 | 0.0 8.0 | 16.0 24.0 | 32.0 | | 1.0 9.0 | 17.0 25.0 | 33.0 | | --------------|----------------|------- | 1 | 2.0 10.0 | 18.0 26.0 | 34.0 | | 3.0 11.0 | 19.0 27.0 | 35.0 | | --------------|----------------|------- | 2 | 4.0 12.0 | 20.0 28.0 | 36.0 | | 5.0 13.0 | 21.0 29.0 | 37.0 | | --------------|----------------|------- | 3 | 6.0 14.0 | 22.0 30.0 | 38.0 | | 7.0 15.0 | 23.0 31.0 | 39.0 | * *
The following is the 2 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02 2 | | | -----| ------- | ------- |------- 1 | P10 | P11 | P12 3 | | |
Local arrays for A:
p,q | 0 | 1 | 2 -----|-------------|----------------|-------- | 0.0 8.0 | 16.0 24.0 | 32.0 | 1.0 9.0 | 17.0 25.0 | 33.0 0 | 4.0 12.0 | 20.0 28.0 | 36.0 | 5.0 13.0 | 21.0 29.0 | 37.0 -----|-------------|----------------|-------- | 2.0 10.0 | 18.0 26.0 | 34.0 | 3.0 11.0 | 19.0 27.0 | 35.0 1 | 6.0 14.0 | 22.0 30.0 | 38.0 | 7.0 15.0 | 23.0 31.0 | 39.0
Global real symmetric matrix C of order 8 block size 2 × 2:
B,D 0 1 2 3 * * 0 | 0.0 . | . . | . . | . . | | 1.0 8.0 | . . | . . | . . | | -------------|---------------|---------------|------------- | 1 | 2.0 9.0 | 15.0 . | . . | . . | | 3.0 10.0 | 16.0 21.0 | . . | . . | | -------------|---------------|---------------|------------- | 2 | 4.0 11.0 | 17.0 22.0 | 26.0 . | . . | | 5.0 12.0 | 18.0 23.0 | 27.0 30.0 | . . | | -------------|---------------|---------------|------------- | 3 | 6.0 13.0 | 19.0 24.0 | 28.0 31.0 | 33.0 . | | 7.0 14.0 | 20.0 25.0 | 29.0 32.0 | 34.0 35.0 | * *
The following is the 2 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02 2 | | | -----| ------- | ------- |------- 1 | P10 | P11 | P12 3 | | |
Local arrays for C:
p,q | 0 | 1 | 2 -----|--------------------------|---------------|-------------- | 0.0 . . . | . . | . . | 1.0 8.0 . . | . . | . . 0 | 4.0 11.0 . . | 17.0 22.0 | 26.0 . | 5.0 12.0 . . | 18.0 23.0 | 27.0 30.0 -----|--------------------------|---------------|-------------- | 2.0 9.0 . . | 15.0 . | . . | 3.0 10.0 . . | 16.0 21.0 | . . 1 | 6.0 13.0 33.0 . | 19.0 24.0 | 28.0 31.0 | 7.0 14.0 34.0 35.0 | 20.0 25.0 | 29.0 32.0
Output:
Global real symmetric matrix C of order 8 with block size 2 × 2:
B,D 0 1 2 3 * * 0 | 1920.0 . | . . | . . | . . | | 2001.0 2093.0 | . . | . . | . . | | -----------------|-------------------|-------------------|----------------- | 1 | 2082.0 2179.0 | 2275.0 . | . . | . . | | 2163.0 2265.0 | 2366.0 2466.0 | . . | . . | | -----------------|-------------------|-------------------|----------------- | 2 | 2244.0 2351.0 | 2457.0 2562.0 | 2666.0 . | . . | | 2325.0 2437.0 | 2548.0 2658.0 | 2767.0 2875.0 | . . | | -----------------|-------------------|-------------------|----------------- | 3 | 2406.0 2523.0 | 2639.0 2754.0 | 2868.0 2981.0 | 3093.0 . | | 2487.0 2609.0 | 2730.0 2850.0 | 2969.0 3087.0 | 3204.0 3320.0 | * *
The following is the 2 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02 2 | | | -----| ------- | ------- |------- 1 | P10 | P11 | P12 3 | | |
Local arrays for C:
p,q | 0 | 1 | 2 -----|----------------------------------|-------------------|------------------ | 1920.0 . . . | . . | . . | 2001.0 2093.0 . . | . . | . . 0 | 2244.0 2351.0 . . | 2457.0 2562.0 | 2666.0 . | 2325.0 2437.0 . . | 2548.0 2658.0 | 2767.0 2875.0 -----|----------------------------------|-------------------|------------------ | 2082.0 2179.0 . . | 2275.0 . | . . | 2163.0 2265.0 . . | 2366.0 2466.0 | . . 1 | 2406.0 2523.0 3093.0 . | 2639.0 2754.0 | 2868.0 2981.0 | 2487.0 2609.0 3204.0 3320.0 | 2730.0 2850.0 | 2969.0 3087.0
This example computes C = alphaAAT+betaC using a 2 × 3 process grid.
ORDER = 'R' NPROW = 2 NPCOL = 3 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO TRANS N K ALPHA A IA JA DESC_A BETA | | | | | | | | | | CALL PZSYRK( 'U' , 'N' , 3 , 5 , ALPHA , A , 1 , 1 , DESC_A , BETA , C IC JC DESC_C | | | | C , 1 , 1 , DESC_C ) ALPHA = (1.0, 1.0) BETA = (1.0, 1.0)
| Desc_A | Desc_C |
---|---|---|
DTYPE_ | 1 | 1 |
CTXT_ | icontxt(IOBG27) | icontxt(IOBG27) |
M_ | 3 | 3 |
N_ | 5 | 3 |
MB_ | 2 | 2 |
NB_ | 2 | 2 |
RSRC_ | 0 | 0 |
CSRC_ | 0 | 0 |
LLD_ | See below(EPSSL27) | See below(EPSSL27) |
Notes: |
Global general 3 × 5 matrix A with block size 2 × 2:
B,D 0 1 2 * * 0 | (2.0,0.0) (3.0,2.0) | (4.0,1.0) (1.0,7.0) | (0.0,0.0) | | (30.,3.0) (8.0,0.0) | (2.0,5.0) (2.0,4.0) | (1.0,2.0) | | --------------------|---------------------|---------- | 1 | (1.0,3.0) (2.0,1.0) | (6.0,0.0) (3.0,2.0) | (2.0,2.0) | * *
The following is the 2 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02 -----| ------- | ------- |------- 1 | P10 | P11 | P12
Local arrays for A:
p,q | 0 | 1 | 2 -----|---------------------|---------------------|----------- | (2.0,0.0) (3.0,2.0) | (4.0,1.0) (1.0,7.0) | (0.0,0.0) 0 | (3.0,3.0) (8.0,0.0) | (2.0,5.0) (2.0,4.0) | (1.0,2.0) -----|---------------------|---------------------|----------- 1 | (1.0,3.0) (2.0,1.0) | (6.0,0.0) (3.0,2.0) | (2.0,2.0)
Global complex symmetric matrix C of order 3 with block size 2 × 2:
B,D 0 1 * * 0 | (2.0,1.0) (1.0,9.0) | (4.0,5.0) | | . (3.0,1.0) | (6.0,7.0) | | --------------------|---------- | 1 | . . | (8.0,1.0) | * *
The following is the 2 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02 -----| ------- | ------- |------- 1 | P10 | P11 | P12
Local arrays for C:
p,q | 0 | 1 | 2 -----|---------------------|-----------|----------- | (2.0,1.0) (1.0,9.0) | (4.0,5.0) | . 0 | . (3.0,1.0) | (6.0,7.0) | . -----|---------------------|-----------|----------- 1 | . . | (8.0,1.0) | .
Output:
Global complex symmetric matrix C of order 3 with block size 2 × 2:
B,D 0 1 * * 0 | (-57.0, 13.0) (-63.0, 79.0) | (-24.0, 70.0) | | . (-28.0, 90.0) | (-55.0,103.0) | | ----------------------------|---------------| 1 | . . | ( 13.0, 75.0) | * *
The following is the 2 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02 -----| ------- | ------- |------- 1 | P10 | P11 | P12
Local arrays for C:
p,q | 0 | 1 | 2 -----|-----------------------------|---------------|--------------- | (-57.0, 13.0) (-63.0, 79.0) | (-24.0, 70.0) | . 0 | . (-28.0, 90.0) | (-55.0,103.0) | . -----|-----------------------------|---------------|--------------- 1 | . . | ( 13.0, 75.0) | .
This example computes C = alphaAHA+betaC using a 3 × 2 process grid.
ORDER = 'R' NPROW = 3 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO TRANS N K ALPHA A IA JA DESC_A BETA | | | | | | | | | | CALL PZHERK( 'L' , 'C' , 3 , 5 , ALPHA , A , 1 , 1 , DESC_A , BETA , C IC JC DESC_C | | | | C , 1 , 1 , DESC_C ) ALPHA = 1.0 BETA = 1.0
| Desc_A | Desc_C |
---|---|---|
DTYPE_ | 1 | 1 |
CTXT_ | icontxt(IOBG28) | icontxt(IOBG28) |
M_ | 5 | 3 |
N_ | 3 | 3 |
MB_ | 2 | 2 |
NB_ | 2 | 2 |
RSRC_ | 0 | 0 |
CSRC_ | 0 | 0 |
LLD_ | See below(EPSSL28) | See below(EPSSL28) |
Notes:
|
Global general 5 × 3 matrix A with block size 2 × 2:
B,D 0 1 * * 0 | (2.0,0.0) (3.0,2.0) | (4.0,1.0) | | (3.0,3.0) (8.0,0.0) | (2.0,5.0) | | --------------------|-----------| 1 | (1.0,3.0) (2.0,1.0) | (6.0,0.0) | | (3.0,3.0) (8.0,0.0) | (2.0,5.0) | | --------------------|-----------| 2 | (1.0,9.0) (3.0,0.0) | (6.0,7.0) | * *
The following is the 3 × 2 process grid:
B,D | 0 | 1 -----| ------- |----- 0 | P00 | P01 -----| ------- |----- 1 | P10 | P11 -----| ------- |----- 2 | P20 | P21
Local arrays for A:
p,q | 0 | 1 | -----|---------------------|-----------| | (2.0,0.0) (3.0,2.0) | (4.0,1.0) | 0 | (3.0,3.0) (8.0,0.0) | (2.0,5.0) | -----|---------------------|-----------| | (1.0,3.0) (2.0,1.0) | (6.0,0.0) | 1 | (3.0,3.0) (8.0,0.0) | (2.0,5.0) | -----|---------------------|-----------| 2 | (1.0,9.0) (3.0,0.0) | (6.0,7.0) | -----|---------------------|-----------|
Global complex Hermitian matrix C of order 3 with block size 2 × 2:
B,D 0 1 * * 0 | (6.0,0.0) . | . | | (3.0,4.0) (10.0,0.0) | . | | ---------------------|-----------| 1 | (9.0,1.0) (12.0,2.0) | (3.0,0.0) | * *
The following is the 3 × 2 process grid:
B,D | 0 | 1 -----| ------- |----- 0 | P00 | P01 -----| ------- |----- 1 | P10 | P11 -----| ------- |----- -- | P20 | P21
Local arrays for C:
p,q | 0 | 1 | -----|----------------------|-----------| | (6.0, . ) . | . | 0 | (3.0,4.0) (10.0, . ) | . | -----|----------------------|-----------| 1 | (9.0,1.0) (12.0,2.0) | (3.0, . ) | -----|----------------------|-----------| 2 | . . | . |
Output:
Global complex Hermitian matrix C of order 3 with block size 2 × 2:
B,D 0 1 * * 0 | (138.0, 0.0) . | . | | ( 65.0, 80.0) (165.0, 0.0) | . | | ----------------------------|---------------| 1 | (134.0, 46.0) ( 88.0,-88.0) | (199.0, 0.0) | * *
The following is the 3 × 2 process grid:
B,D | 0 | 1 -----| ------- |----- 0 | P00 | P01 -----| ------- |----- 1 | P10 | P11 -----| ------- |----- -- | P20 | P21
Local arrays for C:
p,q | 0 | 1 | -----|-----------------------------|---------------| | (138.0, 0.0) . | . | 0 | ( 65.0, 80.0) (165.0, 0.0) | . | -----|-----------------------------|---------------| 1 | (134.0, 46.0) ( 88.0,-88.0) | (199.0, 0.0) | -----|-----------------------------|---------------| 2 | . . | . |