Hands-On
Exercises for ScaLAPACK
Additional examples: This directory contains additional examples
illustrating the use of ScaLAPACK functionalities:
- pdpttr_2.c
(pdpttr_2.f) shows
the use of the ScaLAPACK routines PDPTTRF and PPPTTRS to factor and
solve a symmetric positive definite tridiagonal system of linear
equations Tx = b, in two distinct contexts, with two processors each and distinct right-hand sides.
0 2
/ 1.8180 0.8385
\ / x1_1 x1_2 \ / 1 8 \
| 0.8385 1.6602 0.5681
| | x2_1 x2_2 |
| 2 7 |
| 0.5681 1.3420 0.3704
| |
x3_1 x3_2 |
| 3 6 |
| 0.3704 1.2897 0.7027 | | x4_1 x4_2 |
| 4 5 |
|
0.7027 1.3412 0.5466 | * | x5_1 x5_2 | = | 5 4 |
|
0.5466 1.5341 0.4449 | | x6_1 x6_2 | | 6 3 |
|
0.4449 1.7271 0.6946 | | x7_1 x7_2 | | 7 2 |
\
0.6946 1.3093 / \ x8_1 x8_2 / \ 8 1 /
1 3
Note: PEs 0
and 2 hold the values in red and blue while PEs 1 and 3 hold the values
in green and magenta. The colors in the right-hand sides indicate how
the entries are distributed on each processor (the same for the
corresponding x's).
- pdgesvddrv.f
reads a (full) matrix A
from a file, distributes A among the available processors and then calls
the ScaLAPACK subroutine PDGESVD to compute the SVD of A, i.e.
A=U*S*V^{T}. It requires the file pdgesvddrv.dat,
which should contain: line 1, the name of the file where A will be read
from; line 2, the number of rows of A; line 3: the number of columns of
A. If the first 100 rows of the file A.dat are used to generate a matrix A of dimension 10-by-10 the corresponding SVD is given in the file A.SVD.
- pzdtt_col_major.c:
shows the use of the ScaLAPACK routines PZDTTRF and PZDTTRS to factor
and solve a tridiagonal system of linear equations in nprow distinct
contexts, column-major ordering.
- pzdtt_rwo_major.c:
shows the use of the ScaLAPACK routines PZDTTRF and PZDTTRS to factor
and solve a tridiagonal system of linear equations in nprow distinct
contexts, row-major ordering.