PDGTSV solves the tridiagonal systems of linear equations, AX = B, using Gaussian elimination with partial pivoting for the general tridiagonal matrix A stored in tridiagonal storage mode.
PDDTSV solves the tridiagonal systems of linear equations, AX = B, using Gaussian elimination for the diagonally dominant general tridiagonal matrix A stored in tridiagonal storage mode.
If n = 0, no computation is performed and the subroutine
returns after doing some parameter checking. See reference [51].
dl, d, du, B, work | Subroutine |
Long-precision real | PDGTSV and PDDTSV |
Fortran | CALL PDGTSV | PDDTSV (n, nrhs, dl, d, du, ia, desc_a, b, ib, desc_b, work, lwork, info) |
C and C++ | pdgtsv | pddtsv (n, nrhs, dl, d, du, ia, desc_a, b, ib, desc_b, 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.
The global vector dl contains the subdiagonal of the global general tridiagonal submatrix A in elements ia+1 through ia+n-1.
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 71. Details about block-cyclic data distribution of global matrix A are stored in desc_a.
On output, DL is overwritten; that is, the original input is not preserved.
The global vector d contains the main diagonal of the global general tridiagonal submatrix A in elements ia through ia+n-1.
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 71. Details about block-cyclic data distribution of global matrix A are stored in desc_a.
On output, D is overwritten; that is, the original input is not preserved.
The global vector du contains the superdiagonal of the global general tridiagonal submatrix A in elements ia through ia+n-2.
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 71. Details about block-cyclic data distribution of global matrix A are stored in desc_a.
On output, DU is overwritten; that is, the original input is not preserved.
Scope: global
Specified as: a fullword integer, where:
The following tables describe the three types of array descriptors.
For rules on using array descriptors, see Notes and Coding Rules.
Table 72. 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 these subroutines. | -- | -- |
7 | -- | Reserved | -- | -- |
Specified as: an array of (at least) length 7, containing fullword
integers.
Table 73. 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 these subroutines. | -- | -- |
Specified as: an array of (at least) length 9, containing fullword
integers.
Table 74. 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 these subroutines. | -- | -- |
7 | -- | Reserved | -- | -- |
Specified as: an array of (at least) length 7, containing fullword
integers.
Table 75. 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 these subroutines. | -- | -- |
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 71. 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.
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 71.
Scope:
Specified as: a fullword integer; where:
where, in the above formulas, P is the actual number of processes containing data.
If (the process grid is 1 × p and DTYPE_A = 1) or DTYPE_A = 501, you would substitute NB_A in place of MB_A in the formulas above.
Scope: local
Returned as: an LLD_B by (at least) nrhs array, containing numbers of the data type indicated in Table 71.
If lwork <> 0 and lwork <> -1, its size is (at least) of length lwork.
If lwork = -1, its size is (at least) of length 1.
Scope: local
Returned as: an area of storage, containing numbers of the data type indicated in Table 71, where:
Except for work1, the contents of work are overwritten on return.
If info = 0, the factorization or the work area query completed successfully.
If 1 <= info <= p, the portion of the global submatrix A stored on process info-1 and factored locally, is singular or reducible (for PDGTSV), or not diagonally dominant (for PDDTSV). The magnitude of a pivot element was zero or too small.
If info > p, the portion of the global submatrix A stored on process info-p-1 representing interactions with other processes, is singular or reducible (for PDGTSV), or not diagonally dominant (for PDDTSV). The magnitude of a pivot element was zero or too small.
If info > 0, the results are unpredictable.
Scope: global
Returned as: a fullword integer; info >= 0.
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 | 1 × p |
1 | 1 | 1 × 1 |
For more information on using block-cyclic data distribution, see Specifying Block-Cyclically-Distributed Matrices for the Banded Linear Algebraic Equations.
Matrix A is a singular or reducible matrix (for PDGTSV), or not diagonally dominant (for PDDTSV). For details, see the description of the info argument.
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 a factorization of the general tridiagonal matrix A of order 12:
* * | 2.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 1.0 3.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 1.0 3.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 1.0 3.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 1.0 3.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 1.0 3.0 2.0 0.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 1.0 3.0 2.0 0.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 1.0 3.0 2.0 0.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 3.0 2.0 0.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 3.0 2.0 0.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 3.0 2.0 | | 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 3.0 | * *
Matrix A is distributed over a 1 × 3 process grid using block-column distribution.
Notes:
ORDER = 'R' NPROW = 1 NPCOL = 3 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) N NRHS DL D DU IA DESC_A B IB DESC_B WORK LWORK INFO | | | | | | | | | | | | | CALL PDGTSV( 12 , 3 , DL , D , DU , 1 , DESC_A , B , 1 , DESC_B , WORK , 0 , INFO ) -or- N NRHS DL D DU IA DESC_A B IB DESC_B WORK LWORK INFO | | | | | | | | | | | | | CALL PDDTSV( 12 , 3 , DL , D , DU , 1 , DESC_A , B , 1 , DESC_B , WORK , 0 , INFO )
| Desc_A |
---|---|
DTYPE_ | 501 |
CTXT_ | icontxt(CGBTO11) |
N_ | 12 |
NB_ | 4 |
CSRC_ | 0 |
Not used | -- |
Reserved | -- |
Notes: |
| Desc_B |
---|---|
DTYPE_ | 502 |
CTXT_ | icontxt(CGBTO12) |
M_ | 12 |
MB_ | 4 |
RSRC_ | 0 |
LLD_B | 4 |
Reserved | -- |
Notes: |
Global vector dl with block size of 4:
B,D 0 1 2 * * 0 | . 1.0 1.0 1.0 | 1.0 1.0 1.0 1.0 | 1.0 1.0 1.0 1.0 | * *
Global vector d with block size of 4:
B,D 0 1 2 * * 0 | 2.0 3.0 3.0 3.0 | 3.0 3.0 3.0 3.0 | 3.0 3.0 3.0 3.0 | * *
Global vector du with block size of 4:
B,D 0 1 2 * * 0 | 2.0 2.0 2.0 2.0 | 2.0 2.0 2.0 2.0 | 2.0 2.0 2.0 . | * *
The following is the 1 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02
Local array DL with block size of 4:
p,q | 0 | 1 | 2 -----|----------------------|-----------------------|---------------------- 0 | . 1.0 1.0 1.0 | 1.0 1.0 1.0 1.0 | 1.0 1.0 1.0 1.0
Local array D with block size of 4:
p,q | 0 | 1 | 2 -----|----------------------|-----------------------|---------------------- 0 | 2.0 3.0 3.0 3.0 | 3.0 3.0 3.0 3.0 | 3.0 3.0 3.0 3.0
Local array DU with block size of 4:
p,q | 0 | 1 | 2 -----|----------------------|-----------------------|--------------------- 0 | 2.0 2.0 2.0 2.0 | 2.0 2.0 2.0 2.0 | 2.0 2.0 2.0 .
Global matrix B with a block size of 4:
B,D 0 * * | 46.0 6.0 4.0 | | 65.0 13.0 6.0 | 0 | 59.0 19.0 6.0 | | 53.0 25.0 6.0 | | -------------- | | 47.0 31.0 6.0 | | 41.0 37.0 6.0 | 1 | 35.0 43.0 6.0 | | 29.0 49.0 6.0 | | -------------- | | 23.0 55.0 6.0 | | 17.0 61.0 6.0 | 2 | 11.0 67.0 6.0 | | 5.0 47.0 4.0 | * *
The following is the 1 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02
Local matrix B with a block size of 4:
p,q | 0 | 1 | 2 -----|-----------------|------------------|----------------- | 46.0 6.0 4.0 | 47.0 31.0 6.0 | 23.0 55.0 6.0 | 65.0 13.0 6.0 | 41.0 37.0 6.0 | 17.0 61.0 6.0 0 | 59.0 19.0 6.0 | 35.0 43.0 6.0 | 11.0 67.0 6.0 | 53.0 25.0 6.0 | 29.0 49.0 6.0 | 5.0 47.0 4.0
Output:
Global matrix B with a 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 following is the 1 × 3 process grid:
B,D | 0 | 1 | 2 -----| ------- | ------- |------- 0 | P00 | P01 | P02
Local matrix B with a block size of 4:
p,q | 0 | 1 | 2 -----|-----------------|------------------|----------------- | 12.0 1.0 1.0 | 8.0 5.0 1.0 | 4.0 9.0 1.0 | 11.0 2.0 1.0 | 7.0 6.0 1.0 | 3.0 10.0 1.0 0 | 10.0 3.0 1.0 | 6.0 7.0 1.0 | 2.0 11.0 1.0 | 9.0 4.0 1.0 | 5.0 8.0 1.0 | 1.0 12.0 1.0
The value of info is 0 on all processes.