Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



a problem with the parfor loop
Posted:
Sep 29, 2013 1:46 PM


Hi everyone
I have been looking for making my code faster for a while, since it needs houres for running only one configuration, I need tens of runs. It contains millions of call for some functions.
As a solution, I found that using the parfor stucture might bring some improvement since I have a multicore processor. The problmem however is that it does always give the same error:
"The variable pop in a parfor cannot be classified"
So, I would be very grateful if I get any insights.
Here is the portion of code containing the issue:
********** parfor i=1:np xi=pop(i,:); j=randi(np); while j==i j=randi(np); end k=randi(np); while k==i  k==j k=randi(np); end l=randi(np); while l==i  l==j  l==k l=randi(np); end
xj=pop(j,:); xk=pop(k,:); xl=pop(l,:); vi=mutate(xj,xk,xl,f); ui=binCross(xi,vi,cr); ui=simplebounds(ui,Lb,Ub); fu=cec13_func(ui',func); if fu<fits(i) pop(i,:)=ui; fits(i)=fu; end end **********



