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

  • 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 421
11 Functions — Alphabetical List
11-78
exist
Check whether Composite is defined on workers
Syntax
h = exist(C,labidx)
h = exist(C)
Description
h = exist(C,labidx) returns true if the entry in Composite C has a defined value on
the worker with labindex labidx, false otherwise. In the general case where labidx
is an array, the output h is an array of the same size as labidx, and h(i) indicates
whether the Composite entry labidx(i) has a defined value.
h = exist(C) is equivalent to h = exist(C, 1:length(C)).
If exist(C,labidx) returns true, C(labidx) does not throw an error, provided that
the values of C on those workers are serializable. The function throws an error if any
labidx is invalid.
Examples
Define a variable on a random number of workers. Check on which workers the
Composite entries are defined, and get all those values:
spmd
if rand() > 0.5
c = labindex;
end
end
ind = exist(c);
cvals = c(ind);
See Also
Composite
Vista de pagina 421
1 2 ... 417 418 419 420 421 422 423 424 425 426 427 ... 655 656

Comentarios a estos manuales

Sin comentarios