Potential bug in RWMH of Dynare 4.6.2 when using parallel computing

Good morning,
I think I might have noticed a potential bug in the execution of the RWMH by Dynare 4.6.2. when using the parallel option. Specifically, in the attached testdynare.mod file, executed by executing parrallelcommand.m, with dynare 4.6.2., the the acceptance ratio for all three chains is 0 (and the RWMH is completed very quickly). Looking at the sequence of draws, for a given chain (say testdynare_mh1_blck1.mat) and a given parameter, all 2000 draws are identical, though they differ across chains.
This result does not occur if I don’t use the parallel computing option, that means if I directly execute dynare testdynare.mod. Furthermore, with dynare 4.5.7, the problem with using parallel computing does not appear either.

The attached folder contains the results obtained for Dynare 4.6.2. and the parallel option (executed via parrallelcommand.m), so you can check for yourself the chains testdynare_mh1_blck1.mat to testdynare_mh1_blck3.mat. Furthermore, it contains the log file produced if I use dynare 4.6.2 without the parrallel option (testdynare_para462.log ), and the log produced if I use dynare 4.5.7 (with the parallel option), testdynare_para457.log I have also included the config1.ini file.

Your help would be highly appreciated :-).
Ansgar

testrwmh.zip (1.8 MB)

From what I can see, the reason is that your Dynare 4.6.2 run still used 4.5.7 for the clients:

C:\Rannenberg\SAPI_own_20201019b\testrwmh>psexec -accepteula -d -W "C:\Rannenberg\SAPI_own_20201019b\testrwmh" -a 2,3 -low  matlab -nosplash -nodesktop -minimize  -r "addpath('C:\4.5.7\matlab'), dynareroot = dynare_config(); slaveParallel(2,1)"  

because the config1.ini contains the wrong DynarePath. Leaving all as is, I can replicate the issue. When I change the path to Dynare 4.6.2 on the “slaves”, it works as expected on my machine.

1 Like

Thanks a lot Johannes, it works on mine as well now. And apologies, I totally forgot that the .ini file had to be updated as well of course…
Have a nice weekend,
Ansgar