Hi Johannes.
All global and local variables are wrapped and sent to workers by masterParallel.m.
then only the variables that are needed co complete random_walk_metropolis_hastings.m are updated after parallel execution.
best
m
-- 
Marco Ratto,
Financial and Economic Analysis
Joint Research Centre
The European Commission,
TP 361, 21027  ISPRA(VA), ITALY
Tel: +39 0332 78 3794 Fax: +39 0332 78 5752,
marco.ratto@jrc.ec.europa.eu
http://www.macfinrobods.eu/
On 4/27/2015 4:29 PM, Johannes Pfeifer wrote:
That makes sense, but I can not see this anywhere from the code. In the parallel branch of random_walk_metropolis_hastings.m , we have

globalVars = struct();

But nothing else is passed. In masterParallel.m we seem to call different independent Matlab sessions that do not communicate. But I have no clue where they get a value for objective_function_penalty_base from.



Am 27.04.2015 um 16:19 schrieb Stéphane Adjemian:
Hi Johannes,

My understanding is that each node keeps its own instance of the globals (we run different matlab sessions that do not communicate). Also, if I remember correctly, the global variable storing the penalty, is not updated in the metropolis (it should always be equal to Inf). This variable is used for the optimization (csminwel) algorithm which is not parallelized.

Best,
Stéphane.

--
Stéphane Adjemian
Université du Maine, Gains & Dynare Team

Le 27 avr. 2015 à 15:55, Johannes Pfeifer <pfeifer@uni-mannheim.de> a écrit :

Hi,
does anyone know how parallel execution works with global variables? In random_walk_metropolis_hastings.m we define at the beginning

global objective_function_penalty_base
objective_function_penalty_base = Inf;

How is this variablem treated in parallel execution. In particular, what happens if one of the instances/nodes changes this value for objective_function_penalty_base? Does this affect all other nodes? Or does each node keep its own instance of the global variable?

I would be grateful for any insights.

Best,

Johannes


--
------
Johannes Pfeifer
Department of Economics
University of Mannheim
L7, 3-5, Room 242
68131 Mannheim
Germany
+49 (0)621 181-3430

_______________________________________________
Dev mailing list
Dev@dynare.org
https://www.dynare.org/cgi-bin/mailman/listinfo/dev


_______________________________________________
Dev mailing list
Dev@dynare.org
https://www.dynare.org/cgi-bin/mailman/listinfo/dev



_______________________________________________
Dev mailing list
Dev@dynare.org
https://www.dynare.org/cgi-bin/mailman/listinfo/dev