MATLAB PARALLEL COMPUTING TOOLBOX - S Betriebsanweisung Seite 394

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 656
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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.
Seitenansicht 393
1 2 ... 389 390 391 392 393 394 395 396 397 398 399 ... 655 656

Kommentare zu diesen Handbüchern

Keine Kommentare