Commit ba3a06b0 authored by Joseph Pallamidessi's avatar Joseph Pallamidessi

Fix an important bug where using the remote island model with CUDA produced segfaults

parent 6afc42bb
......@@ -676,7 +676,11 @@ void EvolutionaryAlgorithmImpl::initializeParentPopulation(){
EvolutionaryAlgorithmImpl::EvolutionaryAlgorithmImpl(Parameters* params) : CEvolutionaryAlgorithm(params){
// warning cstats parameter is null
this->population = (CPopulation*)new PopulationImpl(this->params->parentPopulationSize,this->params->offspringPopulationSize, this->params->pCrossover,this->params->pMutation,this->params->pMutationPerGene,this->params->randomGenerator,this->params,NULL);
this->population = (CPopulation*)new
PopulationImpl( this->params->parentPopulationSize,this->params->offspringPopulationSize,
this->params->pCrossover,this->params->pMutation,this->params->pMutationPerGene,
this->params->randomGenerator,this->params,this->cstats);
int popSize = (params->parentPopulationSize>params->offspringPopulationSize?params->parentPopulationSize:params->offspringPopulationSize);
((PopulationImpl*)this->population)->cudaBuffer = (void*)malloc(sizeof(IndividualImpl)*( popSize ));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment