diff --git a/smp/src/islandModel.cpp b/smp/src/islandModel.cpp index 597818bd2..f93362011 100644 --- a/smp/src/islandModel.cpp +++ b/smp/src/islandModel.cpp @@ -56,7 +56,7 @@ void paradiseo::smp::IslandModel::operator()() // Launching threads unsigned i = 0; - for(auto it : islands) + for(auto& it : islands) { it.first->setRunning(); threads[i] = std::thread(&AIsland::operator(), it.first); @@ -104,18 +104,21 @@ void paradiseo::smp::IslandModel::operator()() sentMessages.clear(); // Force last integration + while(!listEmigrants.empty()) + send(); i = 0; - for(auto it : islands) + for(auto& it : islands) { threads[i] = std::thread(&AIsland::receive, it.first); i++; } - + // Wait the end of the last integration for(auto& thread : threads) thread.join(); running = false; + std::cout << "hhhhhhh" << listEmigrants.size() << std::endl; } template