Last active
August 29, 2015 14:23
-
-
Save stefanschmidt/048b5b8139c609ca6437 to your computer and use it in GitHub Desktop.
Continuous screen output in parfor loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% to enable continuous screen output in a parfor loop place a | |
% pause of 2-3 seconds before each fprintf or disp statement. | |
% it seems this flushes the stdout buffer of the worker nodes. | |
% tested with a local parpool in Matlab R2014b on OS X 10.9.5. | |
fprintf('pre\n') | |
parfor n = 1:5 | |
pause(2) | |
fprintf('start %i\n',n) | |
pause(10) | |
fprintf('end %i\n',n) | |
end | |
pause(2) | |
fprintf('post\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment