Path: news.mathworks.com!not-for-mail
From: Edric M Ellis <eellis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: parfor: fopen Issues
Date: Wed, 24 Jun 2009 16:14:29 +0100
Organization: The Mathworks, Ltd.
Lines: 22
Message-ID: <ytwws71mzoq.fsf@uk-eellis-deb4-64.mathworks.co.uk>
References: <h1t155$jbg$1@fred.mathworks.com> <ytw1vp9omj1.fsf@uk-eellis-deb4-64.mathworks.co.uk> <h1teke$q6c$1@fred.mathworks.com>
NNTP-Posting-Host: uk-eellis-deb4-64.mathworks.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: fred.mathworks.com 1245856470 403 172.16.27.112 (24 Jun 2009 15:14:30 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 24 Jun 2009 15:14:30 +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.1 (gnu/linux)
Cancel-Lock: sha1:Nc8S79fHEw54O1Bgn/Xawr9au28=
Xref: news.mathworks.com comp.soft-sys.matlab:550304


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

> In the meantime, I did not know that a file could be operated on by two
> processes simulatenosuly. Just to avoid this scenario, seperate script files
> were created and named in accordance to the index of the parfor command; so
> that these files were analysed seperately by the proccesses depending on the
> distribution of 'n' in [parfor ii = 1:n]

Your original code looked to me as though it should work, and basing the
filename on the parfor loop variable is a good approach - so I was trying to
suggest how you might find out why you can't write to the file.

> Assuming this is the reason why we have the error (have not tried your
> suggestions as yet), how do you propose to solve this please?

You could use "tempname" to generate a unique filename for each iteration; but
it would probably be good to debug why you are getting the clashes with your
current approach.

Cheers,

Edric.