Crash in unstable mex when called from parallel workers
I'm afraid I don't have time to produce a minimal example of this bug now, but I'll leave the replication steps here in case anyone else does.
- Download my version of Dynare, with sub-modules from https://github.com/tholden/dynare
- Replace the files in the mex subfolder with those from the latest unstable.
- Browse to the dynare\examples\nonlinear-estimation directory within MATLAB, and then execute
- Note that Dynare correctly calculates the initial likelihood, but then when it starts calculating the first numerical derivative of the likelihood, in parallel, each of the parallel workers crash in turn.
- Reset the repository so you have my compiled MEX. Rerun the same test and observe that the parallel workers do not crash.
I would strongly expect that in fact you don't need to use my version of Dynare, or to use my code for estimating an approximation around the mean, and in the latest unstable this ought to be present whenever you evaluate the likelihood in parallel.