Parallel version of 4.0.2 for 4-8 cores

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Parallel version of 4.0.2 for 4-8 cores

Postby JamieHall » Fri Mar 13, 2009 6:25 am

Hi everyone,

Here is the fork of Dynare 4.0.2 that I've been using for a parallelised version of Dynare 4.0.2 running on an 8-core Xeon machine. I don't have any hard figures but it seems to deliver a speedup of roughly 6ish for Bayesian estimation.

You install this by dumping these files in your dynare\4.0.2\matlab folder. (You may want to make sure that you've got the original Dynare files saved somewhere safe first...)

The code uses Matlab's Parallel Computing Toolbox; for running two chains at once, it uses the Multicore package by Markus Buehren. You'll need to install that yourself.

Here's what's new in the attached zip file:
  1. The numerical gradient and hessian routines are parallelised in a pretty obvious way.
  2. The newrat optimiser (mode_compute=5) now uses four different Hessian updates each time, and picks the best one. That's an idea suggested by Phua et al.
  3. For the MCMC part, I implemented Ingvar Strid's prefetching mechanism. I've hard-coded an optimal prefetching routine on the assumption that there are 4 cores per MCMC chain, and that the acceptation ratio is less than 0.6ish. That means that each chain runs about 2.25 -- 2.5 times faster than normal.
  4. The rest of the changes involve ugly workarounds for Matlab's reluctance to use global variables in a parallel context.

Just thought I'd post it in case anyone else was interested in this sort of thing. Comments / questions / suggestions would be very welcome.


All the best,
Jamie
Attachments
parallel_dynare_4_0_2.zip
(37 KiB) Downloaded 298 times
JamieHall
 
Posts: 20
Joined: Wed Feb 11, 2009 4:42 am

Re: Parallel version of 4.0.2 for 4-8 cores

Postby pkaradi » Fri Nov 13, 2009 10:42 am

Dear JamieHall,

It sounds really interesting what you are doing. Unfortunately, I could not have made it run on a R2009a Matlab with the example code of Frank Schorfheide's model made by Michel Juillard found on dynare's webpage. The code has met the global options_ variable in dynare_solve.m and crashed. Could you please post a code that runs parallel with your code? I might find it really useful for learning about your code.

Thank you: Peter
pkaradi
 
Posts: 6
Joined: Mon Oct 06, 2008 7:42 pm


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 5 guests