MATLAB PARALLEL COMPUTING TOOLBOX - S Guía de usuario Pagina 125

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 656
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 124
Working with Codistributed Arrays
5-11
size(D)
L = getLocalPart(D);
size(L)
end
returns on each worker:
3 80
3 20
Each worker recognizes that the codistributed array D is 3-by-80. However, notice that
the size of the local part, L, is 3-by-20 on each worker, because the 80 columns of D are
distributed over four workers.
Creating a Codistributed from Local Arrays
Use the codistributed function to perform the reverse operation. This function,
described in “Building from Smaller Arrays” on page 5-8, combines the local variant
arrays into a single array distributed along the specified dimension.
Continuing the previous example, take the local variant arrays L and put them together
as segments to build a new codistributed array X.
spmd
codist = codistributor1d(2,[20 20 20 20],[3 80]);
X = codistributed.build(L,codist);
size(X)
end
returns on each worker:
3 80
Obtaining information About the Array
MATLAB offers several functions that provide information on any particular array. In
addition to these standard functions, there are also two functions that are useful solely
with codistributed arrays.
Determining Whether an Array Is Codistributed
The iscodistributed function returns a logical 1 (true) if the input array is
codistributed, and logical 0 (false) otherwise. The syntax is
spmd, TF = iscodistributed(D), end
Vista de pagina 124
1 2 ... 120 121 122 123 124 125 126 127 128 129 130 ... 655 656

Comentarios a estos manuales

Sin comentarios