parallel computing fitness function inside parallel optimization
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Third-Party Cluster Configuration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!