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