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

  • 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 393
11 Functions — Alphabetical List
11-50
Examples
The following examples all use a local parallel pool of four workers, opened with the
statement:
p = parpool('local',4);
This example shows how to create a Composite object with no defined elements, then
assign values using a for-loop in the client.
c = Composite(); % One element per worker in the pool
for w = 1:length(c)
c{w} = 0; % Value stored on each worker
end
This example shows how to assign Composite elements in an spmd block.
c = Composite();
spmd
c = 0; % Value stored on each worker
end
This example shows how to assign the elements of a Composite with a value from each
worker.
c = Composite();
spmd
c = labindex;
end
c{:}
1
2
3
4
This example shows how to use a distributed array vector to set the values of a
Composite.
Vue de la page 393
1 2 ... 389 390 391 392 393 394 395 396 397 398 399 ... 655 656

Commentaires sur ces manuels

Pas de commentaire