On 14-Oct-06, at 9:59 PM, Bradley Lucier wrote:
On Oct 4, 2006, at 12:07 PM, Marc Feeley wrote:
P.P.S. I wrote a genetic algorithm to figure out which combination of options gives the best results. Its pretty cool! Here's the code:
Marc:
Yes, this is cool. I'm wondering, can you write this as a distributed app that I can run on my 12 opteron cores over two systems? Most of the time nothing else is running (well, except for Folding@Home), so it would be cool to run something like this. Also, I see you used a population of 25 in the code you sent; when I was doing genetic programming (where you evolve programs) for image processing, I used a population of at least 2,000. So I'd like to try it with a larger population, too.
Brad
Here's the program. You have to run it in the "bench" subdirectory. If you want to parallelize it, you will have to change the procedure "evaluate-group" so that it performs a "parallel map":
(define (evaluate-group pop) (map evaluate-individual pop))
You also have to change the "evaluate" script (in the "bench" subdirectory) so that it doesn't clobber files that are generated by the concurrent invocations of the "evaluate" script. Finally, don't forget to modify the bin/gsc-cc-o script in the installation directory so that only a minimal set of GCC options are used (otherwise the options that the optimization program thinks it is using and the actual ones used by GCC will be different).
Marc