From 6612a7f0bc1e8d2da54cc63bc02530fc09b71de7 Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Fri, 15 Oct 2010 11:31:26 +0200 Subject: [PATCH 1/3] Trap introduced for windows was a bug for unix --- matlab/parallel/dynareParallelGetFiles.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab/parallel/dynareParallelGetFiles.m b/matlab/parallel/dynareParallelGetFiles.m index 15e574381..b1be44665 100644 --- a/matlab/parallel/dynareParallelGetFiles.m +++ b/matlab/parallel/dynareParallelGetFiles.m @@ -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), From c15508eae046ee4a8523b9307b759e79abf68f31 Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Fri, 15 Oct 2010 11:33:40 +0200 Subject: [PATCH 2/3] 1) better display of remote errors; 2) fixed bug in sync of sequence of files sent to remote slaves; --- matlab/parallel/masterParallel.m | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/matlab/parallel/masterParallel.m b/matlab/parallel/masterParallel.m index 6a85d6d93..fe43e5d23 100644 --- a/matlab/parallel/masterParallel.m +++ b/matlab/parallel/masterParallel.m @@ -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 + From de490e9e4afdb1bb32eda94d5ba8d7228ba3c098 Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Fri, 15 Oct 2010 11:36:26 +0200 Subject: [PATCH 3/3] delete remnants of previous Bayesian irf computations --- matlab/PosteriorIRF.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/matlab/PosteriorIRF.m b/matlab/PosteriorIRF.m index ddceaf4db..d84ae19ed 100644 --- a/matlab/PosteriorIRF.m +++ b/matlab/PosteriorIRF.m @@ -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));