MATLAB PARALLEL COMPUTING TOOLBOX - S Guia do Utilizador Página 449

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
Vista de página 448
gcp
11-105
gcp
Get current parallel pool
Syntax
p = gcp
p = gcp('nocreate')
Description
p = gcp returns a parallel.Pool object representing the current parallel pool. The
current pool is where parallel language features execute, such as parfor, spmd,
distributed, Composite, parfeval and parfevalOnAll.
If no parallel pool exists, gcp starts a new parallel pool and returns a pool object for that,
unless automatic pool starts are disabled in your parallel preferences. If no parallel pool
exists and automatic pool starts are disabled, gcp returns an empty pool object.
p = gcp('nocreate') returns the current pool if one exists. If no pool exists,
the 'nocreate' option causes gcp not to create a pool, regardless of your parallel
preferences settings.
Examples
Find Size of Current Pool
Find the number of workers in the current parallel pool.
p = gcp('nocreate'); % If no pool, do not create new one.
if isempty(p)
poolsize = 0;
else
poolsize = p.NumWorkers
end
Delete Current Pool
Use the parallel pool object to delete the current pool.
Vista de página 448
1 2 ... 444 445 446 447 448 449 450 451 452 453 454 ... 655 656

Comentários a estes Manuais

Sem comentários