diff --git a/matlab/PosteriorIRF.m b/matlab/PosteriorIRF.m index 691bac6df..9796f112a 100644 --- a/matlab/PosteriorIRF.m +++ b/matlab/PosteriorIRF.m @@ -439,11 +439,18 @@ if ~exist('OCTAVE_VERSION') if isnumeric(options_.parallel) || (M_.exo_nbr*ceil(size(varlist,1)/MaxNumberOfPlotPerFigure))<8, [fout] = PosteriorIRF_core2(localVars,1,M_.exo_nbr,0); else - globalVars = struct('M_',M_, ... - 'options_', options_); - - [fout] = masterParallel(options_.parallel, 1, M_.exo_nbr,NamFileInput,'PosteriorIRF_core2', localVars, globalVars, options_.parallel_info); - + isRemoteOctave = 0; + for indPC=1:length(options_.parallel), + isRemoteOctave = isRemoteOctave + (findstr(options_.parallel(indPC).MatlabOctavePath, 'octave')); + end + if isRemoteOctave + [fout] = PosteriorIRF_core2(localVars,1,M_.exo_nbr,0); + else + globalVars = struct('M_',M_, ... + 'options_', options_); + + [fout] = masterParallel(options_.parallel, 1, M_.exo_nbr,NamFileInput,'PosteriorIRF_core2', localVars, globalVars, options_.parallel_info); + end end end % END parallel code! diff --git a/matlab/pm3.m b/matlab/pm3.m index 9bf6c8c80..0d023a5cf 100644 --- a/matlab/pm3.m +++ b/matlab/pm3.m @@ -149,17 +149,25 @@ localVars.Mean=Mean; if ~exist('OCTAVE_VERSION') -% Commenting for testing! -if isnumeric(options_.parallel) || ceil(size(varlist,1)/MaxNumberOfPlotsPerFigure)<4, - fout = pm3_core(localVars,1,nvar,0); - - % Parallel execution! - else - globalVars = struct('M_',M_, ... - 'options_', options_, ... - 'oo_', oo_); - [fout, nBlockPerCPU, totCPU] = masterParallel(options_.parallel, 1, nvar, [],'pm3_core', localVars,globalVars, options_.parallel_info); - end + % Commenting for testing! + if isnumeric(options_.parallel) || ceil(size(varlist,1)/MaxNumberOfPlotsPerFigure)<4, + fout = pm3_core(localVars,1,nvar,0); + + % Parallel execution! + else + isRemoteOctave = 0; + for indPC=1:length(options_.parallel), + isRemoteOctave = isRemoteOctave + (findstr(options_.parallel(indPC).MatlabOctavePath, 'octave')); + end + if isRemoteOctave + fout = pm3_core(localVars,1,nvar,0); + else + globalVars = struct('M_',M_, ... + 'options_', options_, ... + 'oo_', oo_); + [fout, nBlockPerCPU, totCPU] = masterParallel(options_.parallel, 1, nvar, [],'pm3_core', localVars,globalVars, options_.parallel_info); + end + end else % For the time being in Octave enviroment the pm3.m is executed only in % serial modality, to avoid problem with the plots.