From: Paul on
Is there a way to return data to the command window while parallel processes are executing? I have run tests and know that parallel processes started with createJob() do not disp anything to the command window. Is there a way to peek into the job and either pull out a variable or have the process disp something? The CaptureCommandWindowOutput only works when the process is finished. Thanks!
From: Edric M Ellis on
"Paul " <paulmark(a)eden.rutgers.edu> writes:

> Is there a way to return data to the command window while parallel
> processes are executing? I have run tests and know that parallel
> processes started with createJob() do not disp anything to the command
> window. Is there a way to peek into the job and either pull out a
> variable or have the process disp something? The
> CaptureCommandWindowOutput only works when the process is
> finished. Thanks!

Currently the only way to view the command window output while parallel
jobs are running is to use MATLABPOOL interactively. You can then use
PARFOR or SPMD as appropriate to run your algorithm, and the
command-window will be updated as things proceed. (Of course, this ties
up your desktop MATLAB session...). For example:

matlabpool local 2
spmd
for ii=1:10
% display something
fprintf( 'Hello: %d %d\n', labindex, ii );
% wait a while based on labindex
pause( 1 / labindex );
end
end

Cheers,

Edric.
From: mevans on
It depends on what you are doing, but in unsupported land you might try a couple of things I've cooked up lately:
http://www.mathworks.fr/matlabcentral/fileexchange/26740-parallel-producer-consumer-for-matlabpool
http://www.mathworks.fr/matlabcentral/fileexchange/26663-parallel-communication-for-matlabpool

Best,
-Matt