Merge remote branch 'ratto/master'

time-shift
Sébastien Villemot 2010-10-15 12:41:50 +02:00
commit 4881b8c3f9
3 changed files with 16 additions and 10 deletions

View File

@ -84,6 +84,8 @@ elseif strcmpi(type,'gsa')
else
MhDirectoryName = CheckPath('prior');
end
delete([MhDirectoryName filesep M_.fname '_IRF_DSGEs*.mat']);
delete([MhDirectoryName filesep M_.fname '_IRF_BVARDSGEs*.mat']);
if strcmpi(type,'posterior')
load([ MhDirectoryName filesep M_.fname '_mh_history.mat'])
TotalNumberOfMhDraws = sum(record.MhDraws(:,1));

View File

@ -36,9 +36,9 @@ for indPC=1:length(Parallel),
if Parallel(indPC).Local==0,
if isunix || (~matlab_ver_less_than('7.4') && ismac),
for jfil=1:size(NamFileInput,1),
if ~isempty(dynareParallelDir(NamFileInput{jfil,2},[PRCDir,filesep,NamFileInput{jfil,1}],Parallel(indPC))),
% if ~isempty(dynareParallelDir(NamFileInput{jfil,2},[PRCDir,filesep,NamFileInput{jfil,1}],Parallel(indPC))),
system(['scp ',Parallel(indPC).user,'@',Parallel(indPC).PcName,':',Parallel(indPC).RemoteFolder,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]);
end
% end
end
else
for jfil=1:size(NamFileInput,1),

View File

@ -192,7 +192,7 @@ for j=1:totCPU,
% Creo un file che mi serve per sapere se la computazione di un
% blocco parallelo (una core) è terminata oppure no!
% blocco parallelo (una core) è terminata oppure no!
fid1=fopen(['P_',fname,'_',int2str(j),'End.txt'],'w+');
fclose(fid1);
@ -230,7 +230,7 @@ for j=1:totCPU,
end
else
% Se la computazione è remota, lo creo in locale, lo copio directory remota (creata
% Se la computazione è remota, lo creo in locale, lo copio directory remota (creata
% sopra) e lo cancello in locale. Lo stesso vale per gli altri
% dati.
save( ['slaveParallel_input',int2str(j)],'Parallel');
@ -320,13 +320,13 @@ for j=1:totCPU,
end
end
elseif Parallel(indPC).Local==0, % Run using network on remote machine or also on local machine.
if j==nCPU0+1,
dynareParallelSendFiles(NamFileInput,PRCDir,Parallel(indPC));
end
dynareParallelSendFiles(['P_',fname,'_',int2str(j),'End.txt'],PRCDir,Parallel(indPC));
delete(['P_',fname,'_',int2str(j),'End.txt']);
dynareParallelSendFiles(['slaveJob',int2str(j),'.mat'],PRCDir,Parallel(indPC));
delete(['slaveJob',int2str(j),'.mat']);
if j==nCPU0+1,
dynareParallelSendFiles(NamFileInput,PRCDir,Parallel(indPC));
end
if newInstance,
dynareParallelSendFiles(['slaveParallel_input',int2str(j),'.mat'],PRCDir,Parallel(indPC))
if isunix || (~matlab_ver_less_than('7.4') && ismac),
@ -502,17 +502,17 @@ while (ForEver)
end
dynareParallelGetFiles([fname,'_output_*.mat'],PRCDir,Parallel(1:totSlaves));
% keyboard;
% Create return value.
iscrash = 0;
for j=1:totCPU,
indPC=min(find(nCPU>=j));
dynareParallelGetFiles([fname,'_output_',int2str(j),'.mat'],PRCDir,Parallel(indPC));
load([fname,'_output_',int2str(j),'.mat'],'fOutputVar');
delete([fname,'_output_',int2str(j),'.mat']);
if isfield(fOutputVar,'OutputFileName'),
indPC=min(find(nCPU>=j));
dynareParallelGetFiles([fOutputVar.OutputFileName],PRCDir,Parallel(indPC));
end
if isfield(fOutputVar,'error'),
@ -520,6 +520,9 @@ for j=1:totCPU,
iscrash=1;
% keyboard;
disp([fOutputVar.error.message]);
for jstack=1:length(fOutputVar.error.stack)
fOutputVar.error.stack(jstack),
end
else
fOutVar(j)=fOutputVar;
end
@ -574,3 +577,4 @@ end