MATLAB PARALLEL COMPUTING TOOLBOX - S Guide de l'utilisateur Page 469

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 656
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 468
gop
11-125
gop
Global operation across all workers
Syntax
res = gop(FUN,x)
res = gop(FUN,x,targetlab)
Arguments
FUN Function to operate across workers.
x Argument to function F, should be the same variable on all workers, but
can have different values.
res Variable to hold reduction result.
targetlab Lab to which reduction results are returned. This value is returned by
that worker’s labindex.
Description
res = gop(FUN,x) is the reduction via the function FUN of the quantities x from each
worker. The result is duplicated on all workers.
FUN can be a handle to any function, including user-written functions and user-defined
anonymous functions. It should accept two arguments of the same type, and return one
result of that same type, so it can be used iteratively in the form:
FUN(FUN(x1,x2),FUN(x3,x4))
The function FUN should be associative, that is,
FUN(FUN(x1,x2),x3) = FUN(x1,FUN(x2,x3))
res = gop(FUN,x,targetlab) performs the reduction, and places the result into res
only on the worker indicated by targetlab. res is set to [ ] on all other workers.
Vue de la page 468
1 2 ... 464 465 466 467 468 469 470 471 472 473 474 ... 655 656

Commentaires sur ces manuels

Pas de commentaire