I am using parfor for parallel computing in Matlab. I am not familiar with this command. If that is possible, please look at my code below and tell me if I can write it with parfor. These errors and warnings are appear in Matlab Editor:
The parfor loop cannot be run due to the way variable 'Dat' is used.
The entire array or structure 'Bound' is broadcast variable. This might result in unnecessary communication overhead.
parfor pj = 1:size(normXpj,1) Dat.normXpj = normXpj(pj,:); if size(Dat.InitialGuess)==0 X = (Bound(:,1)+(Bound(:,2)-Bound(:,1)).*rand(Nvar,1))'; else X = Dat.InitialGuess; end [Xsqp, ~, FLAG,Options] = mopOPT(X,Dat); FEVALS = Options.funcCount; FES = FES+FEVALS; PSet(pj,:) = Xsqp; PFront(pj,:) = mop(Xsqp,Dat,0); %disp(['ExitFlag: ' num2str(FLAG)]);
if FLAG==-2 disp('.......... Algo paso...'); else F = PFront(pj,:); if Nobj==2 plot(F(1,1),F(1,2),'*r'); grid on; hold on; elseif Nobj==3 end end end
Best Answer