MATLAB PARALLEL COMPUTING TOOLBOX - S Betriebsanweisung Seite 120

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 656
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 119
5 Math with Codistributed Arrays
5-6
end
Lab 1: This lab stores D(:,1:250).
Lab 2: This lab stores D(:,251:500).
Lab 3: This lab stores D(:,501:750).
Lab 4: This lab stores D(:,751:1000).
Each worker has access to all segments of the array. Access to the local segment is
faster than to a remote segment, because the latter requires sending and receiving data
between workers and thus takes more time.
How MATLAB Displays a Codistributed Array
For each worker, the MATLAB Parallel Command Window displays information about
the codistributed array, the local portion, and the codistributor. For example, an 8-by-8
identity matrix codistributed among four workers, with two columns on each worker,
displays like this:
>> spmd
II = eye(8,'codistributed')
end
Lab 1:
This lab stores II(:,1:2).
LocalPart: [8x2 double]
Codistributor: [1x1 codistributor1d]
Lab 2:
This lab stores II(:,3:4).
LocalPart: [8x2 double]
Codistributor: [1x1 codistributor1d]
Lab 3:
This lab stores II(:,5:6).
LocalPart: [8x2 double]
Codistributor: [1x1 codistributor1d]
Lab 4:
This lab stores II(:,7:8).
LocalPart: [8x2 double]
Codistributor: [1x1 codistributor1d]
To see the actual data in the local segment of the array, use the getLocalPart function.
How Much Is Distributed to Each Worker
In distributing an array of N rows, if N is evenly divisible by the number of workers,
MATLAB stores the same number of rows (N/numlabs) on each worker. When this
Seitenansicht 119
1 2 ... 115 116 117 118 119 120 121 122 123 124 125 ... 655 656

Kommentare zu diesen Handbüchern

Keine Kommentare