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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
|
<!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>Tuning the Distribution Parameters for Better Performance</TITLE>
<META NAME="description" CONTENT="Tuning the Distribution Parameters for Better Performance">
<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="tex2html3832" HREF="node131.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="http://www.netlib.org/utk/icons/next_motif.gif"></A> <A NAME="tex2html3830" HREF="node127.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="http://www.netlib.org/utk/icons/up_motif.gif"></A> <A NAME="tex2html3826" HREF="node129.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="http://www.netlib.org/utk/icons/previous_motif.gif"></A> <A NAME="tex2html3834" 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="tex2html3835" 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="tex2html3833" HREF="node131.html">Performance of Banded and </A>
<B>Up:</B> <A NAME="tex2html3831" HREF="node127.html">Performance Improvement</A>
<B> Previous:</B> <A NAME="tex2html3827" HREF="node129.html">Choosing a Faster BLAS </A>
<BR> <P>
<H2><A NAME="SECTION04543000000000000000">Tuning the Distribution Parameters for Better Performance</A></H2>
<P>
<A NAME="subsectuning"> </A>
<A NAME="4261"> </A><A NAME="4262"> </A>
<P>
By adjusting the data distribution of the matrices,
users may be able to achieve 10-50 % greater
performance than by using
the standard data distribution suggested in section <A HREF="node106.html#distmemcomp">5.1.1</A>.
<P>
The performance attained using the standard data distribution
is usually fairly close to optimal; hence, if one is
getting poor performance, it is unlikely that
modifying the data distribution will solve the performance
problem.
<P>
An optimal data distribution
depends upon several factors including
the performance
characteristics
of the hardware,
the ScaLAPACK routine invoked,
and (to a certain
extent) the
problem size.
The algorithms
currently
implemented in
ScaLAPACK
fall
into two main
classes.
<P>
The first class
of algorithms
is distinguished
by the fact
that at each
step a block
of rows or
columns is
replicated
in all process
rows or columns.
Furthermore, the
process row or
column source of this
broadcast operation
is the one immediately
following -- or
preceding depending
on the algorithm --
the process row
or column source
of the broadcast
operation performed
at the previous
step of the algorithm.
The <I>QR</I> factorization
and the right looking
variant of the <I>LU</I>
factorization
are typical
examples of
such algorithms,
where it is thus
possible to
establish and
maintain a
communication
pipeline in
order to overlap
computation and
communication.
The direction
of the pipeline
determines the
best possible
shapes of the
process grid.
For instance,
the <I>LU</I>, <I>QR</I>, and
<I>QL</I> factorizations
perform better
for ``flat''
process grids
(<IMG WIDTH=59 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline17130" SRC="img423.gif">). These
factorizations
perform a reduction
operation for each
matrix column for
pivoting in the
<I>LU</I> factorization
and for computing
the Householder
transformation
in the <I>QR</I> and <I>QL</I>
decompositions.
Moreover, after
this reduction
has been performed,
it is important
to update the
next block of
columns as fast
as possible.
This update is done
by broadcasting
the current block
of columns using
a ring topology,
that is, feeding the
ongoing communication
pipe. Similarly,
the performance
of the <I>LQ</I> and <I>RQ</I>
factorizations
take advantage
of ``tall'' grids
(<IMG WIDTH=59 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline17142" SRC="img424.gif">) for
the same, but
transposed,
reasons.
<P>
The second group
of algorithms
is characterized
by the physical
transposition of
a block of rows
and/or columns
at each step.
Square or near
square grids
are more adequate
from a performance
point of view for
these transposition
operations. Examples
of such algorithms
implemented in
ScaLAPACK include
the right-looking
variant of the
Cholesky factorization,
the matrix inversion
algorithm, and the
reductions to bidiagonal
form (PxGEBRD),
to Hessenberg form
(PxGEHRD), and
to tridiagonal form
(PxSYTRD). It
is interesting to
note that if
square grids are
more efficient
for these matrix
reduction operations,
the corresponding
eigensolver usually
prefers flatter grids.
<P>
Table <A HREF="node130.html#tabsugg">5.17</A>
summarizes this
paragraph and
provides suggestions
for selecting the
most appropriate
shape of the
logical <IMG WIDTH=57 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline12182" SRC="img25.gif">
process grid from
a performance
point of view.
The results
presented in
this table may
need to be refined
depending on
the physical
characteristics
of the physical
interconnection
network.
<P><A NAME="4272"> </A><A NAME="tabsugg"> </A><IMG WIDTH=547 HEIGHT=197 ALIGN=BOTTOM ALT="table4271" SRC="img425.gif"><BR>
<STRONG>Table 5.17:</STRONG> Process grid suggestions for some ScaLAPACK drivers<BR>
<P>
<P>
Assume that
at most <I>P</I> nodes
are available. A
natural question
is: Could
we decide which <IMG WIDTH=94 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline17180" SRC="img426.gif"> process grid
should be used?
Similarly,
depending on
the value of
<I>P</I>, it is not
always possible
to factor <IMG WIDTH=94 HEIGHT=25 ALIGN=MIDDLE ALT="tex2html_wrap_inline17184" SRC="img427.gif"> to create an
appropriate
grid shape.
For example,
if the number
of nodes
available is
a prime number
and a square
grid is suitable
with respect to
performance, it
may be beneficial
to let some nodes
remain idle so
that the remaining
nodes can be arranged
in a ``squarer''
grid.
<P>
If the BLACS
implementation
or the interconnection
network features
high latency, a
one-dimensional data
distribution will improve
the performance for
small and medium
problem sizes.
The number
of messages
significantly
impacts the
performance
achieved for
small problem
sizes, whereas
the total
message volume
becomes a
dominant
factor
for medium-sized problems. The
performance
cost due to
floating-point
operations
dominates for
large problem
sizes.
One-dimensional
data distributions
reduce the
total number
of messages
exchanged on the
interconnection
network but
increase the
total volume of message traffic.
Therefore,
one-dimensional data distributions are better
for small problem sizes but are worse
for large problem sizes, especially when
one is using eight or more processors.
<P>
Determining optimal,
or near-optimal,
distribution
block sizes with
respect to performance
<A NAME="4312"> </A> for a given
platform is a
difficult task.
However, it is
empirically true
that as soon as a
good block size
or even a set of
good distribution
parameters is
found, the
performance
is not highly
sensitive to
small changes
of the values
of these parameters.
<P>
<HR><A NAME="tex2html3832" HREF="node131.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="http://www.netlib.org/utk/icons/next_motif.gif"></A> <A NAME="tex2html3830" HREF="node127.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="http://www.netlib.org/utk/icons/up_motif.gif"></A> <A NAME="tex2html3826" HREF="node129.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="http://www.netlib.org/utk/icons/previous_motif.gif"></A> <A NAME="tex2html3834" 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="tex2html3835" 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="tex2html3833" HREF="node131.html">Performance of Banded and </A>
<B>Up:</B> <A NAME="tex2html3831" HREF="node127.html">Performance Improvement</A>
<B> Previous:</B> <A NAME="tex2html3827" HREF="node129.html">Choosing a Faster BLAS </A>
<P><ADDRESS>
<I>Susan Blackford <BR>
Tue May 13 09:21:01 EDT 1997</I>
</ADDRESS>
</BODY>
</HTML>
|