Add the SMP module

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2714 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
quemy 2012-08-17 11:52:14 +00:00
commit 0890c67d31
43 changed files with 4030 additions and 41 deletions

View file

@ -0,0 +1,40 @@
#include <cassert>
#include <vector>
#include <cstdlib>
#include <smp>
#include <eo>
#include "smpTestClass.h"
using namespace std;
using namespace paradiseo::smp;
int main(void)
{
srand(time(NULL));
loadInstances("t-data.dat", n, bkv, a, b);
// Evaluation function
IndiEvalFunc plainEval;
// Init a solution
IndiInit chromInit;
eoPop<Indi> pop(100, chromInit);
int nbWorkers = 4;
Scheduler<Indi> sched(nbWorkers);
sched(plainEval, pop);
std::cout << pop << std::endl;
// All indi would be evaluate once
for( unsigned i = 0; i < pop.size(); i++)
assert(pop[i].evalNb == 1);
return 0;
}