MATLAB PARALLEL COMPUTING TOOLBOX - S Uživatelská příručka Strana 458

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 656
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 457
11 Functions — Alphabetical List
11-114
getCurrentWorker
Worker object currently running this session
Syntax
worker = getCurrentWorker
Arguments
worker The worker object that is currently evaluating the task that contains
this function.
Description
worker = getCurrentWorker returns the Parallel.Worker object representing the
MATLAB worker session that is currently evaluating the task function that contains this
call.
If the function runs in a MATLAB session that is not a worker, it returns an empty
result.
Examples
Find the Host property of a worker that runs a task. The file identifyWorkerHost.m
contains the following function code.
function localHost = identifyWorkerHost()
thisworker = getCurrentWorker; % Worker object
localHost = thisworker.Host; % Host property
end
Create a job with a task to execute this function on a worker and return the worker’s host
name. This example manually attaches the necessary code file.
c = parcluster();
Zobrazit stránku 457
1 2 ... 453 454 455 456 457 458 459 460 461 462 463 ... 655 656

Komentáře k této Příručce

Žádné komentáře