createTask example code seems to sit idle
1 view (last 30 days)
Show older comments
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
0 Comments
Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!