File: node28.html

package info (click to toggle)
scalapack-doc 1.5-11
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 10,336 kB
  • ctags: 4,931
  • sloc: makefile: 47; sh: 18
file content (110 lines) | stat: -rw-r--r-- 8,593 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>Details of Example Program #1</TITLE>
<META NAME="description" CONTENT="Details of Example Program #1">
<META NAME="keywords" CONTENT="slug">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="slug.css">
</HEAD>
<BODY LANG="EN" >
 <A NAME="tex2html2467" HREF="node29.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="http://www.netlib.org/utk/icons/next_motif.gif"></A> <A NAME="tex2html2465" HREF="node25.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="http://www.netlib.org/utk/icons/up_motif.gif"></A> <A NAME="tex2html2459" HREF="node27.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="http://www.netlib.org/utk/icons/previous_motif.gif"></A> <A NAME="tex2html2469" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="http://www.netlib.org/utk/icons/contents_motif.gif"></A> <A NAME="tex2html2470" HREF="node190.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="http://www.netlib.org/utk/icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html2468" HREF="node29.html">Simplifying Assumptions Used in </A>
<B>Up:</B> <A NAME="tex2html2466" HREF="node25.html">Getting Started with ScaLAPACK</A>
<B> Previous:</B> <A NAME="tex2html2460" HREF="node27.html">Source Code for Example </A>
<BR> <P>
<H1><A NAME="SECTION04230000000000000000">Details of Example Program #1</A></H1>
<A NAME="674">&#160;</A>
<A NAME="example1">&#160;</A>
<P>
This example program demonstrates the basic requirements to
call a ScaLAPACK routine -- initializing the process grid, assigning the 
matrix to the processes, calling
the ScaLAPACK routine, and releasing the process grid.  For further
details on each of these steps, please refer to section&nbsp;<A HREF="node33.html#basicsteps">2.4</A>.
<P>
This example program solves the <IMG WIDTH=37 HEIGHT=24 ALIGN=MIDDLE ALT="tex2html_wrap_inline12402" SRC="img38.gif"> system of linear
equations given by
<BR><IMG WIDTH=524 HEIGHT=191 ALIGN=BOTTOM ALT="displaymath12392" SRC="img39.gif"><BR>
<P>
using the ScaLAPACK driver routine PDGESV.
The ScaLAPACK routine PDGESV solves a system of linear
equations <IMG WIDTH=81 HEIGHT=12 ALIGN=BOTTOM ALT="tex2html_wrap_inline12404" SRC="img40.gif">, where the coefficient matrix (denoted by <I>A</I>) and the
right-hand-side matrix (denoted by <I>B</I>) are real, general distributed matrices.
The coefficient matrix <I>A</I> is distributed as depicted below, and for simplicity,
we shall solve the system for one right-hand side (<I>NRHS</I>=1); that is, the matrix
B is a vector.  The third element of the matrix B is equal to 1, and all other
elements are equal to 0.  After solving this system of equations, the solution
vector <I>X</I> is given by
<BR><IMG WIDTH=326 HEIGHT=191 ALIGN=BOTTOM ALT="displaymath12393" SRC="img41.gif"><BR>
<P>
Let us assume that the matrix <I>A</I> is partitioned and distributed as denoted
in figure&nbsp;<A HREF="node78.html#figmat9">4.6</A>; that is, we have chosen
the row and column block sizes as <I>MB</I>=<I>NB</I>=2, and the matrix is distributed
on a 2 <IMG WIDTH=9 HEIGHT=16 ALIGN=MIDDLE ALT="tex2html_wrap_inline12420" SRC="img42.gif"> 3 process grid (<IMG WIDTH=50 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline12422" SRC="img43.gif">,<IMG WIDTH=49 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline12424" SRC="img44.gif">).  The partitioning
and distribution of our example matrix <I>A</I> is represented in
figures&nbsp;<A HREF="node28.html#figmata9">2.1</A> and <A HREF="node28.html#figgrida9">2.2</A>, where, to aid visualization,
we use the notation <I>s</I>=19, <I>c</I>=3, <I>a</I>=1, <I>l</I>=12, <I>p</I>=16, and <I>k</I>=11.
<P><A NAME="707">&#160;</A><A NAME="figmata9">&#160;</A><IMG WIDTH=230 HEIGHT=170 ALIGN=BOTTOM ALT="figure705" SRC="img45.gif"><BR>
<STRONG>Figure 2.1:</STRONG> Partitioning of global matrix <I>A</I> (<I>s</I>=19;<I>c</I>=3;<I>a</I>=1;<I>l</I>=12;<I>p</I>=16;<I>k</I>=11)<BR>
<P>
<P>
<P><A NAME="7941">&#160;</A><A NAME="figgrida9">&#160;</A><IMG WIDTH=255 HEIGHT=169 ALIGN=BOTTOM ALT="figure710" SRC="img46.gif"><BR>
<STRONG>Figure 2.2:</STRONG> Mapping of matrix <I>A</I> onto process grid (<IMG WIDTH=50 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline12422" SRC="img43.gif">,<IMG WIDTH=49 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline12424" SRC="img44.gif">).
         For example, note that process (0,0) contains a local array
         of size <I>A</I>(5,4).<BR>
<P>
<P>
The partitioning and distribution of our example matrix <I>B</I>
are demonstrated in figure&nbsp;<A HREF="node28.html#figgridb9">2.3</A>.
<P><A NAME="7943">&#160;</A><A NAME="figgridb9">&#160;</A><IMG WIDTH=222 HEIGHT=169 ALIGN=BOTTOM ALT="figure717" SRC="img47.gif"><BR>
<STRONG>Figure 2.3:</STRONG> Mapping of matrix <I>B</I> onto process grid (<IMG WIDTH=50 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline12422" SRC="img43.gif">,<IMG WIDTH=49 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline12424" SRC="img44.gif">)<BR>
<P>
Note
that matrix <I>B</I> is distributed only in column 0 of the process grid.  All
other columns in the process grid possess an empty local portion of the matrix
<I>B</I>.
<P>
On exit from PDGESV, process (0,0) contains (in the global view)
the global vector <I>X</I> and (in the local view) the local array <I>B</I> given by
<BR><IMG WIDTH=374 HEIGHT=105 ALIGN=BOTTOM ALT="displaymath12394" SRC="img48.gif"><BR>
and process (1,0) contains (in the global view) the global vector <I>X</I> and
(in the local view) local array <I>B</I> given by
<BR><IMG WIDTH=374 HEIGHT=87 ALIGN=BOTTOM ALT="displaymath12395" SRC="img49.gif"><BR>
<P>
The normalized residual check
<BR><IMG WIDTH=331 HEIGHT=41 ALIGN=BOTTOM ALT="displaymath12396" SRC="img50.gif"><BR>
is performed on the solution to verify the accuracy of the results.
<P>
For more information on the
BLACS routines called in this program, please refer to
section&nbsp;<A HREF="node33.html#basicsteps">2.4</A>, Appendix&nbsp;<A HREF="node185.html#chapqrefblacs">D.3</A>, [<A HREF="node189.html#lawn94">54</A>], and the BLACS homepage
(<TT>http://www.netlib.org/blacs/index.html</TT>).  Further details of
the matrix distribution and storage scheme can be found in 
section&nbsp;<A HREF="node30.html#secvariables">2.3.2</A>, figure&nbsp;<A HREF="node78.html#figmat9">4.6</A>, and
table&nbsp;<A HREF="node78.html#tableofldas">4.8</A>.
Complete details on matrix distribution can be found in
Chapter&nbsp;<A HREF="node68.html#chap2dbsd">4</A> and details of the array descriptors can be found in
section&nbsp;<A HREF="node76.html#seclocalstorage">4.3.2</A>.
For a more flexible and memory efficient example program, please refer
to Appendix&nbsp;<A HREF="node180.html#example2">C.1</A>.
<P>
<BR> <HR>
<UL><A NAME="CHILD_LINKS">&#160;</A>
<LI> <A NAME="tex2html2471" HREF="node29.html#SECTION04231000000000000000">Simplifying Assumptions Used in Example Program</A>
<LI> <A NAME="tex2html2472" HREF="node30.html#SECTION04232000000000000000">Notation Used in Example Program</A>
<LI> <A NAME="tex2html2473" HREF="node31.html#SECTION04233000000000000000">Output of Example Program #1 Using MPI</A>
<LI> <A NAME="tex2html2474" HREF="node32.html#SECTION04234000000000000000">Output of Example Program #1 Using PVM</A>
</UL>
<HR><A NAME="tex2html2467" HREF="node29.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="http://www.netlib.org/utk/icons/next_motif.gif"></A> <A NAME="tex2html2465" HREF="node25.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="http://www.netlib.org/utk/icons/up_motif.gif"></A> <A NAME="tex2html2459" HREF="node27.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="http://www.netlib.org/utk/icons/previous_motif.gif"></A> <A NAME="tex2html2469" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="http://www.netlib.org/utk/icons/contents_motif.gif"></A> <A NAME="tex2html2470" HREF="node190.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="http://www.netlib.org/utk/icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html2468" HREF="node29.html">Simplifying Assumptions Used in </A>
<B>Up:</B> <A NAME="tex2html2466" HREF="node25.html">Getting Started with ScaLAPACK</A>
<B> Previous:</B> <A NAME="tex2html2460" HREF="node27.html">Source Code for Example </A>
<P><ADDRESS>
<I>Susan Blackford <BR>
Tue May 13 09:21:01 EDT 1997</I>
</ADDRESS>
</BODY>
</HTML>