PCT and GA optimizer

조회 수: 8 (최근 30일)
Nima PEDRAMASL
Nima PEDRAMASL 2014년 1월 18일
편집: Matt J 2014년 1월 19일
Hi, I try to use parallel computing toolbox to decrease genetic algorithm optimizer run time. all of workers will call an external solver using one premade input file.(call MSC Nastran bdf is made in MATLAB). the thing is each time external solver is called some files are created.to avoid conflict between workers three options came to my mind. 1) use of resource lock to avoid conflict but this will bring problems since other workers solver dont wait and will fail. 2) tell PCT to create directory for each worker and copy necessary files into each directory. 3) in objective function get process id of each worker and put an extension in input file made by objective function for external solver therefore each workers will have different output and input file name.
the last option looks like the easiest one. what do you guys think ? and btw I dont know method 2 and 3. need some help :) thanks in advance

채택된 답변

Matt J
Matt J 2014년 1월 19일
편집: Matt J 2014년 1월 19일
If you use the Vectorize option, you can have GA pass the entire population to your objective function in each iteration. Within your objective function, you can then implement your own parallel splitting of the computation using Parallel Computing Toolbox functions.
For example, you can evaluate different population chunks in parallel in an SPMD...END block and use the labindex() command to create a worker-dependent name for your files,
spmd
...
filename=[filename numstr(labindex)];
end
  댓글 수: 1
Nima PEDRAMASL
Nima PEDRAMASL 2014년 1월 19일
yep that's what I need. Thanks Matt, much appreciated.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by