On 18/02/2010, Muthiah Annamalai <[email protected]> wrote: > On Thu, Feb 18, 2010 at 4:29 AM, Muthiah Annamalai <[email protected]> > wrote: [...] >> On 08/02/2010, Luca Favatella <[email protected]> wrote: [...] >> | (Sorry for the delay.) >> | >> | Now modifying one line in __ga_scores__.m it is possible to integrate >> | parallel evaluation (I marked that line with TODO). >> | You can commit you changes yourself, or please provide me a patch.
As you noted, I didn't review/commit your code. Sorry, lack of time. Please accept a few comments on the code below. Feel free to re-send an updated version of the patch if possible. Cheers, Luca Favatella [...] >> I found it necessary to add option Ncore to the GA optimset default >> functions, >> as default_options.Ncores = 1; . Please rename "Ncores" to "octaveNcores" to remark that this is an octave(forge)-specific option. >> The patch uses essentially the same mechanism of separate processess, >> ( despite the excellent suggestions to use MPI and parcellfun() ) as I >> found >> them to have some advantages which only MPI could give for large data >> sets. >> Jaroslav & Riccardo Corradini for your suggestions. Please choose a function you write (the function you think fits better) and add a couple of paragraphs of doc about: * description of your approach * other proposed approaches and a brief comparison among them (in short: why your approach is better) and add a couple of references to this mail thread where appropriate. [...] >> I hope they are acceptable changes. >> Let me know what you think. [...] > ##----------------------File __ga_multicore_helper__.m [...] > ## usage: octave -q __ga_multicore_helper__.m fitnessfcn matfile > ## and save the result in proc-$matfile in the variable fitnessval. > ## load(procfile); ## has variable fitnessval. Doc even for internal scripts is good: thanks! If possible, please convert its format to texinfo (as other function files). It looks to me that this script is not a function, but a raw script: please clearly mark this in doc and please motivate why. [...] > __ga_multicore_scores__.m------------------------- > ## Copyright (C) 2010 Muthiah Annamalai <[email protected]> > ## Copyright (C) 2008 Luca Favatella <[email protected]> [...] > ## Author: Luca Favatella <[email protected]> > ## Version: 5.3.1 Why am I the author of this new file? Why have I copyright on it? Why is this new file starting from a so high version number? > ## > ## Modified for use with Multicore CPU to utilize data-parallel > ## nature of GA fitness functions, which we cannot do with limited > ## License software. Go Octave! Modified from what? Perhaps this paragraph should be rewritten/removed. [...] > --- __ga_scores__.m (revision 6922) > +++ __ga_scores__.m (working copy) > @@ -22,7 +22,16 @@ > warning ("'Vectorized' option is 'on': ignoring 'UseParallel' \ > option, even if it is 'always'"); > endif > - Scores = problem.fitnessfcn (Population); > + ## use multicore score evaluator > + ## fitnessfcn has to be a string or m-file name converted from a > handle. > + ## accessible from another process that does not share memory-space. > + if ( strcmp(class(problem.fitnessfcn),"function_handle") ) > + fitness_fcn_name = func2str( problem.fitnessfcn ); > + else > + fitness_fcn_name = problem.fitnessfcn; > + end > + Scores = > __ga_multicore_score__(fitness_fcn_name,population,problem.options.ncores); > + return > else ## not using vectorized evaluation > if (! strcmp (problem.options.Vectorized, "off")) > error ("'Vectorized' option must be 'on' or 'off'"); Your changes are at a wrong line. Please move them at lines 31-32 of http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/ga/inst/__ga_scores__.m?revision=6905&view=markup Please remove "return" in the meanwhile. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Octave-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/octave-dev
