Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!postnews.google.com!s20g2000yqh.googlegroups.com!not-for-mail
From: "russell.fung@gmail.com" <russell.fung@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Distributed Computing
Date: Sun, 15 Mar 2009 10:51:58 -0700 (PDT)
Organization: http://groups.google.com
Lines: 50
Message-ID: <53e8f7a0-8878-491d-b58f-04960d1fdc92@s20g2000yqh.googlegroups.com>
References: <gpjdp5$5cd$1@fred.mathworks.com>
NNTP-Posting-Host: 173.89.0.171
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1237139518 32545 127.0.0.1 (15 Mar 2009 17:51:58 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 15 Mar 2009 17:51:58 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: s20g2000yqh.googlegroups.com; posting-host=173.89.0.171; 
	posting-account=40KBCAoAAACMcpWjfyXfeKnqSR9nlxRk
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; 
	rv:1.9.0.7) Gecko/2009021906 Firefox/3.0.7,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:525040


On Mar 15, 12:27=A0pm, "Steffen" <rile...@gmail.com> wrote:
> Hello,
>
> I am kind of confused by the stuff I read the last days about the Distrib=
uted/Parallel Computing Toolbox, perhaps someone can give me some general a=
dvices.
>
> Very briefly my problem. I have a 300x300 movie and each pixel contains i=
n its third dimension a spectrum which I need to fit. Basically I run for a=
ll 90000 pixels two functions, a fitting routine and some math to convert t=
he fitted peaks. Since this takes me about 2 days, I thought of distributin=
g the fitting/conversion routine to other computers (4 to 8 PCs).
>
> for i=3D1:300
> =A0 =A0 for j=3D1:300
> =A0 =A0 =A0 =A0 spectrum=3Dseries(i,j,:);
> =A0 =A0 =A0 =A0 peaks=3Dfunc_fit_spectrum(spectrum);
> =A0 =A0 =A0 =A0 handles=3Dfunc_peak_conversion(peaks);
> =A0 =A0 end
> end
>
> 1) Would that task be solveable via distributed computing or am I missing=
 some major pitfalls here?
> 2) Am I right that the other computers require Matlab and the distributed=
 toolbox to be installed? How about the functions that are called, just cop=
ying them to the workers or is the toolbox automatically taking care of tha=
t?
> 3) The example given in the help somehow suggests just to replace the for=
 loops by parfor loops. Does that hold true for this particular case with t=
wo for loops? Or do I have to cut the main image into small pieces myself a=
nd then send it to the workers?
>
> Many thanks in advance for any advice, much appreciated!
>
> Steffen

1) It seems that you have 300*300=3D90000 independent sets of analysis
to perform, I would say distributed computing will speed up the
solution to your problem greatly.
2) Let's say you have a cluster of M computers and you would like to
access this cluster from N clients (meaning M computers that actually
do the work, and N computers that can send jobs), then I think you
need M worker licenses and N parallel computing toolbox licenses.
3) My understanding is that you can't have nested parfor loops unless
the second level of parfor is in a function. So you can have one level
of parfor loop that calls a function, and within the function you can
have a second level of parfor loop. You need the parallel computing
toolbox to use parfor.

Russell