Path: news.mathworks.com!not-for-mail
From: "Steffen" <rileksn@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Distributed Computing
Date: Mon, 16 Mar 2009 10:11:12 +0000 (UTC)
Organization: Heinz-Mueller-Institut
Lines: 19
Message-ID: <gpl8k0$p9q$1@fred.mathworks.com>
References: <gpjdp5$5cd$1@fred.mathworks.com> <op.uquqqkcpa5ziv5@uthamaa.dhcp.mathworks.com>
Reply-To: "Steffen" <rileksn@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1237198272 25914 172.30.248.35 (16 Mar 2009 10:11:12 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 16 Mar 2009 10:11:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1370453
Xref: news.mathworks.com comp.soft-sys.matlab:525153


Thanks for all the input so far!

Since I want to distribute the task to multiple other machines I need MDCS as well as the Parallel Toolbox.

Admitting that I have not totally understood the use of ind2sub, it seems that I can squeeze the 2 for loops into 1 and thereby use a single parfor, right?

parfor ind=1:300*300
        [i,j]=ind2sub([300 300],ind);
         spectrum=series(i,j,:); 
         peaks=func_fit_spectrum(spectrum); 
         handles=func_peak_conversion(peaks);
end

Is my understanding correct that parfor sends now for each 'ind' the spectrum plus the two funtions to one worker (eg. ind=1, worker1, ind=2 worker2, etc.)? This somehow seems wrong to me, since this would once again be serial computing, right?
Currently, the structuring element 'handle' within the func_peak_conversion is growing for each run (peaks can be overwritten, as it is just the input for the 2nd fcn). I presume/hope the growing of the handle would still work when each worker adds a value separately?

Thanks for the help!!

Steffen