# Parfor dynare

**URL:** <https://forum.dynare.org/t/parfor-dynare/4865>\
**Category:** Dynare help (legacy posts)\
**Created:** [29 July 2015 16:18 UTC](https://forum.dynare.org/t/parfor-dynare/4865 "2015-07-29T16:18:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hakeru7](https://forum.dynare.org/letter_avatar_proxy/v4/letter/h/e19adc/32.png) [@hakeru7](https://forum.dynare.org/u/hakeru7)\
**Post date:** [29 July 2015 16:18 UTC](https://forum.dynare.org/t/parfor-dynare/4865/1 "2015-07-29T16:18:01Z")

</div>

Has anyone had much success running dynare in parallel via parfor?

Specifically wondering if anybody has solved around the global variables oo\_, M\_ issue. I’d like to avoid pre-processing a new dynare session for each thread.

Thanks!

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [30 July 2015 10:50 UTC](https://forum.dynare.org/t/parfor-dynare/4865/2 "2015-07-30T10:50:28Z")

</div>

Please provide an example of what you are trying to achieve.

---

<div class="post-metadata">

**Author:** ![hakeru7](https://forum.dynare.org/letter_avatar_proxy/v4/letter/h/e19adc/32.png) [@hakeru7](https://forum.dynare.org/u/hakeru7)\
**Post date:** [30 July 2015 13:52 UTC](https://forum.dynare.org/t/parfor-dynare/4865/3 "2015-07-30T13:52:42Z")

</div>

I’m simply looping over different parameterizations and collecting the moments on pretty standard NK model. I just need to loop over a large combination of parameters…I currently have the loop inside the mod file, but I’m guessing I need to loop the stoch\_simul file as a first step.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [30 July 2015 13:54 UTC](https://forum.dynare.org/t/parfor-dynare/4865/4 "2015-07-30T13:54:03Z")

</div>

Please provide the file for your current try.
