eval - Parallel computing using Matlab -
i executing windows '.exe' file in 'cmd' prompt various inputs through matlab. commands follows.
= 1:n filename = sprintf('input_%d.dat',i); string = sprintf('!sfbox.exe %s', filename); eval(string) end
all input files present , independent of each other. if attempt parallelize execution using 'parfor' follows,
parfor = 1:n filename = sprintf('input_%d.dat',i); string = sprintf('!sfbox.exe %s', filename); eval(string) end
i error, code runs serially without stopping
explanation matlab runs parfor loops on multiple matlab workers have multiple workspaces. indicated function might not access correct workspace; therefore, usage invalid.
is there correct way execute eval using parfor?
(ps: tried manually executing several .exe files in cmd prompt , feasible run several .exe files @ same time in command prompt. problem way attempt in matlab. please suggest better methods.)
you hitting issues matlab not knowing eval doing. while know it's doing right thing, eval command executing anything. there little documentation on transparency issues using eval statements in parfor , spmd statements.
switching use feval statement should solve problem, matlab know thing going statement string. more directly, can use system
command directly execute arbitrary string in cmd prompt matlab.
parfor = 1:n filename = sprintf('input_%d.dat',i); string = sprintf('sfbox.exe %s', filename); system(string); end
Comments
Post a Comment