Path: news.mathworks.com!not-for-mail
From: Edric M Ellis <eellis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: parfor error message
Date: Tue, 10 Nov 2009 14:17:33 +0000
Organization: The Mathworks, Ltd.
Lines: 32
Message-ID: <ytwy6mecvlu.fsf@uk-eellis-deb5-64.mathworks.co.uk>
References: <hd0qcm$168$1@fred.mathworks.com> <ytwaayzg4tl.fsf@uk-eellis-deb5-64.mathworks.co.uk> <hd95md$3ta$1@fred.mathworks.com> <ytwbpjbepxb.fsf@uk-eellis-deb5-64.mathworks.co.uk> <hdbohl$95q$1@fred.mathworks.com>
NNTP-Posting-Host: uk-eellis-deb5-64.mathworks.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: fred.mathworks.com 1257862653 27968 172.16.27.232 (10 Nov 2009 14:17:33 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 10 Nov 2009 14:17:33 +0000 (UTC)
X-Face: $Ahg}Iylezql"r1WV1Me5&)ng"a4v%D>==KMs-elCfj"o}$bh-VOt7lVXgLWsC?9mZ`mINT
 G6PDvca;nrgs$lfcr0l1ew'N]>nXKl}m|Zpg>,6*gLp~-N0N2*+b.iwv=u>@R$L4SEG&NYUU;lSR@u
 IHphdAy
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)
Cancel-Lock: sha1:nG5dLz0RG0UiGpKSBT3hFvaG2P4=
Xref: news.mathworks.com comp.soft-sys.matlab:583863


"Mr. CFD" <s2108860@student.rmit.edu.au> writes:

> b) The most common error which I have noticed and this most definitely indicates
> an issue within the code itself is:
>
> Error in ==> mysimulation>(parfor body factory) at 183 Undefined variable "out"
> or class "out.x".
>
> The line 183, in simple terms is defined as follows: parfor ii=1:n
> [a,b,c]=dosomething(myoutputs.x) ....  ....  end
>
> This error is the most frustrating! Can you please advise how this is fixed?
> Also this error appears at random, therefore I&#8217;m finding it hard to get a
> fix on this.

Is the "myoutputs" structure defined inside or outside the parfor loop? 

I'm struggling to see how the error refers to "out" when the code refers to
"myoutputs". I'm also somewhat confused as to how that error message could show
up only sometimes. I'm even more confused why an "undefined variable" message
could appear sporadically. The only variability that one might expect when
running a PARFOR loop is in the way the loop iterations are divided among the
workers. 

I wonder if perhaps the workers are running out of memory, and that's causing
weirdness. Is there any facility to track worker memory usage while you're
running this stuff? (Resource exhaustion just might also explain the hard
crashes as well as the strange errors that you're seeing).

Cheers,

Edric.