Effacer les filtres
Effacer les filtres

PCT and GA optimizer

8 vues (au cours des 30 derniers jours)
Nima PEDRAMASL
Nima PEDRAMASL le 18 Jan 2014
Modifié(e) : Matt J le 19 Jan 2014
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

Réponse acceptée

Matt J
Matt J le 19 Jan 2014
Modifié(e) : Matt J le 19 Jan 2014
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 commentaire
Nima PEDRAMASL
Nima PEDRAMASL le 19 Jan 2014
yep that's what I need. Thanks Matt, much appreciated.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by