diff --git a/matlab/parallel/masterParallel.m b/matlab/parallel/masterParallel.m index 573adb2de..402559769 100644 --- a/matlab/parallel/masterParallel.m +++ b/matlab/parallel/masterParallel.m @@ -92,9 +92,7 @@ if nargin>8 && initialize==1 evalin('base','clear PRCDirTmp,') else % Delete the traces (if existing) of last local session of computations. - if Strategy==1, - mydelete(['slaveParallel_input*.mat']); - end + mydelete(['slaveParallel_input*.mat']); end return end @@ -128,12 +126,8 @@ end % Save input data for use by the slaves. switch Strategy case 0 - if exist('fGlobalVar'), - save([fname,'_input.mat'],'fInputVar','fGlobalVar') - else - save([fname,'_input.mat'],'fInputVar') - end - save([fname,'_input.mat'],'Parallel','-append') + storeGlobalVars([fname,'_input.mat']); + save([fname,'_input.mat'],'fInputVar','Parallel','-append') case 1 if exist('fGlobalVar'), @@ -270,7 +264,7 @@ for j=1:totCPU, % are created localy, then copied in remote directory and then % deleted (loacal)! - save( ['slaveParallel_input',int2str(j),'.mat'],'Parallel'); + save( ['slaveParallel_input',int2str(j),'.mat'],'j'); if Parallel(indPC).Local==0, dynareParallelSendFiles(['P_',fname,'_',int2str(j),'End.txt'],PRCDir,Parallel(indPC)); diff --git a/tests/parallel/ls2003.mod b/tests/parallel/ls2003.mod index c0ed24dfb..20f4d6856 100644 --- a/tests/parallel/ls2003.mod +++ b/tests/parallel/ls2003.mod @@ -62,8 +62,8 @@ stderr e_pies,inv_gamma_pdf,1.88,0.9827; end; -estimation(datafile=data_ca1,first_obs=8,nobs=79,mh_replic=0); -estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0, mode_file=ls2003_mode, mh_nblocks=4, prefilter=1, mh_jscale=0.5, mh_replic=2000); -estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0, mode_file=ls2003_mode, mh_nblocks=4,prefilter=1,mh_jscale=0.5,mh_replic=2000,bayesian_irf,load_mh_file,smoother,forecast=12, filtered_vars, filter_step_ahead=[1 2 3 4]) y y_s R pie dq pie_s de A y_obs pie_obs R_obs; +estimation(datafile=data_ca1,first_obs=8,nobs=79,mh_replic=0,nodisplay); +estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0,nodisplay, mode_file=ls2003_mode, mh_nblocks=4, prefilter=1, mh_jscale=0.5, mh_replic=2000); +estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0,nodisplay, mode_file=ls2003_mode, mh_nblocks=4,prefilter=1,mh_jscale=0.5,mh_replic=2000,bayesian_irf,load_mh_file,smoother,forecast=12, filtered_vars, filter_step_ahead=[1 2 3 4]) y y_s R pie dq pie_s de A y_obs pie_obs R_obs;