Merge remote branch 'ratto/master'
commit
4881b8c3f9
|
@ -84,6 +84,8 @@ elseif strcmpi(type,'gsa')
|
||||||
else
|
else
|
||||||
MhDirectoryName = CheckPath('prior');
|
MhDirectoryName = CheckPath('prior');
|
||||||
end
|
end
|
||||||
|
delete([MhDirectoryName filesep M_.fname '_IRF_DSGEs*.mat']);
|
||||||
|
delete([MhDirectoryName filesep M_.fname '_IRF_BVARDSGEs*.mat']);
|
||||||
if strcmpi(type,'posterior')
|
if strcmpi(type,'posterior')
|
||||||
load([ MhDirectoryName filesep M_.fname '_mh_history.mat'])
|
load([ MhDirectoryName filesep M_.fname '_mh_history.mat'])
|
||||||
TotalNumberOfMhDraws = sum(record.MhDraws(:,1));
|
TotalNumberOfMhDraws = sum(record.MhDraws(:,1));
|
||||||
|
|
|
@ -36,9 +36,9 @@ for indPC=1:length(Parallel),
|
||||||
if Parallel(indPC).Local==0,
|
if Parallel(indPC).Local==0,
|
||||||
if isunix || (~matlab_ver_less_than('7.4') && ismac),
|
if isunix || (~matlab_ver_less_than('7.4') && ismac),
|
||||||
for jfil=1:size(NamFileInput,1),
|
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}]);
|
system(['scp ',Parallel(indPC).user,'@',Parallel(indPC).PcName,':',Parallel(indPC).RemoteFolder,'/',PRCDir,'/',NamFileInput{jfil,1},NamFileInput{jfil,2},' ',NamFileInput{jfil,1}]);
|
||||||
end
|
% end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
for jfil=1:size(NamFileInput,1),
|
for jfil=1:size(NamFileInput,1),
|
||||||
|
|
|
@ -192,7 +192,7 @@ for j=1:totCPU,
|
||||||
|
|
||||||
|
|
||||||
% Creo un file che mi serve per sapere se la computazione di un
|
% 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+');
|
fid1=fopen(['P_',fname,'_',int2str(j),'End.txt'],'w+');
|
||||||
fclose(fid1);
|
fclose(fid1);
|
||||||
|
@ -230,7 +230,7 @@ for j=1:totCPU,
|
||||||
end
|
end
|
||||||
else
|
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
|
% sopra) e lo cancello in locale. Lo stesso vale per gli altri
|
||||||
% dati.
|
% dati.
|
||||||
save( ['slaveParallel_input',int2str(j)],'Parallel');
|
save( ['slaveParallel_input',int2str(j)],'Parallel');
|
||||||
|
@ -320,13 +320,13 @@ for j=1:totCPU,
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif Parallel(indPC).Local==0, % Run using network on remote machine or also on local machine.
|
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));
|
dynareParallelSendFiles(['P_',fname,'_',int2str(j),'End.txt'],PRCDir,Parallel(indPC));
|
||||||
delete(['P_',fname,'_',int2str(j),'End.txt']);
|
delete(['P_',fname,'_',int2str(j),'End.txt']);
|
||||||
dynareParallelSendFiles(['slaveJob',int2str(j),'.mat'],PRCDir,Parallel(indPC));
|
dynareParallelSendFiles(['slaveJob',int2str(j),'.mat'],PRCDir,Parallel(indPC));
|
||||||
delete(['slaveJob',int2str(j),'.mat']);
|
delete(['slaveJob',int2str(j),'.mat']);
|
||||||
if j==nCPU0+1,
|
|
||||||
dynareParallelSendFiles(NamFileInput,PRCDir,Parallel(indPC));
|
|
||||||
end
|
|
||||||
if newInstance,
|
if newInstance,
|
||||||
dynareParallelSendFiles(['slaveParallel_input',int2str(j),'.mat'],PRCDir,Parallel(indPC))
|
dynareParallelSendFiles(['slaveParallel_input',int2str(j),'.mat'],PRCDir,Parallel(indPC))
|
||||||
if isunix || (~matlab_ver_less_than('7.4') && ismac),
|
if isunix || (~matlab_ver_less_than('7.4') && ismac),
|
||||||
|
@ -502,17 +502,17 @@ while (ForEver)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
% keyboard;
|
||||||
dynareParallelGetFiles([fname,'_output_*.mat'],PRCDir,Parallel(1:totSlaves));
|
|
||||||
|
|
||||||
|
|
||||||
% Create return value.
|
% Create return value.
|
||||||
iscrash = 0;
|
iscrash = 0;
|
||||||
for j=1:totCPU,
|
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');
|
load([fname,'_output_',int2str(j),'.mat'],'fOutputVar');
|
||||||
delete([fname,'_output_',int2str(j),'.mat']);
|
delete([fname,'_output_',int2str(j),'.mat']);
|
||||||
if isfield(fOutputVar,'OutputFileName'),
|
if isfield(fOutputVar,'OutputFileName'),
|
||||||
indPC=min(find(nCPU>=j));
|
|
||||||
dynareParallelGetFiles([fOutputVar.OutputFileName],PRCDir,Parallel(indPC));
|
dynareParallelGetFiles([fOutputVar.OutputFileName],PRCDir,Parallel(indPC));
|
||||||
end
|
end
|
||||||
if isfield(fOutputVar,'error'),
|
if isfield(fOutputVar,'error'),
|
||||||
|
@ -520,6 +520,9 @@ for j=1:totCPU,
|
||||||
iscrash=1;
|
iscrash=1;
|
||||||
% keyboard;
|
% keyboard;
|
||||||
disp([fOutputVar.error.message]);
|
disp([fOutputVar.error.message]);
|
||||||
|
for jstack=1:length(fOutputVar.error.stack)
|
||||||
|
fOutputVar.error.stack(jstack),
|
||||||
|
end
|
||||||
else
|
else
|
||||||
fOutVar(j)=fOutputVar;
|
fOutVar(j)=fOutputVar;
|
||||||
end
|
end
|
||||||
|
@ -574,3 +577,4 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue