parfor with Dynare

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.

parfor with Dynare

Postby Dr. En Ami » Thu Sep 12, 2013 9:27 am

Is dynare compatible with parfor? That is, can one call dynare within a parfor loop?
Dr. En Ami
 
Posts: 18
Joined: Sat Jul 06, 2013 11:19 pm

Re: parfor with Dynare

Postby jpfeifer » Sat Sep 14, 2013 8:02 am

Dynare itself features parallelization capabilities. But we have never tried to parallelize around Dynare. My hunch would be that it does not work due to the complexity of the underlying codes. But you might try. Any feedback on your experiences is highly appreciated.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: parfor with Dynare

Postby Dr. En Ami » Thu Sep 19, 2013 11:12 pm

I was able to do it. Within parfor, call a function of the iteration index that (i) cds into a distinct, index dependent directory and (ii) runs dynare. That way, dynare is run in the workspace of a function call and files are not rewritten.
Dr. En Ami
 
Posts: 18
Joined: Sat Jul 06, 2013 11:19 pm

Re: parfor with Dynare

Postby adamg » Thu Aug 28, 2014 4:15 pm

Has anyone else been able to do this? The problem I am running into is that parfor does not work well with globals, and dynare uses globals. Alternatively, is there a way to run dynare without globals (M_, oo_) so that I can then figure out how to parallelize it?

Adam
adamg
 
Posts: 6
Joined: Sat May 04, 2013 6:00 pm

Re: parfor with Dynare

Postby jpfeifer » Fri Aug 29, 2014 9:23 am

Either you follow what Dr. En Ami suggested in doing separate calls to Dynare, which then separates the global variables by using different instances of Dynare.

The second alternative is using Dynare subfunctions directly. Many of them use local instances of the global variables.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests