parallel computing fitness function inside parallel optimization
显示 更早的评论
I have a calculation intensive fitness function to optimize in genetic optimization.
I plan to use matlab parallel server with 10 compute nodes, each on has 24core. Can I run each objFunction parallel in GA and parallel in each nodes?
Following is example code and target
- 40 poulation,
- UseParallel On in GA options
- Can assign each objFuntion evaluation to indivadual 24core compute and use another parfor inside objFunction?
- Therefore, it allowed me run 10 parallel objFunction on 10 node. Each objfunction run parallel in each node.
Thanks
% parallel on and 40 population
options = optimoptions('UseParallel',true,'PopulationSize',40);
[x,fval,exitflag,output] = gamultiobj(@objFunction,20,[],[],[],[],lb,ub,options);
%% fitness function required to run parallel
function output = objFunction(x)
a = 1:10000;
output = zeros(1,numel(a));
parfor i = 1:numel(a)
output(i) = a(i) + mean(x);
end
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Third-Party Cluster Configuration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!