Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Parallel computing toolbox: help with parfor!
Date: Mon, 4 May 2009 23:15:08 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 35
Message-ID: <gtnsts$no9$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1241478908 24329 172.30.248.38 (4 May 2009 23:15:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 4 May 2009 23:15:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1828235
Xref: news.mathworks.com comp.soft-sys.matlab:537404


Hi everyone,
I have recently started using the parallel computing toolbox to take full advantage of my machine's 4 processors in my computations.

My problem involves running simulations for different frequencies (25 in total). The iterations are independent from each other but I need to call a fortran executable to calculate what I need. I use parfor to loop over the different frequencies passing them to a matlab function which:
1) writes the input file for the fortran routine containing the specific frequency
2) calls the fortran executable
3) uses the movefile command to change the name of the fortran output file, which is what I'm ultimately interested in.

Here is the code that I wrote for that:
matlabpool local 4
parfor j=1:25
     callbellhop(freq(j),zmax,zmax1,ndz,ndr,rmax,rotl);
 end
matlabpool close

function callbellhop(freq,zmax,zmax1,ndz,ndr,rmax,rotl)
write_envfl2(freq,zmax,zmax1,ndz,ndr,rmax,rotl); % writes the file AUTEC.env
! bellhop.exe < AUTEC.env 
movefile('SHDFIL',(['SHDFIL' num2str(freq)]))

When I first attempted to run it, it seemed everything was working fine. All the processors were being used, and the output files were being created for each frequency. However, when the iteration reached j" I got an error:

??? Error using ==> parallel_function at 594
Error in ==> callbellhop at 4
mv: cannot stat `/home/.../Trans1/SHDFIL': No such file or directory


Error in ==> bw_248bdive2_input at 99
    parfor j=1:25

I repeated it more than once and I get the same problem. Does anyone have any clues why it would stop before it finished? Am I overseeing any issues regarding calling the fortran executable and renaming it's output inside a parfor loop?
Thank you in advance for any input you could give me!

Cheers,
Elizabeth