eoPopEvalFunc updated for parallel evaluation.
This commit is contained in:
parent
de2df9de81
commit
fc68c3b81e
3 changed files with 41 additions and 21 deletions
|
|
@ -3,12 +3,19 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <eo>
|
||||
#include <eoPopEvalFunc.h>
|
||||
|
||||
#include <es/make_real.h>
|
||||
//#include <apply.h>
|
||||
#include "real_value.h"
|
||||
// #include <apply.h>
|
||||
#include "../real_value.h"
|
||||
|
||||
#include <mpi/eoMpi.h>
|
||||
|
||||
#include <boost/mpi.hpp>
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class eoRealSerializable : public eoReal< eoMinimizingFitness >, public eoserial::Persistent
|
||||
|
|
@ -75,7 +82,7 @@ typedef eoRealSerializable EOT;
|
|||
|
||||
int main(int ac, char** av)
|
||||
{
|
||||
MpiSingletonFactory::init( ac, av );
|
||||
eo::mpi::Node::init( ac, av );
|
||||
|
||||
eoParser parser(ac, av);
|
||||
|
||||
|
|
@ -100,7 +107,10 @@ int main(int ac, char** av)
|
|||
|
||||
eo::log << "Size of population : " << popSize << std::endl;
|
||||
|
||||
eoPopLoopEval< EOT > popEval( eval );
|
||||
eo::log << eo::setlevel( eo::debug );
|
||||
|
||||
eo::mpi::DynamicAssignmentAlgorithm assign;
|
||||
eoParallelPopLoopEval< EOT > popEval( eval, assign, 0, 3 );
|
||||
popEval( pop, pop );
|
||||
|
||||
eo::log << eo::quiet << "DONE!" << std::endl;
|
||||
Reference in a new issue