PDTRAN and PZTRANU perform the following matrix computation:
PZTRANC performs the following matrix computation:
where, in the formula above:
In the following three cases, no computation is performed and the subroutine returns after doing some parameter checking:
| alpha, beta, A, C | Subprogram |
| Long-precision real | PDTRAN |
| Long-precision complex | PZTRANC and PZTRANU |
| Fortran | CALL PDTRAN | PZTRANC | PZTRANU (m, n, alpha, a, ia, ja, desc_a, beta, c, ic, jc, desc_c) |
| C and C++ | pdtran | pztranc | pztranu (m, n, alpha, a, ia, ja, desc_a, beta, c, ic, jc, desc_c); |
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 53.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 53. 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+n-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A and ja+m-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: global
Specified as: a number of the data type indicated in Table 53.
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 53. 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+m-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 m = 0 or n = 0: M_C >= 0 Otherwise: M_C >= 1 | Global |
| 4 | N_C | Number of columns in the global matrix |
If m = 0 or 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 53.
then adist = 'C'
then adist = 'R'
then:
then:
None
Unable to allocate work space
If m <> 0 and n <> 0:
If adist = 'C':
then:
If adist = 'R':
then:
This example computes C = betaC+alphaAT using a 2 × 2 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)
M N ALPHA A IA JA DESC_A BETA C IC JC DESC_C
| | | | | | | | | | | |
CALL PDTRAN( 9 , 8 , 1.0D0 , A , 1 , 1 , DESC_A , 1.0D0 , C , 1 , 1 , DESC_C )
|
| Desc_A | Desc_C |
|---|---|---|
| DTYPE_ | 1 | 1 |
| CTXT_ | icontxt(IOBG32) | icontxt(IOBG32) |
| M_ | 8 | 9 |
| N_ | 9 | 8 |
| MB_ | 2 | 4 |
| NB_ | 4 | 2 |
| RSRC_ | 0 | 0 |
| CSRC_ | 0 | 0 |
| LLD_ | See below(EPSSL32) | See below(EPSSL32) |
|
Notes:
| ||
Global general 8 × 9 matrix A with block size 2 × 4:
B,D 0 1 2
* *
0 | 0.0 -1.0 -1.0 0.0 | 0.0 0.0 0.0 0.0 | 1.0 |
| 0.0 1.0 0.0 1.0 | 0.0 1.0 0.0 1.0 | 1.0 |
| ---------------------|-----------------------|------ |
1 | 0.0 0.0 -1.0 -1.0 | 0.0 0.0 1.0 0.0 | 1.0 |
| 0.0 1.0 0.0 -1.0 | 1.0 1.0 0.0 1.0 | 1.0 |
| ---------------------|-----------------------|------ |
2 | 1.0 0.0 0.0 0.0 | -1.0 0.0 0.0 0.0 | 1.0 |
| 1.0 0.0 0.0 0.0 | 1.0 1.0 0.0 0.0 | 1.0 |
| ---------------------|-----------------------|------ |
3 | 0.0 0.0 -1.0 0.0 | -1.0 0.0 0.0 0.0 | 1.0 |
| -1.0 0.0 0.0 0.0 | 0.0 0.0 -1.0 0.0 | 1.0 |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for A:
p,q | 0 | 1
-----|---------------------------|----------------------
| 0.0 -1.0 -1.0 0.0 1.0 | 0.0 0.0 0.0 0.0
| 0.0 1.0 0.0 1.0 1.0 | 0.0 1.0 0.0 1.0
0 | 1.0 0.0 0.0 0.0 1.0 | -1.0 0.0 0.0 0.0
| 1.0 0.0 0.0 0.0 1.0 | 1.0 1.0 0.0 0.0
-----|---------------------------|----------------------
| 0.0 0.0 -1.0 -1.0 1.0 | 0.0 0.0 1.0 0.0
| 0.0 1.0 0.0 -1.0 1.0 | 1.0 1.0 0.0 1.0
1 | 0.0 0.0 -1.0 0.0 1.0 | -1.0 0.0 0.0 0.0
| -1.0 0.0 0.0 0.0 1.0 | 0.0 0.0 -1.0 0.0
Global general 9 × 8 matrix C with block size 4 × 2:
B,D 0 1 2 3
* *
| 0.0 1.0 | 1.0 5.0 | 6.0 7.0 | 8.0 9.0 |
| 0.0 -1.0 | 0.0 -1.0 | 0.0 -1.0 | 0.0 1.0 |
0 | 0.0 0.0 | 1.0 1.0 | 0.0 0.0 | -1.0 0.0 |
| 0.0 -1.0 | 0.0 1.0 | -1.0 -1.0 | 0.0 1.0 |
| -----------|-------------|-------------|----------- |
| -1.0 2.0 | 0.0 0.0 | 1.0 0.0 | 0.0 0.0 |
| -1.0 3.0 | 0.0 0.0 | -1.0 -1.0 | 0.0 0.0 |
1 | 0.0 4.0 | 1.0 0.0 | 1.0 0.0 | 0.0 0.0 |
| 1.0 5.0 | 0.0 0.0 | 0.0 0.0 | 1.0 0.0 |
| -----------|-------------|-------------|----------- |
2 | 1.0 2.0 | 3.0 4.0 | 1.0 1.0 | 1.0 1.0 |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 3 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for C:
p,q | 0 | 1
-----|----------------------|----------------------
| 0.0 1.0 6.0 7.0 | 1.0 5.0 8.0 9.0
| 0.0 -1.0 0.0 -1.0 | 0.0 -1.0 0.0 1.0
0 | 0.0 0.0 0.0 0.0 | 1.0 1.0 -1.0 0.0
| 0.0 -1.0 -1.0 -1.0 | 0.0 1.0 0.0 1.0
| 1.0 2.0 1.0 1.0 | 3.0 4.0 1.0 1.0
-----|----------------------|----------------------
| -1.0 2.0 1.0 0.0 | 0.0 0.0 0.0 0.0
| -1.0 3.0 -1.0 -1.0 | 0.0 0.0 0.0 0.0
1 | 0.0 4.0 1.0 0.0 | 1.0 0.0 0.0 0.0
| 1.0 5.0 0.0 0.0 | 0.0 0.0 1.0 0.0
Output:
Global general 9 × 8 matrix C with block size 4 × 2:
B,D 0 1 2 3
* *
| 0.0 1.0 | 1.0 5.0 | 7.0 8.0 | 8.0 8.0 |
| -1.0 0.0 | 0.0 0.0 | 0.0 -1.0 | 0.0 1.0 |
0 | -1.0 0.0 | 0.0 1.0 | 0.0 0.0 | -2.0 0.0 |
| 0.0 0.0 | -1.0 0.0 | -1.0 -1.0 | 0.0 1.0 |
| -----------|-------------|-------------|----------- |
| -1.0 2.0 | 0.0 1.0 | 0.0 1.0 | -1.0 0.0 |
| -1.0 4.0 | 0.0 1.0 | -1.0 0.0 | 0.0 0.0 |
1 | 0.0 4.0 | 2.0 0.0 | 1.0 0.0 | 0.0 -1.0 |
| 1.0 6.0 | 0.0 1.0 | 0.0 0.0 | 1.0 0.0 |
| -----------|-------------|-------------|----------- |
2 | 2.0 3.0 | 4.0 5.0 | 2.0 2.0 | 2.0 2.0 |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 3 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for C:
p,q | 0 | 1
-----|----------------------|----------------------
| 0.0 1.0 7.0 8.0 | 1.0 5.0 8.0 8.0
| -1.0 0.0 0.0 -1.0 | 0.0 0.0 0.0 1.0
0 | -1.0 0.0 0.0 0.0 | 0.0 1.0 -2.0 0.0
| 0.0 0.0 -1.0 -1.0 | -1.0 0.0 0.0 1.0
| 2.0 3.0 2.0 2.0 | 4.0 5.0 2.0 2.0
-----|----------------------|----------------------
| -1.0 2.0 0.0 1.0 | 0.0 1.0 -1.0 0.0
| -1.0 4.0 -1.0 0.0 | 0.0 1.0 0.0 0.0
1 | 0.0 4.0 1.0 0.0 | 2.0 0.0 0.0 -1.0
| 1.0 6.0 0.0 0.0 | 0.0 1.0 1.0 0.0
This example computes C = betaC+alphaAH using a 2 × 2 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)
M N ALPHA A IA JA DESC_A BETA C IC JC DESC_C
| | | | | | | | | | | |
CALL PZTRANC( 7 , 8 , ALPHA , A , 1 , 1 , DESC_A , BETA , C , 1 , 1 , DESC_C )
ALPHA = (1.0,0.0)
BETA = (1.0,0.0)
|
| Desc_A | Desc_C |
|---|---|---|
| DTYPE_ | 1 | 1 |
| CTXT_ | icontxt(IOBG33) | icontxt(IOBG33) |
| M_ | 8 | 7 |
| N_ | 7 | 8 |
| MB_ | 2 | 3 |
| NB_ | 3 | 2 |
| RSRC_ | 0 | 0 |
| CSRC_ | 0 | 0 |
| LLD_ | See below(EPSSL33) | See below(EPSSL33) |
|
Notes:
| ||
Global general 8 × 7 matrix A with block size 2 × 3:
B,D 0 1 2
* *
0 | ( 0.0, 1.0) (-1.0, 0.0) (-1.0, 0.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) | ( 1.0, 2.0) ( 0.0, 1.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|-------------------------------------|------------ |
1 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 1.0, 2.0) |
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) | (-1.0, 0.0) ( 1.0, 2.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|-------------------------------------|------------ |
2 | ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 1.0, 2.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|-------------------------------------|------------ |
3 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | (-1.0, 0.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for A:
p,q | 0 | 1
-----|-------------------------------------------------|------------------------------------
| ( 0.0, 1.0) (-1.0, 0.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0)
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 1.0, 2.0) ( 0.0, 1.0) ( 1.0, 2.0)
0 | ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0)
| ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 1.0, 2.0) ( 1.0, 2.0)
-----|-------------------------------------------------|------------------------------------
| ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) ( 1.0, 2.0) | (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0)
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | (-1.0, 0.0) ( 1.0, 2.0) ( 1.0, 2.0)
1 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0)
| (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0)
Global general 7 × 8 matrix C with block size 3 × 2:
B,D 0 1 2 3
* *
| ( 0.0,-2.0) ( 1.0,-1.0) | ( 1.0,-1.0) ( 5.0, 3.0) | ( 6.0, 4.0) ( 7.0, 5.0) | ( 8.0, 6.0) ( 9.0, 7.0) |
0 | ( 1.0,-1.0) (-1.0,-3.0) | ( 0.0,-2.0) (-1.0,-3.0) | ( 0.0,-2.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 1.0,-1.0) |
| ( 2.0, 0.0) ( 0.0,-2.0) | ( 1.0,-1.0) ( 1.0,-1.0) | ( 2.0, 0.0) ( 3.0, 1.0) | (-1.0,-3.0) ( 0.0,-2.0) |
| ------------------------|-------------------------|-------------------------|------------------------ |
| ( 3.0, 1.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 1.0,-1.0) | (-1.0,-3.0) (-1.0,-3.0) | ( 3.0, 1.0) ( 1.0,-1.0) |
1 | (-1.0,-3.0) ( 2.0, 0.0) | ( 0.0,-2.0) ( 0.0,-2.0) | ( 1.0,-1.0) ( 1.0,-1.0) | ( 2.0, 0.0) ( 0.0,-2.0) |
| (-1.0,-3.0) ( 3.0, 1.0) | ( 0.0,-2.0) ( 0.0,-2.0) | (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 0.0,-2.0) |
| ------------------------|-------------------------|-------------------------|------------------------ |
2 | ( 5.0, 3.0) ( 4.0, 2.0) | ( 1.0,-1.0) ( 0.0,-2.0) | ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 0.0,-2.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 3 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for C:
p,q | 0 | 1
-----|-------------------------------------------------|------------------------------------------------
| ( 0.0,-2.0) ( 1.0,-1.0) ( 6.0, 4.0) ( 7.0, 5.0) | ( 1.0,-1.0) ( 5.0, 3.0) ( 8.0, 6.0) ( 9.0, 7.0)
| ( 1.0,-1.0) (-1.0,-3.0) ( 0.0,-2.0) (-1.0,-3.0) | ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) ( 1.0,-1.0)
0 | ( 2.0, 0.0) ( 0.0,-2.0) ( 2.0, 0.0) ( 3.0, 1.0) | ( 1.0,-1.0) ( 1.0,-1.0) (-1.0,-3.0) ( 0.0,-2.0)
| ( 5.0, 3.0) ( 4.0, 2.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0)
-----|-------------------------------------------------|------------------------------------------------
| ( 3.0, 1.0) (-1.0,-3.0) (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 3.0, 1.0) ( 1.0,-1.0)
1 | (-1.0,-3.0) ( 2.0, 0.0) ( 1.0,-1.0) ( 1.0,-1.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 2.0, 0.0) ( 0.0,-2.0)
| (-1.0,-3.0) ( 3.0, 1.0) (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0)
Output:
Global general 7 × 8 matrix C with block size 3 × 2:
B,D 0 1 2 3
* *
| ( 0.0,-3.0) ( 1.0,-2.0) | ( 1.0,-2.0) ( 5.0, 2.0) | ( 7.0, 2.0) ( 8.0, 3.0) | ( 8.0, 5.0) ( 8.0, 7.0) |
0 | ( 0.0,-1.0) ( 0.0,-5.0) | ( 0.0,-3.0) ( 0.0,-5.0) | ( 0.0,-3.0) (-1.0,-4.0) | ( 0.0,-3.0) ( 1.0,-2.0) |
| ( 1.0, 0.0) ( 0.0,-3.0) | ( 0.0,-1.0) ( 1.0,-2.0) | ( 2.0,-1.0) ( 3.0, 0.0) | (-2.0,-3.0) ( 0.0,-3.0) |
| ------------------------|-------------------------|-------------------------|------------------------ |
| ( 3.0, 0.0) ( 0.0,-5.0) | (-1.0,-2.0) ( 0.0,-1.0) | (-1.0,-4.0) (-1.0,-4.0) | ( 3.0, 0.0) ( 1.0,-2.0) |
1 | (-1.0,-4.0) ( 2.0,-1.0) | ( 0.0,-3.0) ( 1.0,-4.0) | ( 0.0,-1.0) ( 2.0,-3.0) | ( 1.0, 0.0) ( 0.0,-3.0) |
| (-1.0,-4.0) ( 4.0,-1.0) | ( 0.0,-3.0) ( 1.0,-4.0) | (-1.0,-4.0) ( 0.0,-5.0) | ( 0.0,-3.0) ( 0.0,-3.0) |
| ------------------------|-------------------------|-------------------------|------------------------ |
2 | ( 5.0, 2.0) ( 4.0, 1.0) | ( 2.0,-3.0) ( 0.0,-3.0) | ( 1.0,-2.0) ( 0.0,-3.0) | ( 0.0,-3.0) (-1.0,-2.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 3 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for C:
p,q | 0 | 1
-----|-------------------------------------------------|------------------------------------------------
| ( 0.0,-3.0) ( 1.0,-2.0) ( 7.0, 2.0) ( 8.0, 3.0) | ( 1.0,-2.0) ( 5.0, 2.0) ( 8.0, 5.0) ( 8.0, 7.0)
| ( 0.0,-1.0) ( 0.0,-5.0) ( 0.0,-3.0) (-1.0,-4.0) | ( 0.0,-3.0) ( 0.0,-5.0) ( 0.0,-3.0) ( 1.0,-2.0)
0 | ( 1.0, 0.0) ( 0.0,-3.0) ( 2.0,-1.0) ( 3.0, 0.0) | ( 0.0,-1.0) ( 1.0,-2.0) (-2.0,-3.0) ( 0.0,-3.0)
| ( 5.0, 2.0) ( 4.0, 1.0) ( 1.0,-2.0) ( 0.0,-3.0) | ( 2.0,-3.0) ( 0.0,-3.0) ( 0.0,-3.0) (-1.0,-2.0)
-----|-------------------------------------------------|------------------------------------------------
| ( 3.0, 0.0) ( 0.0,-5.0) (-1.0,-4.0) (-1.0,-4.0) | (-1.0,-2.0) ( 0.0,-1.0) ( 3.0, 0.0) ( 1.0,-2.0)
1 | (-1.0,-4.0) ( 2.0,-1.0) ( 0.0,-1.0) ( 2.0,-3.0) | ( 0.0,-3.0) ( 1.0,-4.0) ( 1.0, 0.0) ( 0.0,-3.0)
| (-1.0,-4.0) ( 4.0,-1.0) (-1.0,-4.0) ( 0.0,-5.0) | ( 0.0,-3.0) ( 1.0,-4.0) ( 0.0,-3.0) ( 0.0,-3.0)
This example computes C = betaC+alphaAT using a 2 × 2 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)
M N ALPHA A IA JA DESC_A BETA C IC JC DESC_C
| | | | | | | | | | | |
CALL PZTRANU( 7 , 8 , ALPHA , A , 1 , 1 , DESC_A , BETA , C , 1 , 1 , DESC_C )
ALPHA = (1.0,0.0)
BETA = (1.0,0.0)
|
| Desc_A | Desc_C |
|---|---|---|
| DTYPE_ | 1 | 1 |
| CTXT_ | icontxt(IOBG34) | icontxt(IOBG34) |
| M_ | 8 | 7 |
| N_ | 7 | 8 |
| MB_ | 2 | 3 |
| NB_ | 3 | 2 |
| RSRC_ | 0 | 0 |
| CSRC_ | 0 | 0 |
| LLD_ | See below(EPSSL34) | See below(EPSSL34) |
|
Notes:
| ||
Global general 8 × 7 matrix A with block size 2 × 3:
B,D 0 1 2
* *
0 | ( 0.0, 1.0) (-1.0, 0.0) (-1.0, 0.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) | ( 1.0, 2.0) ( 0.0, 1.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|-------------------------------------|------------ |
1 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 1.0, 2.0) |
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) | (-1.0, 0.0) ( 1.0, 2.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|-------------------------------------|------------ |
2 | ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 1.0, 2.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|-------------------------------------|------------ |
3 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | (-1.0, 0.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for A:
p,q | 0 | 1
-----|-------------------------------------------------|------------------------------------
| ( 0.0, 1.0) (-1.0, 0.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0)
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 1.0, 2.0) ( 0.0, 1.0) ( 1.0, 2.0)
0 | ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0)
| ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 1.0, 2.0) ( 1.0, 2.0)
-----|-------------------------------------------------|------------------------------------
| ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) ( 1.0, 2.0) | (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0)
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | (-1.0, 0.0) ( 1.0, 2.0) ( 1.0, 2.0)
1 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0)
| (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0)
Global general 7 × 8 matrix C with block size 3 × 2:
B,D 0 1 2 3
* *
| ( 0.0,-2.0) ( 1.0,-1.0) | ( 1.0,-1.0) ( 5.0, 3.0) | ( 6.0, 4.0) ( 7.0, 5.0) | ( 8.0, 6.0) ( 9.0, 7.0) |
0 | ( 1.0,-1.0) (-1.0,-3.0) | ( 0.0,-2.0) (-1.0,-3.0) | ( 0.0,-2.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 1.0,-1.0) |
| ( 2.0, 0.0) ( 0.0,-2.0) | ( 1.0,-1.0) ( 1.0,-1.0) | ( 2.0, 0.0) ( 3.0, 1.0) | (-1.0,-3.0) ( 0.0,-2.0) |
| ------------------------|-------------------------|-------------------------|------------------------ |
| ( 3.0, 1.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 1.0,-1.0) | (-1.0,-3.0) (-1.0,-3.0) | ( 3.0, 1.0) ( 1.0,-1.0) |
1 | (-1.0,-3.0) ( 2.0, 0.0) | ( 0.0,-2.0) ( 0.0,-2.0) | ( 1.0,-1.0) ( 1.0,-1.0) | ( 2.0, 0.0) ( 0.0,-2.0) |
| (-1.0,-3.0) ( 3.0, 1.0) | ( 0.0,-2.0) ( 0.0,-2.0) | (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 0.0,-2.0) |
| ------------------------|-------------------------|-------------------------|------------------------ |
2 | ( 5.0, 3.0) ( 4.0, 2.0) | ( 1.0,-1.0) ( 0.0,-2.0) | ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 0.0,-2.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 3 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for C:
p,q | 0 | 1
-----|-------------------------------------------------|------------------------------------------------
| ( 0.0,-2.0) ( 1.0,-1.0) ( 6.0, 4.0) ( 7.0, 5.0) | ( 1.0,-1.0) ( 5.0, 3.0) ( 8.0, 6.0) ( 9.0, 7.0)
| ( 1.0,-1.0) (-1.0,-3.0) ( 0.0,-2.0) (-1.0,-3.0) | ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) ( 1.0,-1.0)
0 | ( 2.0, 0.0) ( 0.0,-2.0) ( 2.0, 0.0) ( 3.0, 1.0) | ( 1.0,-1.0) ( 1.0,-1.0) (-1.0,-3.0) ( 0.0,-2.0)
| ( 5.0, 3.0) ( 4.0, 2.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0)
-----|-------------------------------------------------|------------------------------------------------
| ( 3.0, 1.0) (-1.0,-3.0) (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 3.0, 1.0) ( 1.0,-1.0)
1 | (-1.0,-3.0) ( 2.0, 0.0) ( 1.0,-1.0) ( 1.0,-1.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 2.0, 0.0) ( 0.0,-2.0)
| (-1.0,-3.0) ( 3.0, 1.0) (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0)
Output:
Global general 7 × 8 matrix C with block size 3 × 2:
B,D 0 1 2 3
* *
| ( 0.0,-1.0) ( 1.0, 0.0) | ( 1.0, 0.0) ( 5.0, 4.0) | ( 7.0, 6.0) ( 8.0, 7.0) | ( 8.0, 7.0) ( 8.0, 7.0) |
0 | ( 0.0,-1.0) ( 0.0,-1.0) | ( 0.0,-1.0) ( 0.0,-1.0) | ( 0.0,-1.0) (-1.0,-2.0) | ( 0.0,-1.0) ( 1.0, 0.0) |
| ( 1.0, 0.0) ( 0.0,-1.0) | ( 0.0,-1.0) ( 1.0, 0.0) | ( 2.0, 1.0) ( 3.0, 2.0) | (-2.0,-3.0) ( 0.0,-1.0) |
| ------------------------|-------------------------|-------------------------|------------------------ |
| ( 3.0, 2.0) ( 0.0,-1.0) | (-1.0,-2.0) ( 0.0,-1.0) | (-1.0,-2.0) (-1.0,-2.0) | ( 3.0, 2.0) ( 1.0, 0.0) |
1 | (-1.0,-2.0) ( 2.0, 1.0) | ( 0.0,-1.0) ( 1.0, 0.0) | ( 0.0,-1.0) ( 2.0, 1.0) | ( 1.0, 0.0) ( 0.0,-1.0) |
| (-1.0,-2.0) ( 4.0, 3.0) | ( 0.0,-1.0) ( 1.0, 0.0) | (-1.0,-2.0) ( 0.0,-1.0) | ( 0.0,-1.0) ( 0.0,-1.0) |
| ------------------------|-------------------------|-------------------------|------------------------ |
2 | ( 5.0, 4.0) ( 4.0, 3.0) | ( 2.0, 1.0) ( 0.0,-1.0) | ( 1.0, 0.0) ( 0.0,-1.0) | ( 0.0,-1.0) (-1.0,-2.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 3 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for C:
p,q | 0 | 1
-----|-------------------------------------------------|------------------------------------------------
| ( 0.0,-1.0) ( 1.0, 0.0) ( 7.0, 6.0) ( 8.0, 7.0) | ( 1.0, 0.0) ( 5.0, 4.0) ( 8.0, 7.0) ( 8.0, 7.0)
| ( 0.0,-1.0) ( 0.0,-1.0) ( 0.0,-1.0) (-1.0,-2.0) | ( 0.0,-1.0) ( 0.0,-1.0) ( 0.0,-1.0) ( 1.0, 0.0)
0 | ( 1.0, 0.0) ( 0.0,-1.0) ( 2.0, 1.0) ( 3.0, 2.0) | ( 0.0,-1.0) ( 1.0, 0.0) (-2.0,-3.0) ( 0.0,-1.0)
| ( 5.0, 4.0) ( 4.0, 3.0) ( 1.0, 0.0) ( 0.0,-1.0) | ( 2.0, 1.0) ( 0.0,-1.0) ( 0.0,-1.0) (-1.0,-2.0)
-----|-------------------------------------------------|------------------------------------------------
| ( 3.0, 2.0) ( 0.0,-1.0) (-1.0,-2.0) (-1.0,-2.0) | (-1.0,-2.0) ( 0.0,-1.0) ( 3.0, 2.0) ( 1.0, 0.0)
1 | (-1.0,-2.0) ( 2.0, 1.0) ( 0.0,-1.0) ( 2.0, 1.0) | ( 0.0,-1.0) ( 1.0, 0.0) ( 1.0, 0.0) ( 0.0,-1.0)
| (-1.0,-2.0) ( 4.0, 3.0) (-1.0,-2.0) ( 0.0,-1.0) | ( 0.0,-1.0) ( 1.0, 0.0) ( 0.0,-1.0) ( 0.0,-1.0)