MATLAB PARALLEL COMPUTING TOOLBOX - S Podręcznik Użytkownika Strona 64

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
Przeglądanie stron 63
2 Parallel for-Loops (parfor)
2-36
parfor statement might produce values of X with different round-off errors. This is an
unavoidable cost of parallelism.
For example, the statement on the left yields 1, while the statement on the right returns
1 + eps:
(1 + eps/2) + eps/2 1 + (eps/2 + eps/2)
With the exception of the minus operator (-), all the special cases listed in the table in
“Reduction Variables” on page 2-32 have a corresponding (perhaps approximately)
associative function. MATLAB calculates the assignment X = X - expr by using X =
X + (-expr). (So, technically, the function for calculating this reduction assignment is
plus, not minus.) However, the assignment X = expr - X cannot be written using an
associative function, which explains its exclusion from the table.
Commutativity in Reduction Assignments. Some associative functions, including +, .*,
min, and max, intersect, and union, are also commutative. That is, they satisfy the
following for all a and b:
f(a,b) = f(b,a)
Examples of noncommutative functions are * (because matrix multiplication is not
commutative for matrices in which both dimensions have size greater than one), [,],
[;], {,}, and {;}. Noncommutativity is the reason that consistency in the order
of arguments to these functions is required. As a practical matter, a more efficient
algorithm is possible when a function is commutative as well as associative, and parfor
is optimized to exploit commutativity.
Recommended: Except in the cases of *, [,], [;], {,}, and {;}, the function f of
a reduction assignment should be commutative. If f is not commutative, different
executions of the loop might result in different answers.
Violating the restriction on commutativity in a function used for reduction, could result
in unexpected behavior, even if it does not generate an error.
Unless f is a known noncommutative built-in, it is assumed to be commutative. There is
currently no way to specify a user-defined, noncommutative function in parfor.
Overloading in Reduction Assignments. Most associative functions f have an identity
element e, so that for any a, the following holds true:
Przeglądanie stron 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 655 656

Komentarze do niniejszej Instrukcji

Brak uwag

Atlona Amplificadores de audio manuales de usuario

Empezando en A

Haga clic en el alfabeto a continuación para desplazarse a la lista completa de modelos que comienzan con esa letra

Modelos Tipo de documento
AT-3GSDI-14
Manual de usuario   Residential - AVPro Alliance, 96 paginas
AT-DVI-14A
Manual de usuario   Atlona AT-DVI-14A User manual, 20 paginas
AT-HD-V112
Manual de usuario   Product Catalog, 60 paginas
Manual de usuario   Atlona AT-HD-V112 User manual, 7 paginas
AT-HD-V116
Manual de usuario   AtlonA - BZB Express, 9 paginas
AT-HD-V18
Manual de usuario   Atlona AT-HD-V18 User manual, 7 paginas
Manual de usuario   AtlonA, 9 paginas
AT-HD19SS
Manual de usuario   www.AtlonA.com, 2 paginas
AT-HDCAT-8
Manual de usuario   atlona-2014-catalog-2 - Genesis Technologies, 86 paginas
Manual de usuario   Atlona HDMI Distribution Amplifier Family, 6 paginas
Manual de usuario   Atlona 2 x 8 HDMI to HDBaseTTM Extended Distance Distribution, 1 paginas
AT-HDDA-4
Manual de usuario   Summer 2013 Catalog, 96 paginas
AT-HDDA-8
Manual de usuario   Atlona HDDA HDMI Distribution Amplifier Collection Atlona 1 x 8, 1 paginas
AT-HDRS
Manual de usuario   Atlona AT-HDRS User`s manual, 12 paginas
AT-PA100
Manual de usuario   Atlona [en] , 4 paginas
AT-PA100-G2
Manual de usuario   Atlona AT-PA100-G2 User manual, 10 paginas
Manual de usuario   Atlona AT-PA100-G2 User manual, 13 paginas
AT-SDI-14
Manual de usuario   Atlona AT-SDI-14 User`s manual, 16 paginas