When remotes crash, loop for all slaves before stopping

time-shift
Marco Ratto 2010-10-08 17:54:31 +02:00
parent 50cdcfb037
commit 5c92543036
1 changed files with 10 additions and 3 deletions

View File

@ -502,6 +502,7 @@ dynareParallelGetFiles([fname,'_output_*.mat'],PRCDir,Parallel(1:totSlaves));
% Create return value.
iscrash = 0;
for j=1:totCPU,
load([fname,'_output_',int2str(j),'.mat'],'fOutputVar');
delete([fname,'_output_',int2str(j),'.mat']);
@ -510,11 +511,17 @@ for j=1:totCPU,
end
if isfield(fOutputVar,'error'),
disp(['Job number ',int2str(j),'crashed with error:']);
error([fOutputVar.error.message]);
iscrash=1;
keyboard;
disp([fOutputVar.error.message]);
else
fOutVar(j)=fOutputVar;
end
fOutVar(j)=fOutputVar;
end
if iscrash,
error('Remote jobs crashed');
end
pause(1), % wait for all remote diary off completed
% Cleanup. (Only if the computing is executed remotly).