Error when using Dynare parallel computing toolbox

I have been trying to run some estimations using the Dynare parallel toolbox, with Dynare 4.2.4 and Matlab R2011a in a standard Windows environment. I believe I took all the necessary steps, as defined in related documents and instructions. In fact, the parallel toolbox runs smoothly, either with local or remote runs. The problem arises in very end of the estimation routine, when Dynare has to compile the results altogether. I get the following error message:

MH: Posterior (dsge) IRFs…
MH: Posterior IRFs, done!
??? Undefined function or variable “MAX_naK”.

Error in ==> prior_posterior_statistics at 230
nfiles = ceil(nBlockPerCPU(j)/MAX_naK);

Error in ==> dynare_estimation_1 at 903

Error in ==> dynare_estimation at 62

Error in ==> Model_name at 1088

Error in ==> dynare at 120
evalin(‘base’,fname) ;

The error is the same, regardless the type of computing - local, remote or combined, the number of cores used or any configuration option that can be called at Dynare’s invocation. Also, take notice the process of estimation is almost complete when the error occurs: I get ok! messages for all steps, including MH acceptance rates, MCMC diagnosis, computing of posterior means, covariances and log marginal density, IRF plots. What I do not get is the results.mat file and the smoothed and historical variables file set.

Can anyone help me on this?



This happens when the posterior filter or forecast is not triggered.
I can give you the fix (which will be also available in GIT):

trap lines 230-231 within an if statement, such that
(… snip …)
if naK
nfiles = ceil(nBlockPerCPU(j)/MAX_naK);
ifil(4,j+1) =ifil(4,j)+nfiles;

trap lines 235-238 within another if statement, such that
(… snip …)
if horizon
nfiles = ceil(nBlockPerCPU(j)/MAX_nforc1);
ifil(6,j+1) =ifil(6,j)+nfiles;
nfiles = ceil(nBlockPerCPU(j)/MAX_nforc2);
ifil(7,j+1) =ifil(7,j)+nfiles;

this should fix your problem.
thanks for reporting this