diff --git a/smp/src/island.cpp b/smp/src/island.cpp index 36ad0c375..996771f4e 100644 --- a/smp/src/island.cpp +++ b/smp/src/island.cpp @@ -112,7 +112,7 @@ void paradiseo::smp::Island::send(eoSelect& _select) // Convert pop to base pop eoPop baseMigPop; for(auto& indi : migPop) - baseMigPop.push_back(convertToBase(indi)); + baseMigPop.push_back(std::move(convertToBase(indi))); //std::cout << "On envoie de l'île : " << migPop << std::endl; @@ -121,7 +121,7 @@ void paradiseo::smp::Island::send(eoSelect& _select) if(!it->joinable()) sentMessages.erase(it); - sentMessages.push_back(std::thread(&IslandModel::update, model, baseMigPop, this)); + sentMessages.push_back(std::thread(&IslandModel::update, model, std::move(baseMigPop), this)); } } @@ -132,12 +132,12 @@ void paradiseo::smp::Island::receive(void) while (!listImigrants.empty()) { //std::cout << "On reçoit dans l'île : " << listImigrants.size() << std::endl; - eoPop base_offspring = listImigrants.front(); + eoPop base_offspring = std::move(listImigrants.front()); // Convert objects from base to our objects type eoPop offspring; for(auto& indi : base_offspring) - offspring.push_back(convertFromBase(indi)); + offspring.push_back(std::move(convertFromBase(indi))); // Evaluate objects to integrate for(auto& indi : offspring) diff --git a/smp/src/islandModel.cpp b/smp/src/islandModel.cpp index 626ed0745..6baa6e0bc 100644 --- a/smp/src/islandModel.cpp +++ b/smp/src/islandModel.cpp @@ -131,7 +131,6 @@ void paradiseo::smp::IslandModel::setTopology(AbstractTopology& _topo) // If we change when the algorithm is running, we need to recontruct the topo if(running) { - std::cout << "Changing topology" << std::endl; topo.construct(islands.size()); // If we change the topology during the algorithm, we need to isolate stopped islands for(auto it : islands) @@ -152,9 +151,9 @@ void paradiseo::smp::IslandModel::send(void) std::vector neighbors = topo.getIdNeighbors(idFrom); // Send elements to neighbors - eoPop migPop = listEmigrants.front().first; + eoPop migPop = std::move(listEmigrants.front().first); for (unsigned idTo : neighbors) - sentMessages.push_back(std::thread(&AIsland::update, table.getRight()[idTo], migPop)); + sentMessages.push_back(std::thread(&AIsland::update, table.getRight()[idTo], std::move(migPop))); listEmigrants.pop(); }