PDGER and PZGERU compute the following rank-one update:
PZGERC computes the following rank-one update:
where, in the formula above:
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 |
Long-precision complex | PZGERC and PZGERU |
Fortran | CALL PDGER | PZGERC | PZGERU (m, n, alpha, x, ix, jx, desc_x, incx, y, iy, jy, desc_y, incy, a, ia, ja, desc_a) |
C and C++ | pdger | pzgerc | pzgeru (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.
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 = 1, 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_ | icontxt(IOBGC7) | icontxt(IOBGC7) | icontxt(IOBGC7) |
M_ | 10 | 11 | 1 |
N_ | 10 | 1 | 11 |
MB_ | 4 | 4 | 1 |
NB_ | 4 | 1 | 4 |
RSRC_ | 0 | 0 | 0 |
CSRC_ | 0 | 0 | 0 |
LLD_ | See below(EPSSLA7) | See below(EPSSLA7) | See below(EPSSLA7) |
Notes:
|
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 | P00 | P01 2 | | -----| ------- |----- 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 × 1:
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 | P00 | P01 2 | | -----| ------- |----- 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 1 × 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 |8 | . 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 | P00 | P01 2 | | -----| ------- |----- 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 example computes A = alphaxyH+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 = 1, 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 PZGERC( 9 , 9 , ALPHA , 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 ) ALPHA = (1.0, -1.0)
| Desc_A | Desc_X | Desc_Y |
---|---|---|---|
DTYPE_ | 1 | 1 | 1 |
CTXT_ | icontxt(IOBGC8) | icontxt(IOBGC8) | icontxt(IOBGC8) |
M_ | 10 | 11 | 1 |
N_ | 10 | 1 | 11 |
MB_ | 4 | 4 | 1 |
NB_ | 4 | 1 | 4 |
RSRC_ | 0 | 0 | 0 |
CSRC_ | 0 | 0 | 0 |
LLD_ | See below(EPSSLA8) | See below(EPSSLA8) | See below(EPSSLA8) |
Notes:
|
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, 2.0) (22.0, 1.0) (32.0, 0.0) | (42.0,-1.0) (52.0,-2.0) (62.0, 2.0) (72.0, 1.0) | (82.0, 0.0) ( 92.0,-1.0) | 0 | . (13.0, 2.0) (23.0, 1.0) (33.0, 0.0) | (43.0,-1.0) (53.0,-2.0) (63.0, 2.0) (73.0, 1.0) | (83.0, 0.0) ( 93.0,-1.0) | | . (14.0, 2.0) (24.0, 1.0) (34.0, 0.0) | (44.0,-1.0) (54.0,-2.0) (64.0, 2.0) (74.0, 1.0) | (84.0, 0.0) ( 94.0,-1.0) | | -------------------------------------------|-------------------------------------------------|------------------------- | | . (15.0, 2.0) (25.0, 1.0) (35.0, 0.0) | (45.0,-1.0) (55.0,-2.0) (65.0, 2.0) (75.0, 1.0) | (85.0, 0.0) ( 95.0,-1.0) | | . (16.0, 2.0) (26.0, 1.0) (36.0, 0.0) | (46.0,-1.0) (56.0,-2.0) (66.0, 2.0) (76.0, 1.0) | (86.0, 0.0) ( 96.0,-1.0) | 1 | . (17.0, 2.0) (27.0, 1.0) (37.0, 0.0) | (47.0,-1.0) (57.0,-2.0) (67.0, 2.0) (77.0, 1.0) | (87.0, 0.0) ( 97.0,-1.0) | | . (18.0, 2.0) (28.0, 1.0) (38.0, 0.0) | (48.0,-1.0) (58.0,-2.0) (68.0, 2.0) (78.0, 1.0) | (88.0, 0.0) ( 98.0,-1.0) | | -------------------------------------------|-------------------------------------------------|------------------------- | 2 | . (19.0, 2.0) (29.0, 1.0) (39.0, 0.0) | (49.0,-1.0) (59.0,-2.0) (69.0, 2.0) (79.0, 1.0) | (89.0, 0.0) ( 99.0,-1.0) | | . (20.0, 2.0) (30.0, 1.0) (40.0, 0.0) | (50.0,-1.0) (60.0,-2.0) (70.0, 2.0) (80.0, 1.0) | (90.0, 0.0) (100.0,-1.0) | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for A:
p,q | 0 | 1 -----|---------------------------------------------------------------------|------------------------------------------------- | . . . . . . | . . . . | . (12.0, 2.0) (22.0, 1.0) (32.0, 0.0) (82.0, 0.0) ( 92.0,-1.0) | (42.0,-1.0) (52.0,-2.0) (62.0, 2.0) (72.0, 1.0) | . (13.0, 2.0) (23.0, 1.0) (33.0, 0.0) (83.0, 0.0) ( 93.0,-1.0) | (43.0,-1.0) (53.0,-2.0) (63.0, 2.0) (73.0, 1.0) 0 | . (14.0, 2.0) (24.0, 1.0) (34.0, 0.0) (84.0, 0.0) ( 94.0,-1.0) | (44.0,-1.0) (54.0,-2.0) (64.0, 2.0) (74.0, 1.0) | . (19.0, 2.0) (29.0, 1.0) (39.0, 0.0) (89.0, 0.0) ( 99.0,-1.0) | (49.0,-1.0) (59.0,-2.0) (69.0, 2.0) (79.0, 1.0) | . (20.0, 2.0) (30.0, 1.0) (40.0, 0.0) (90.0, 0.0) (100.0,-1.0) | (50.0,-1.0) (60.0,-2.0) (70.0, 2.0) (80.0, 1.0) -----|---------------------------------------------------------------------|------------------------------------------------- | . (15.0, 2.0) (25.0, 1.0) (35.0, 0.0) (85.0, 0.0) ( 95.0,-1.0) | (45.0,-1.0) (55.0,-2.0) (65.0, 2.0) (75.0, 1.0) | . (16.0, 2.0) (26.0, 1.0) (36.0, 0.0) (86.0, 0.0) ( 96.0,-1.0) | (46.0,-1.0) (56.0,-2.0) (66.0, 2.0) (76.0, 1.0) 1 | . (17.0, 2.0) (27.0, 1.0) (37.0, 0.0) (87.0, 0.0) ( 97.0,-1.0) | (47.0,-1.0) (57.0,-2.0) (67.0, 2.0) (77.0, 1.0) | . (18.0, 2.0) (28.0, 1.0) (38.0, 0.0) (88.0, 0.0) ( 98.0,-1.0) | (48.0,-1.0) (58.0,-2.0) (68.0, 2.0) (78.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 9 × 1, starting at row 2 and column 1 in 11 × 1 global matrix X with block size 4 × 1:
B,D 0 * * | . | | (1.0, 4.0) | 0 | (1.0, 3.0) | | (1.0, 2.0) | | ---------- | | (1.0, 1.0) | | (1.0, 0.0) | 1 | (1.0,-1.0) | | (1.0,-2.0) | | ---------- | | (1.0,-3.0) | 2 | (1.0,-4.0) | | . | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for x:
p,q | 0 -----|------------ | . | (1.0, 4.0) | (1.0, 3.0) 0 | (1.0, 2.0) | (1.0,-3.0) | (1.0,-4.0) | . -----|------------ | (1.0, 1.0) | (1.0, 0.0) 1 | (1.0,-1.0) | (1.0,-2.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 1 × 4:
B,D 0 1 2 * * 0 | . (2.0, 1.0) (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (6.0, 1.0) (7.0, 1.0) (8.0, 1.0) | (9.0, 1.0) (10.0, 1.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, 1.0) (3.0, 1.0) (4.0, 1.0) (9.0, 1.0) (10.0, 1.0) . | (5.0, 1.0) (6.0, 1.0) (7.0, 1.0) (8.0, 1.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 * * | . . . . | . . . . | . . | | . (25.0, 3.0) (40.0, 5.0) (55.0, 7.0)| (70.0, 9.0) (85.0, 11.0) (100.0, 18.0) (115.0, 20.0)| (130.0, 22.0) (145.0, 24.0)| 0 | . (23.0, 2.0) (37.0, 3.0) (51.0, 4.0)| (65.0, 5.0) (79.0, 6.0) ( 93.0, 12.0) (107.0, 13.0)| (121.0, 14.0) (135.0, 15.0)| | . (21.0, 1.0) (34.0, 1.0) (47.0, 1.0)| (60.0, 1.0) (73.0, 1.0) ( 86.0, 6.0) ( 99.0, 6.0)| (112.0, 6.0) (125.0, 6.0)| |-----------------------------------------|------------------------------------------------------|----------------------------| | . (19.0, 0.0) (31.0, -1.0) (43.0, -2.0)| (55.0, -3.0) (67.0, -4.0) ( 79.0, 0.0) ( 91.0, -1.0)| (103.0, -2.0) (115.0, -3.0)| | . (17.0, -1.0) (28.0, -3.0) (39.0, -5.0)| (50.0, -7.0) (61.0, -9.0) ( 72.0, -6.0) ( 83.0, -8.0)| ( 94.0,-10.0) (105.0,-12.0)| 1 | . (15.0, -2.0) (25.0, -5.0) (35.0, -8.0)| (45.0,-11.0) (55.0,-14.0) ( 65.0,-12.0) ( 75.0,-15.0)| ( 85.0,-18.0) ( 95.0,-21.0)| | . (13.0, -3.0) (22.0, -7.0) (31.0,-11.0)| (40.0,-15.0) (49.0,-19.0) ( 58.0,-18.0) ( 67.0,-22.0)| ( 76.0,-26.0) ( 85.0,-30.0)| |-----------------------------------------|------------------------------------------------------|----------------------------| 2 | . (11.0, -4.0) (19.0, -9.0) (27.0,-14.0)| (35.0,-19.0) (43.0,-24.0) ( 51.0,-24.0) ( 59.0,-29.0)| ( 67.0,-34.0) ( 75.0,-39.0)| | . ( 9.0, -5.0) (16.0,-11.0) (23.0,-17.0)| (30.0,-23.0) (37.0,-29.0) ( 44.0,-30.0) ( 51.0,-36.0)| ( 58.0,-42.0) ( 65.0,-48.0)| * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for A:
p,q | 0 | 1 ----|-----------------------------------------------------------------------|------------------------------------------------------ | . . . . . . | . . . . | . (25.0, 3.0) (40.0, 5.0) (55.0, 7.0) (130.0, 22.0) (145.0, 24.0) | (70.0, 9.0) (85.0, 11.0) (100.0, 18.0) (115.0, 20.0) | . (23.0, 2.0) (37.0, 3.0) (51.0, 4.0) (121.0, 14.0) (135.0, 15.0) | (65.0, 5.0) (79.0, 6.0) ( 93.0, 12.0) (107.0, 13.0) 0 | . (21.0, 1.0) (34.0, 1.0) (47.0, 1.0) (112.0, 6.0) (125.0, 6.0) | (60.0, 1.0) (73.0, 1.0) ( 86.0, 6.0) ( 99.0, 6.0) | . (11.0, -4.0) (19.0, -9.0) (27.0,-14.0) ( 67.0,-34.0) ( 75.0,-39.0) | (35.0,-19.0) (43.0,-24.0) ( 51.0,-24.0) ( 59.0,-29.0) | . ( 9.0, -5.0) (16.0,-11.0) (23.0,-17.0) ( 58.0,-42.0) ( 65.0,-48.0) | (30.0,-23.0) (37.0,-29.0) ( 44.0,-30.0) ( 51.0,-36.0) ----|-----------------------------------------------------------------------|------------------------------------------------------ | . (19.0, 0.0) (31.0, -1.0) (43.0, -2.0) (103.0, -2.0) (115.0, -3.0) | (55.0, -3.0) (67.0, -4.0) ( 79.0, 0.0) ( 91.0, -1.0) | . (17.0, -1.0) (28.0, -3.0) (39.0, -5.0) ( 94.0,-10.0) (105.0,-12.0) | (50.0, -7.0) (61.0, -9.0) ( 72.0, -6.0) ( 83.0, -8.0) 1 | . (15.0, -2.0) (25.0, -5.0) (35.0, -8.0) ( 85.0,-18.0) ( 95.0,-21.0) | (45.0,-11.0) (55.0,-14.0) ( 65.0,-12.0) ( 75.0,-15.0) | . (13.0, -3.0) (22.0, -7.0) (31.0,-11.0) ( 76.0,-26.0) ( 85.0,-30.0) | (40.0,-15.0) (49.0,-19.0) ( 58.0,-18.0) ( 67.0,-22.0)
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 = 1, 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 PZGERU( 9 , 9 , ALPHA , 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 ) ALPHA = (1.0,-1.0)
| Desc_A | Desc_X | Desc_Y |
---|---|---|---|
DTYPE_ | 1 | 1 | 1 |
CTXT_ | icontxt(IOBG17) | icontxt(IOBG17) | icontxt(IOBG17) |
M_ | 10 | 11 | 1 |
N_ | 10 | 1 | 11 |
MB_ | 4 | 4 | 1 |
NB_ | 4 | 1 | 4 |
RSRC_ | 0 | 0 | 0 |
CSRC_ | 0 | 0 | 0 |
LLD_ | See below(EPSSL17) | See below(EPSSL17) | See below(EPSSL17) |
Notes:
|
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, 2.0) (22.0, 1.0) (32.0, 0.0) | (42.0,-1.0) (52.0,-2.0) (62.0, 2.0) (72.0, 1.0) | (82.0, 0.0) ( 92.0,-1.0) | 0 | . (13.0, 2.0) (23.0, 1.0) (33.0, 0.0) | (43.0,-1.0) (53.0,-2.0) (63.0, 2.0) (73.0, 1.0) | (83.0, 0.0) ( 93.0,-1.0) | | . (14.0, 2.0) (24.0, 1.0) (34.0, 0.0) | (44.0,-1.0) (54.0,-2.0) (64.0, 2.0) (74.0, 1.0) | (84.0, 0.0) ( 94.0,-1.0) | | -------------------------------------------|-------------------------------------------------|------------------------- | | . (15.0, 2.0) (25.0, 1.0) (35.0, 0.0) | (45.0,-1.0) (55.0,-2.0) (65.0, 2.0) (75.0, 1.0) | (85.0, 0.0) ( 95.0,-1.0) | | . (16.0, 2.0) (26.0, 1.0) (36.0, 0.0) | (46.0,-1.0) (56.0,-2.0) (66.0, 2.0) (76.0, 1.0) | (86.0, 0.0) ( 96.0,-1.0) | 1 | . (17.0, 2.0) (27.0, 1.0) (37.0, 0.0) | (47.0,-1.0) (57.0,-2.0) (67.0, 2.0) (77.0, 1.0) | (87.0, 0.0) ( 97.0,-1.0) | | . (18.0, 2.0) (28.0, 1.0) (38.0, 0.0) | (48.0,-1.0) (58.0,-2.0) (68.0, 2.0) (78.0, 1.0) | (88.0, 0.0) ( 98.0,-1.0) | | -------------------------------------------|-------------------------------------------------|------------------------- | 2 | . (19.0, 2.0) (29.0, 1.0) (39.0, 0.0) | (49.0,-1.0) (59.0,-2.0) (69.0, 2.0) (79.0, 1.0) | (89.0, 0.0) ( 99.0,-1.0) | | . (20.0, 2.0) (30.0, 1.0) (40.0, 0.0) | (50.0,-1.0) (60.0,-2.0) (70.0, 2.0) (80.0, 1.0) | (90.0, 0.0) (100.0,-1.0) | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for A:
p,q | 0 | 1 -----|---------------------------------------------------------------------|------------------------------------------------- | . . . . . . | . . . . | . (12.0, 2.0) (22.0, 1.0) (32.0, 0.0) (82.0, 0.0) ( 92.0,-1.0) | (42.0,-1.0) (52.0,-2.0) (62.0, 2.0) (72.0, 1.0) | . (13.0, 2.0) (23.0, 1.0) (33.0, 0.0) (83.0, 0.0) ( 93.0,-1.0) | (43.0,-1.0) (53.0,-2.0) (63.0, 2.0) (73.0, 1.0) 0 | . (14.0, 2.0) (24.0, 1.0) (34.0, 0.0) (84.0, 0.0) ( 94.0,-1.0) | (44.0,-1.0) (54.0,-2.0) (64.0, 2.0) (74.0, 1.0) | . (19.0, 2.0) (29.0, 1.0) (39.0, 0.0) (89.0, 0.0) ( 99.0,-1.0) | (49.0,-1.0) (59.0,-2.0) (69.0, 2.0) (79.0, 1.0) | . (20.0, 2.0) (30.0, 1.0) (40.0, 0.0) (90.0, 0.0) (100.0,-1.0) | (50.0,-1.0) (60.0,-2.0) (70.0, 2.0) (80.0, 1.0) -----|---------------------------------------------------------------------|------------------------------------------------- | . (15.0, 2.0) (25.0, 1.0) (35.0, 0.0) (85.0, 0.0) ( 95.0,-1.0) | (45.0,-1.0) (55.0,-2.0) (65.0, 2.0) (75.0, 1.0) | . (16.0, 2.0) (26.0, 1.0) (36.0, 0.0) (86.0, 0.0) ( 96.0,-1.0) | (46.0,-1.0) (56.0,-2.0) (66.0, 2.0) (76.0, 1.0) 1 | . (17.0, 2.0) (27.0, 1.0) (37.0, 0.0) (87.0, 0.0) ( 97.0,-1.0) | (47.0,-1.0) (57.0,-2.0) (67.0, 2.0) (77.0, 1.0) | . (18.0, 2.0) (28.0, 1.0) (38.0, 0.0) (88.0, 0.0) ( 98.0,-1.0) | (48.0,-1.0) (58.0,-2.0) (68.0, 2.0) (78.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 9 × 1, starting at row 2 and column 1 in 11 × 1 global matrix X with block size 4 × 1:
B,D 0 * * | . | | (1.0, 4.0) | 0 | (1.0, 3.0) | | (1.0, 2.0) | | ---------- | | (1.0, 1.0) | | (1.0, 0.0) | 1 | (1.0,-1.0) | | (1.0,-2.0) | | ---------- | | (1.0,-3.0) | 2 | (1.0,-4.0) | | . | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for x:
p,q | 0 -----|------------ | . | (1.0, 4.0) | (1.0, 3.0) 0 | (1.0, 2.0) | (1.0,-3.0) | (1.0,-4.0) | . -----|------------ | (1.0, 1.0) | (1.0, 0.0) 1 | (1.0,-1.0) | (1.0,-2.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 1 × 4:
B,D 0 1 2 * * 0 | . (2.0, 1.0) (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (6.0, 1.0) (7.0, 1.0) (8.0, 1.0) | (9.0, 1.0) (10.0, 1.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, 1.0) (3.0, 1.0) (4.0, 1.0) (9.0, 1.0) (10.0, 1.0) . | (5.0, 1.0) (6.0, 1.0) (7.0, 1.0) (8.0, 1.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 * * | . . . . | . . . . | . . | | . (19.0, 13.0) (34.0, 15.0) (49.0, 17.0)| (64.0, 19.0) (79.0, 21.0) (94.0, 28.0) (109.0, 30.0)| (124.0, 32.0) (139.0, 34.0) | 0 | . (19.0, 10.0) (33.0, 11.0) (47.0, 12.0)| (61.0, 13.0) (75.0, 14.0) (89.0, 20.0) (103.0, 21.0)| (117.0, 22.0) (131.0, 23.0) | | . (19.0, 7.0) (32.0, 7.0) (45.0, 7.0)| (58.0, 7.0) (71.0, 7.0) (84.0, 12.0) ( 97.0, 12.0)| (110.0, 12.0) (123.0, 12.0) | | -----------------------------------------|-----------------------------------------------------|---------------------------- | | . (19.0, 4.0) (31.0, 3.0) (43.0, 2.0)| (55.0, 1.0) (67.0, 0.0) (79.0, 4.0) ( 91.0, 3.0)| (103.0, 2.0) (115.0, 1.0) | | . (19.0, 1.0) (30.0, -1.0) (41.0, -3.0)| (52.0, -5.0) (63.0, -7.0) (74.0, -4.0) ( 85.0, -6.0)| ( 96.0, -8.0) (107.0,-10.0) | 1 | . (19.0, -2.0) (29.0, -5.0) (39.0, -8.0)| (49.0,-11.0) (59.0,-14.0) (69.0,-12.0) ( 79.0,-15.0)| ( 89.0,-18.0) ( 99.0,-21.0) | | . (19.0, -5.0) (28.0, -9.0) (37.0,-13.0)| (46.0,-17.0) (55.0,-21.0) (64.0,-20.0) ( 73.0,-24.0)| ( 82.0,-28.0) ( 91.0,-32.0) | | -----------------------------------------|-----------------------------------------------------|---------------------------- | 2 | . (19.0, -8.0) (27.0,-13.0) (35.0,-18.0)| (43.0,-23.0) (51.0,-28.0) (59.0,-28.0) ( 67.0,-33.0)| ( 75.0,-38.0) ( 83.0,-43.0) | | . (19.0,-11.0) (26.0,-17.0) (33.0,-23.0)| (40.0,-29.0) (47.0,-35.0) (54.0,-36.0) ( 61.0,-42.0)| ( 68.0,-48.0) ( 75.0,-54.0) | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for A:
p,q | 0 | 1 ----|------------------------------------------------------------------------|----------------------------------------------------- | . . . . . . | . . . . | . (19.0, 13.0) (34.0, 15.0) (49.0, 17.0) (124.0, 32.0) (139.0, 34.0) | (64.0, 19.0) (79.0, 21.0) (94.0, 28.0) (109.0, 30.0) | . (19.0, 10.0) (33.0, 11.0) (47.0, 12.0) (117.0, 22.0) (131.0, 23.0) | (61.0, 13.0) (75.0, 14.0) (89.0, 20.0) (103.0, 21.0) 0 | . (19.0, 7.0) (32.0, 7.0) (45.0, 7.0) (110.0, 12.0) (123.0, 12.0) | (58.0, 7.0) (71.0, 7.0) (84.0, 12.0) ( 97.0, 12.0) | . (19.0, -8.0) (27.0,-13.0) (35.0,-18.0) ( 75.0,-38.0) ( 83.0,-43.0) | (43.0,-23.0) (51.0,-28.0) (59.0,-28.0) ( 67.0,-33.0) | . (19.0,-11.0) (26.0,-17.0) (33.0,-23.0) ( 68.0,-48.0) ( 75.0,-54.0) | (40.0,-29.0) (47.0,-35.0) (54.0,-36.0) ( 61.0,-42.0) ----|------------------------------------------------------------------------|----------------------------------------------------- | . (19.0, 4.0) (31.0, 3.0) (43.0, 2.0) (103.0, 2.0) (115.0, 1.0) | (55.0, 1.0) (67.0, 0.0) (79.0, 4.0) ( 91.0, 3.0) | . (19.0, 1.0) (30.0, -1.0) (41.0, -3.0) ( 96.0, -8.0) (107.0,-10.0) | (52.0, -5.0) (63.0, -7.0) (74.0, -4.0) ( 85.0, -6.0) 1 | . (19.0, -2.0) (29.0, -5.0) (39.0, -8.0) ( 89.0,-18.0) ( 99.0,-21.0) | (49.0,-11.0) (59.0,-14.0) (69.0,-12.0) ( 79.0,-15.0) | . (19.0, -5.0) (28.0, -9.0) (37.0,-13.0) ( 82.0,-28.0) ( 91.0,-32.0) | (46.0,-17.0) (55.0,-21.0) (64.0,-20.0) ( 73.0,-24.0)