questions about distributed jobs with Local Scheduler

1 次查看(过去 30 天)
If using a Local Scheduler,
From Help, one syntax of createTask is
t = createTask(j, F, N, {inputargs})
This task evaluates the function specified by a function handle or function name F, with the given input arguments {inputargs}, returning N output arguments.
1. Can I use createTask to execute a script? This script will generate .mat file to save all the variables I need. Do I have to specify N and {inputargs} here? Can I just use createTask as below and retrieve the .mat file later?
createTask(j, MyScript)
2. Should I specify beforehand the FileDependencies and PathDependencies for worker to find "MyScript" in the step "create jobs"?
3. If there are 7 cores as workers, and I want each worker evaluate one MyScript simultaneously, should I have the following lines?
createTask(j, MyScript01)
createTask(j, MyScript02)
createTask(j, MyScript03)
createTask(j, MyScript04)
createTask(j, MyScript05)
createTask(j, MyScript06)
createTask(j, MyScript07)
4. If there are 7 cores as workers and I have following lines
createTask(j, MyScript01)
createTask(j, MyScript02)
createTask(j, MyScript03)
Does this means only 3 cores are running and other 4 cores are not used?
5. If there are 7 cores as workers and I have following lines
createTask(j, MyScript01)
createTask(j, MyScript02)
createTask(j, MyScript03)
createTask(j, MyScript04)
createTask(j, MyScript05)
createTask(j, MyScript06)
createTask(j, MyScript07)
createTask(j, MyScript08)
createTask(j, MyScript09)
Does this means MyScript08 and MyScript09 will be executed when 01-07 finished? or, Does this means MyScript08 and MyScript09 will never be executed?

回答(1 个)

Walter Roberson
Walter Roberson 2012-8-11
The argument must be a function handle or array of function handles. It is not possible to take a function handle of a script. It is, however, possible to use (e.g.)
@() scriptname
I think you would have to provide N as 0.
Note: I do not have the toolbox to test whether createTask will accept this.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by