This subroutine solves the following tridiagonal systems of linear equations for multiple right-hand sides, using the positive definite symmetric tridiagonal matrix A, where A is stored in parallel-symmetric-tridiagonal storage mode:
In this subroutine:
This subroutine uses the results of the factorization of matrix A, produced by a preceding call to PDPTTRF. The output from PDPTTRF should be used only as input to this solve subroutine.
If n = 0 or nrhs = 0, no computation is
performed and the subroutine returns after doing some parameter
checking. See reference [51].
d, e, B, af, work | Subroutine |
Long-precision real | PDPTTRS |
Fortran | CALL PDPTTRS (n, nrhs, d, e, ia, desc_a, b, ib, desc_b, af, laf, work, lwork, info) |
C and C++ | pdpttrs (n, nrhs, d, e, ia, desc_a, b, ib, desc_b, af, laf, work, lwork, info); |
Scope: global
Specified as: a fullword integer, where:
where p is the number of processes in a process grid.
Scope: global
Specified as: a fullword integer; nrhs >= 0.
Scope: local
Specified as: a one-dimensional array of (at least) length LOCp(ia+n-1), containing numbers of the data type indicated in Table 96. Details about block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: local
Specified as: a one-dimensional array of (at least) length LOCp(ia+n-1), containing numbers of the data type indicated in Table 96. Details about block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: global
Specified as: a fullword integer, where:
Table 97. Type-502 Array Descriptor
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor Type | DTYPE_A=502 for p × 1 or
1 × p
where p is the number of processes in a process grid. | 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 | MB_A | Row block size | MB_A >= 1 and 0 <= n <= (MB_A)(p)-mod(ia-1,MB_A) | Global |
5 | RSRC_A | The process row over which the first row of the global matrix is distributed | 0 >= RSRC_A < p | Global |
6 | -- | Not used by this subroutine. | -- | -- |
7 | -- | Reserved | -- | -- |
Specified as: an array of (at least) length 7, containing fullword
integers.
Table 98. Type-1 Array Descriptor (p × 1 Process Grid)
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor Type | DTYPE_A = 1 for p × 1
where p is the number of processes in a process grid. | 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 | N_A = 1 |
|
5 | MB_A | Row block size | MB_A >= 1 and 0 <= n <= (MB_A)(p)-mod(ia-1,MB_A) | Global |
6 | NB_A | Column block size | NB_A >= 1 | Global |
7 | RSRC_A | The process row over which the first row of the global matrix is distributed | 0 <= RSRC_A < p | Global |
8 | CSRC_A | The process column over which the first column of the global matrix is distributed | CSRC_A = 0 | Global |
9 | -- | Not used by this subroutine. | -- | -- |
Specified as: an array of (at least) length 9, containing fullword
integers.
Table 99. Type-501 Array Descriptor
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor Type | DTYPE_A=501 for 1 × p or
p × 1
where p is the number of processes in a process grid. | Global |
2 | CTXT_A | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | N_A | Number of columns in the global matrix |
If n = 0: N_A >= 0 Otherwise: N_A >= 1 | Global |
4 | NB_A | Column block size | NB_A >= 1 and 0 <= n <= (NB_A)(p)-mod(ia-1,NB_A) | Global |
5 | CSRC_A | The process column over which the first column of the global matrix is distributed | 0 <= CSRC_A < p | Global |
6 | -- | Not used by this subroutine. | -- | -- |
7 | -- | Reserved | -- | -- |
Specified as: an array of (at least) length 7, containing fullword
integers.
Table 100. Type-1 Array Descriptor (1 × p Process Grid)
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor type | DTYPE_A = 1 for 1 × p
where p is the number of processes in a process grid. | 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 | 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 and 0 <= n <= (NB_A)(p)-mod(ia-1,NB_A) | Global |
7 | RSRC_A | The process row over which the first row of the global matrix is distributed | RSRC_A = 0 | Global |
8 | CSRC_A | The process column over which the first column of the global matrix is distributed | 0 <= CSRC_A < p | Global |
9 | -- | Not used by this subroutine. | -- | -- |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Specified as: an LLD_B by (at least) nrhs array, containing numbers of the data type indicated in Table 96. 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.
desc_b | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_B | Descriptor type | DTYPE_B = 502 for p × 1 or
1 × p
where p is the number of processes in a process grid. | 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: M_B >= 0 Otherwise: M_B >= 1 | Global |
4 | MB_B | Row block size | MB_B >= 1 and 0 <= n <= (MB_B)(p)-mod(ib-1,MB_B) | Global |
5 | RSRC_B | The process row over which the first row of the global matrix is distributed | 0 <= RSRC_B < p | Global |
6 | LLD_B | Leading dimension | LLD_B >= max(1, LOCp(M_B)) | Local |
7 | -- | Reserved | -- | -- |
Specified as: an array of (at least) length 7, containing fullword
integers.
desc_b | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_B | Descriptor type | DTYPE_B = 1 for p × 1
where p is the number of processes in a process grid. | 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: M_B >= 0 Otherwise: M_B >= 1 | Global |
4 | N_B | Number of columns in the global matrix | N_B >= nrhs | Global |
5 | MB_B | Row block size | MB_B >= 1 and 0 <= n <= (MB_B)(p)-mod(ib-1,MB_B) | Global |
6 | NB_B | Column block size | NB_B >= 1 | Global |
7 | RSRC_B | The process row over which the first row of the global matrix is distributed | 0 <= RSRC_B < p | Global |
8 | CSRC_B | The process column over which the first column of the global matrix is distributed | CSRC_B = 0 | Global |
9 | LLD_B | Leading dimension | LLD_B >= max(1, LOCp(M_B)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Specified as: a one-dimensional array of (at least) length laf, containing numbers of the data type indicated in Table 96.
Scope: local
Specified as: a fullword integer, where:
where, in the above formulas, P is the actual number of processes containing data.
If lwork = 0, work is ignored.
If lwork <> 0, work is the work area used by this subroutine, where:
Scope: local
Specified as: an area of storage containing numbers of data type indicated in Table 96.
Scope:
Specified as: a fullword integer; where:
Scope: local
Returned as: an LLD_B by (at least) nrhs array, containing numbers of the data type indicated in Table 96.
If lwork <> 0 and lwork <> -1, the size of work is (at least) of length lwork.
If lwork = -1, the size of work is (at least) of length 1.
Scope: local
Returned as: an area of storage, containing numbers of data type indicated in Table 96, where:
Except for work1, the contents of work are overwritten on return.
Scope: global
Returned as: a fullword integer; info = 0.
The factored matrix A is stored in an internal format that depends on the number of processes.
The scalar data specified for input argument n must be the same for both PDPTTRF and PDPTTRS.
The global vectors for d, e, and af input to PDPTTRS must be the same as the corresponding output arguments for PDPTTRF; and thus, the scalar data specified for ia, desc_a, and laf must also be the same.
DTYPE_A | DTYPE_B | Process Grid |
---|---|---|
501 | 502 | p × 1 or 1 × p |
502 | 502 | p × 1 or 1 × p |
501 | 1 | p × 1 |
502 | 1 | p × 1 |
1 | 502 | p × 1 or 1 × p |
1 | 1 | p × 1 |
For more information on using block-cyclic data distribution, see Specifying Block-Cyclically-Distributed Matrices for the Banded Linear Algebraic Equations.
None
Unable to allocate workspace
If (the process grid is 1 × p and DTYPE_A = 1) or DTYPE_A = 501:
If the process grid is 1 × p and DTYPE_A = 1:
If (the process grid is p × 1 and DTYPE_A = 1) or DTYPE_A = 502:
If the process grid is p × 1 and DTYPE_A = 1:
In all cases:
If DTYPE_B = 1:
In all cases:
Each of the following global input arguments are checked to determine whether its value is the same on all processes in the process grid:
If DTYPE_A = 1 on all processes:
If DTYPE_A = 501 on all processes:
If DTYPE_A = 502 on all processes:
In all cases:
If DTYPE_B = 1 on all processes:
If DTYPE_B = 502 on all processes:
Also:
This example shows how to solve the system AX=B, where matrix A is the same positive definite symmetric tridiagonal matrix factored in Example for PDPTTRF.
Notes:
ORDER = 'R' NPROW = 3 NPCOL = 1 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) N NRHS D E IA DESC_A B IB DESC_B AF LAF WORK LWORK INFO | | | | | | | | | | | | | | CALL PDPTTRS( 12 , 3 , D, E , 1 , DESC_A , B , 1 , DESC_B, AF , 48 , WORK , 0 , INFO)
| Desc_A |
---|---|
DTYPE_ | 502 |
CTXT_ | icontxt(CGBTOO5) |
M_ | 12 |
MB_ | 4 |
RSRC_ | 0 |
Not used | -- |
Reserved | -- |
Notes: |
| Desc_B |
---|---|
DTYPE_ | 502 |
CTXT_ | icontxt(CGBTOO6) |
M_ | 12 |
MB_ | 4 |
RSRC_ | 0 |
LLD_B | 4 |
Reserved | -- |
Notes: |
Global vector d with block size of 4:
B,D 0 * * | .25 | | .25 | 0 | .25 | | 4.0 | | ---- | | .2 | | .24 | 1 | .25 | | 4.01 | | ---- | | 4.01 | | .25 | 2 | .24 | | .2 | * *
Global vector e with block size of 4:
B,D 0 * * | 2.0 | | 2.0 | 0 | 2.0 | | 2.0 | | ---- | | 2.0 | | 2.0 | 1 | 2.0 | | 2.0 | | ---- | | .49 | | .48 | 2 | .4 | | . | * *
The following is the 3 × 1 process grid:
B,D | 0 -----| ------- 0 | P00 -----| ------- 1 | P10 -----| ------- 2 | P20
Local array D with block size of 4:
p,q | 0 -----|------ | .25 | .25 0 | .25 | 4.0 -----|------ | .2 | .24 1 | .25 | 4.01 -----|------ | 4.01 | .25 2 | .24 | .2
Local array E with block size of 4:
p,q | 0 -----|------ | 2.0 | 2.0 0 | 2.0 | 2.0 -----|------ | 2.0 | 2.0 1 | 2.0 | 2.0 -----|------ | .49 | .48 2 | .4 | .
Global matrix B with a block size of 4:
p,q | 0 -----|---------------- | 70.0 8.0 6.0 | 99.0 18.0 9.0 0 | 90.0 27.0 9.0 | 81.0 36.0 9.0 -----|---------------- | 72.0 45.0 9.0 | 63.0 54.0 9.0 1 | 54.0 63.0 9.0 | 45.0 72.0 9.0 -----|---------------- | 36.0 81.0 9.0 | 27.0 90.0 9.0 2 | 18.0 99.0 9.0 | 9.0 82.0 7.0
The following is the 3 × 1 process grid:
B,D | 0 -----| ------- 0 | P00 -----| ------- 1 | P10 -----| ------- 2 | P20
Local matrix B with block size of 4:
p,q | 0 -----|---------------- | 70.0 8.0 6.0 | 99.0 18.0 9.0 0 | 90.0 27.0 9.0 | 81.0 36.0 9.0 -----|---------------- | 72.0 45.0 9.0 | 63.0 54.0 9.0 1 | 54.0 63.0 9.0 | 45.0 72.0 9.0 -----|---------------- | 36.0 81.0 9.0 | 27.0 90.0 9.0 2 | 18.0 99.0 9.0 | 9.0 82.0 7.0
Output:
Global matrix B with block size of 4:
B,D 0 * * | 12.0 1.0 1.0 | | 11.0 2.0 1.0 | 0 | 10.0 3.0 1.0 | | 9.0 4.0 1.0 | | --------------- | | 8.0 5.0 1.0 | | 7.0 6.0 1.0 | 1 | 6.0 7.0 1.0 | | 5.0 8.0 1.0 | | --------------- | | 4.0 9.0 1.0 | | 3.0 10.0 1.0 | 2 | 2.0 11.0 1.0 | | 1.0 12.0 1.0 | * *
The following is the 3 × 1 process grid:
B,D | 0 -----| ------- 0 | P00 -----| ------- 1 | P10 -----| ------- 2 | P20
Local matrix B with block size of 4:
p,q | 0 -----|----------------- | 12.0 1.0 1.0 | 11.0 2.0 1.0 0 | 10.0 3.0 1.0 | 9.0 4.0 1.0 -----|----------------- | 8.0 5.0 1.0 | 7.0 6.0 1.0 1 | 6.0 7.0 1.0 | 5.0 8.0 1.0 -----|----------------- | 4.0 9.0 1.0 | 3.0 10.0 1.0 2 | 2.0 11.0 1.0 | 1.0 12.0 1.0
The value of info is 0 on all processes.