These subroutines solve the following systems of equations for multiple right-hand sides:
where, in the formula above:
This subroutine uses the results of the factorization of matrix A, produced by a preceding call to PDPOTRF or PZPOTRF, respectively. For details on the factorization, see PDPOTRF and PZPOTRF--Positive Definite Real Symmetric or Complex Hermitian Matrix Factorization.
If n = 0 or nrhs = 0, no computation is
performed and the subroutine returns after doing some parameter
checking. See references [16], [18], [22],
[36], and [37].
A, B | Subroutine |
Long-precision real | PDPOTRS |
Long-precision complex | PZPOTRS |
Fortran | CALL PDPOTRS | PZPOTRS (uplo, n, nrhs, a, ia, ja, desc_a, b, ib, jb, desc_b, info) |
C and C++ | pdpotrs | pzpotrs (uplo, n, nrhs, a, ia, ja, desc_a, b, ib, jb, desc_b, info); |
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 fullword integer; nrhs >= 0.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 67. 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_B by (at least) LOCq(N_B) array, containing numbers of the data type indicated in Table 67. Details about the block-cyclic data distribution of global matrix B are stored in desc_b.
Scope: global
Specified as: a fullword integer; 1 <= ib <= M_B and ib+n-1 <= M_B.
Scope: global
Specified as: a fullword integer; 1 <= jb <= N_B and jb+nrhs-1 <= N_B.
desc_b | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_B | Descriptor type | DTYPE_B=1 | Global |
2 | CTXT_B | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_B | Number of rows in the global matrix |
If n = 0 or nrhs = 0: M_B >= 0 Otherwise: M_B >= 1 | Global |
4 | N_B | Number of columns in the global matrix |
If n = 0 or nrhs = 0: N_B >= 0 Otherwise: N_B >= 1 | Global |
5 | MB_B | Row block size | MB_B >= 1 | Global |
6 | NB_B | Column block size | NB_B >= 1 | Global |
7 | RSRC_B | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_B < p | Global |
8 | CSRC_B | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_B < q | Global |
9 | LLD_B | The leading dimension of the local array | LLD_B >= max(1,LOCp(M_B)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Returned as: an LLD_B by (at least) LOCq(N_B) array, containing numbers of the data type indicated in Table 67.
Scope: global
Returned as: a fullword integer; info = 0.
None
Unable to allocate work space
If n <> 0:
If n <> 0 and nrhs <> 0:
In all cases:
Each of the following global input arguments are checked to determine whether its value differs from the value specified on process P00:
This example solves the positive definite real symmetric system AX = B with 5 right-hand sides using a 2 × 2 process grid. The transformed matrix A is the output from Example 1.
This example uses a global submatrix B within a global matrix B by specifying ib = 1 and jb = 2.
By specifying CSRC_B = 1, the columns of global matrix B are distributed over the process grid starting in the second column of the 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 NRHS A IA JA DESC_A B IB JB DESC_B INFO | | | | | | | | | | | | CALL PDPOTRS( 'L' , 9 , 5 , A , 1 , 1 , DESC_A , B , 1 , 2 , DESC_B , INFO )
| Desc_A | Desc_B |
---|---|---|
DTYPE_ | 1 | 1 |
CTXT_ | icontxt(IOBG40) | icontxt(IOBG40) |
M_ | 9 | 9 |
N_ | 9 | 6 |
MB_ | 3 | 3 |
NB_ | 3 | 2 |
RSRC_ | 0 | 0 |
CSRC_ | 0 | 1 |
LLD_ | See below(EPSSL40) | See below(EPSSL40) |
Notes: |
After the global matrix B is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix B. Following is the global 9 × 5 submatrix B, starting at row 1 and column 2 in global general 9 × 6 matrix B with block size 3 × 2:
B,D 0 1 2 * * | . 18.0 | 27.0 36.0 | 45.0 9.0 | 0 | . 34.0 | 51.0 68.0 | 85.0 17.0 | | . 48.0 | 72.0 96.0 | 120.0 24.0 | | ---------------|-----------------|--------------- | | . 60.0 | 90.0 120.0 | 150.0 30.0 | 1 | . 70.0 | 105.0 140.0 | 175.0 35.0 | | . 78.0 | 117.0 156.0 | 195.0 39.0 | | ---------------|-----------------|--------------- | | . 84.0 | 126.0 168.0 | 210.0 42.0 | 2 | . 88.0 | 132.0 176.0 | 220.0 44.0 | | . 90.0 | 135.0 180.0 | 225.0 45.0 | * *
The following is the 2 × 2 process grid:
B,D | 1 | 0 2 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for B:
p,q | 0 | 1 -----|----------------|------------------------------ | 27.0 36.0 | . 18.0 45.0 9.0 | 51.0 68.0 | . 34.0 85.0 17.0 | 72.0 96.0 | . 48.0 120.0 24.0 0 | 126.0 168.0 | . 84.0 210.0 42.0 | 132.0 176.0 | . 88.0 220.0 44.0 | 135.0 180.0 | . 90.0 225.0 45.0 -----|----------------|------------------------------ | 90.0 120.0 | . 60.0 150.0 30.0 1 | 105.0 140.0 | . 70.0 175.0 35.0 | 117.0 156.0 | . 78.0 195.0 39.0
Output:
After the global matrix B is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix B. Following is the global 9 × 5 submatrix B, starting at row 1 and column 2 in global general 9 × 6 matrix B with block size 3 × 2:
B,D 0 1 2 * * | . 2.0 | 3.0 4.0 | 5.0 1.0 | 0 | . 2.0 | 3.0 4.0 | 5.0 1.0 | | . 2.0 | 3.0 4.0 | 5.0 1.0 | | -----------|-------------|----------- | | . 2.0 | 3.0 4.0 | 5.0 1.0 | 1 | . 2.0 | 3.0 4.0 | 5.0 1.0 | | . 2.0 | 3.0 4.0 | 5.0 1.0 | | -----------|-------------|----------- | | . 2.0 | 3.0 4.0 | 5.0 1.0 | 2 | . 2.0 | 3.0 4.0 | 5.0 1.0 | | . 2.0 | 3.0 4.0 | 5.0 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 1 | 0 2 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for B:
p,q | 0 | 1 -----|------------|---------------------- | 3.0 4.0 | . 2.0 5.0 1.0 | 3.0 4.0 | . 2.0 5.0 1.0 | 3.0 4.0 | . 2.0 5.0 1.0 0 | 3.0 4.0 | . 2.0 5.0 1.0 | 3.0 4.0 | . 2.0 5.0 1.0 | 3.0 4.0 | . 2.0 5.0 1.0 -----|------------|---------------------- | 3.0 4.0 | . 2.0 5.0 1.0 1 | 3.0 4.0 | . 2.0 5.0 1.0 | 3.0 4.0 | . 2.0 5.0 1.0
The value of info is 0 on all processes.
This example solves the positive definite complex Hermitian system AX = B with 5 right-hand sides using a 2 × 2 process grid. The transformed matrix A is the output from Example 2.
This example uses a global submatrix B within a global matrix B by specifying ib = 1 and jb = 2.
By specifying CSRC_B = 1, the columns of global matrix B are distributed over the process grid starting in the second column of the 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 NRHS A IA JA DESC_A B IB JB DESC_B INFO | | | | | | | | | | | | CALL PZPOTRS( 'L' , 9 , 5 , A , 1 , 1 , DESC_A , B , 1 , 2 , DESC_B , INFO )
| Desc_A | Desc_B |
---|---|---|
DTYPE_ | 1 | 1 |
CTXT_ | icontxt(IOBG41) | icontxt(IOBG41) |
M_ | 9 | 9 |
N_ | 9 | 6 |
MB_ | 3 | 3 |
NB_ | 3 | 2 |
RSRC_ | 0 | 0 |
CSRC_ | 0 | 1 |
LLD_ | See below(EPSSL41) | See below(EPSSL41) |
Notes: |
After the global matrix B is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix B. Following is the global 9 × 5 submatrix B, starting at row 1 and column 2 in global general 9 × 6 matrix B with block size 3 × 2:
B,D 0 1 2 * * | . (60.0, 10.0) | (86.0, 2.0) (112.0, -6.0) | (138.0, -14.0) (34.0, 18.0) | 0 | . (86.0, 28.0) | (126.0, 22.0) (166.0, 16.0) | (206.0, 10.0) (46.0, 34.0) | | . (108.0, 44.0) | (160.0, 40.0) (212.0, 36.0) | (264.0, 32.0) (56.0, 48.0) | | ---------------------------|-----------------------------------|-------------------------------- | | . (126.0, 58.0) | (188.0, 56.0) (250.0, 54.0) | (312.0, 52.0) (64.0, 60.0) | 1 | . (140.0, 70.0) | (210.0, 70.0) (280.0, 70.0) | (350.0, 70.0) (70.0, 70.0) | | . (150.0, 80.0) | (226.0, 82.0) (302.0, 84.0) | (378.0, 86.0) (74.0, 78.0) | | ---------------------------|-----------------------------------|-------------------------------- | | . (156.0, 88.0) | (236.0, 92.0) (316.0, 96.0) | (396.0, 100.0) (76.0, 84.0) | 2 | . (158.0, 94.0) | (240.0, 100.0) (322.0, 106.0) | (404.0, 112.0) (76.0, 88.0) | | . (156.0, 98.0) | (238.0, 106.0) (320.0, 114.0) | (402.0, 122.0) (74.0, 90.0) | * *
The following is the 2 × 2 process grid:
B,D | 1 | 0 2 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for B:
p,q | 0 | 1 -----|----------------------------------|----------------------------------------------------------- | (86.0, 2.0) (112.0, -6.0) | . (60.0, 10.0) (138.0, -14.0) (34.0, 18.0) | (126.0, 22.0) (166.0, 16.0) | . (86.0, 28.0) (206.0, 10.0) (46.0, 34.0) | (160.0, 40.0) (212.0, 36.0) | . (108.0, 44.0) (264.0, 32.0) (56.0, 48.0) 0 | (236.0, 92.0) (316.0, 96.0) | . (156.0, 88.0) (396.0, 100.0) (76.0, 84.0) | (240.0, 100.0) (322.0, 106.0) | . (158.0, 94.0) (404.0, 112.0) (76.0, 88.0) | (238.0, 106.0) (320.0, 114.0) | . (156.0, 98.0) (402.0, 122.0) (74.0, 90.0) -----|----------------------------------|----------------------------------------------------------- | (188.0, 56.0) (250.0, 54.0) | . (126.0, 58.0) (312.0, 52.0) (64.0, 60.0) 1 | (210.0, 70.0) (280.0, 70.0) | . (140.0, 70.0) (350.0, 70.0) (70.0, 70.0) | (226.0, 82.0) (302.0, 84.0) | . (150.0, 80.0) (378.0, 86.0) (74.0, 78.0)
Output:
After the global matrix B is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix B. Following is the global 9 × 5 submatrix B, starting at row 1 and column 2 in global general 9 × 6 matrix B with block size 3 × 2:
B,D 0 1 2 * * | . (2.0, 1.0) | (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (1.0, 1.0) | 0 | . (2.0, 1.0) | (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (1.0, 1.0) | | . (2.0, 1.0) | (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (1.0, 1.0) | | ------------------|---------------------------|------------------------- | | . (2.0, 1.0) | (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (1.0, 1.0) | 1 | . (2.0, 1.0) | (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (1.0, 1.0) | | . (2.0, 1.0) | (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (1.0, 1.0) | | ------------------|---------------------------|------------------------- | | . (2.0, 1.0) | (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (1.0, 1.0) | 2 | . (2.0, 1.0) | (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (1.0, 1.0) | | . (2.0, 1.0) | (3.0, 1.0) (4.0, 1.0) | (5.0, 1.0) (1.0, 1.0) | * *
The following is the 2 × 2 process grid:
B,D | 1 | 0 2 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for B:
p,q | 0 | 1 -----|--------------------------|------------------------------------------- | (3.0, 4.0) (3.0, 4.0) | . (2.0, 1.0) (5.0, 1.0) (1.0, 1.0) | (3.0, 4.0) (3.0, 4.0) | . (2.0, 1.0) (5.0, 1.0) (1.0, 1.0) | (3.0, 4.0) (3.0, 4.0) | . (2.0, 1.0) (5.0, 1.0) (1.0, 1.0) 0 | (3.0, 4.0) (3.0, 4.0) | . (2.0, 1.0) (5.0, 1.0) (1.0, 1.0) | (3.0, 4.0) (3.0, 4.0) | . (2.0, 1.0) (5.0, 1.0) (1.0, 1.0) | (3.0, 4.0) (3.0, 4.0) | . (2.0, 1.0) (5.0, 1.0) (1.0, 1.0) -----|--------------------------|------------------------------------------- | (3.0, 4.0) (3.0, 4.0) | . (2.0, 1.0) (5.0, 1.0) (1.0, 1.0) 1 | (3.0, 4.0) (3.0, 4.0) | . (2.0, 1.0) (5.0, 1.0) (1.0, 1.0) | (3.0, 4.0) (3.0, 4.0) | . (2.0, 1.0) (5.0, 1.0) (1.0, 1.0)
The value of info is 0 on all processes.