createTask example code seems to sit idle
显示 更早的评论
Using MATLAB version 7.14.0.739 (R2012a) and the Parallel Computing Toolkit ver 6.0, I've been unable to run the createTask example code to completion. The code is copied from
with the addition of the first line to open matlabpool, as needed:
if ~matlabpool('size'),matlabpool('open','local');end
% Create a job object.
c = parcluster(); % Use default profile
j = createJob(c);
% Add a task object which generates a 10-by-10 random matrix.
t = createTask(j, @rand, 1, {10,10});
% Run the job.
submit(j);
% Wait for the job to finish running, and get the output from the task evaluation.
wait(j);
taskoutput = get(t, 'OutputArguments');
% Show the 10-by-10 random matrix.
disp(taskoutput{1});
When I run it, the only output is
Starting matlabpool using the 'local' profile ... connected to 4 labs.
The MATLAB windows continue to respond to user input, but the script never finishes nor displays output. The Windows Task Manager shows 5 MATLAB processes running, but only the first one gets CPU time (and only in response to user input) -- the other four get no CPU time.
Any help most appreciated.
Regards.
Greg
回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Job and Task Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!