parallel call external exe file?

4 visualizaciones (últimos 30 días)
Eli
Eli el 20 de Ag. de 2014
Respondida: Raymond Norris el 20 de Ag. de 2014
I have a for loop that runs well that I would like to convert to the a parfor (or alternative mode of parallelizing the code). The loop creates and saves a text data file and calls an exe file then reads results back into Matlab. The for loop that works is
for jloops=1:loops
estpars=startVals(:,jloops); %reads in updating parameters
ADMBmakeData; %reads in static parameters and writes data file
eval('!faustCC.exe'); %runs external code
ADMBgetResult; %reads in external results
resultVals(:,jloops)=xIn; %puts external results in a matrix
resultFvals(jloops)=meritB(xIn); %creates a secondary result based on external results
end
I understand there is a problem with transparency and the eval call. I have tried putting it in a function. I have tried batch. Both were recommended elsewhere, but neither worked.
Is there a straight forward way to run this in parallel? Simply replacing for with parfor does not work.
Thanks, EF

Respuestas (1)

Raymond Norris
Raymond Norris el 20 de Ag. de 2014
Have you tried calling system? By the way, as it's written, you don't need eval, you ought to be able to just use !

Categorías

Más información sobre Parallel for-Loops (parfor) en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by