Fix a bug in IslandModel in order to clean the list of emigrants at the end of the algorithm
This commit is contained in:
parent
7c4346d090
commit
cfbe7ad242
1 changed files with 6 additions and 3 deletions
|
|
@ -56,7 +56,7 @@ void paradiseo::smp::IslandModel<EOT>::operator()()
|
||||||
|
|
||||||
// Launching threads
|
// Launching threads
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
for(auto it : islands)
|
for(auto& it : islands)
|
||||||
{
|
{
|
||||||
it.first->setRunning();
|
it.first->setRunning();
|
||||||
threads[i] = std::thread(&AIsland<EOT>::operator(), it.first);
|
threads[i] = std::thread(&AIsland<EOT>::operator(), it.first);
|
||||||
|
|
@ -104,8 +104,10 @@ void paradiseo::smp::IslandModel<EOT>::operator()()
|
||||||
sentMessages.clear();
|
sentMessages.clear();
|
||||||
|
|
||||||
// Force last integration
|
// Force last integration
|
||||||
|
while(!listEmigrants.empty())
|
||||||
|
send();
|
||||||
i = 0;
|
i = 0;
|
||||||
for(auto it : islands)
|
for(auto& it : islands)
|
||||||
{
|
{
|
||||||
threads[i] = std::thread(&AIsland<EOT>::receive, it.first);
|
threads[i] = std::thread(&AIsland<EOT>::receive, it.first);
|
||||||
i++;
|
i++;
|
||||||
|
|
@ -116,6 +118,7 @@ void paradiseo::smp::IslandModel<EOT>::operator()()
|
||||||
thread.join();
|
thread.join();
|
||||||
|
|
||||||
running = false;
|
running = false;
|
||||||
|
std::cout << "hhhhhhh" << listEmigrants.size() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue