Fix a bug in conversion functions for heterogeneous model

This commit is contained in:
quemy 2012-12-04 23:17:27 +01:00
commit aa9c01568b
3 changed files with 5 additions and 8 deletions

View file

@ -29,7 +29,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
template<template <class> class EOAlgo, class EOT, class bEOT> template<template <class> class EOAlgo, class EOT, class bEOT>
template<class... Args> template<class... Args>
paradiseo::smp::Island<EOAlgo,EOT,bEOT>::Island(std::function<EOT&&(bEOT&)> _convertFromBase, std::function<bEOT&&(EOT&)> _convertToBase, eoPop<EOT>& _pop, IntPolicy<EOT>& _intPolicy, MigPolicy<EOT>& _migPolicy, Args&... args) : paradiseo::smp::Island<EOAlgo,EOT,bEOT>::Island(std::function<EOT(bEOT&)> _convertFromBase, std::function<bEOT(EOT&)> _convertToBase, eoPop<EOT>& _pop, IntPolicy<EOT>& _intPolicy, MigPolicy<EOT>& _migPolicy, Args&... args) :
// The PPExpander looks for the continuator in the parameters pack. // The PPExpander looks for the continuator in the parameters pack.
// The private inheritance of ContWrapper wraps the continuator and add islandNotifier. // The private inheritance of ContWrapper wraps the continuator and add islandNotifier.
ContWrapper<EOT, bEOT>(Loop<Args...>().template findValue<eoContinue<EOT>>(args...), this), ContWrapper<EOT, bEOT>(Loop<Args...>().template findValue<eoContinue<EOT>>(args...), this),
@ -54,8 +54,8 @@ template<class... Args>
paradiseo::smp::Island<EOAlgo,EOT,bEOT>::Island(eoPop<EOT>& _pop, IntPolicy<EOT>& _intPolicy, MigPolicy<EOT>& _migPolicy, Args&... args) : paradiseo::smp::Island<EOAlgo,EOT,bEOT>::Island(eoPop<EOT>& _pop, IntPolicy<EOT>& _intPolicy, MigPolicy<EOT>& _migPolicy, Args&... args) :
Island( Island(
// Default conversion functions for homogeneous islands // Default conversion functions for homogeneous islands
[](bEOT& i) -> EOT&& { return std::forward<EOT>(i); }, [](bEOT& i) -> EOT { return std::forward<EOT>(i); },
[](EOT& i) -> bEOT&& { return std::forward<bEOT>(i); }, [](EOT& i) -> bEOT { return std::forward<bEOT>(i); },
_pop, _intPolicy, _migPolicy, args...) _pop, _intPolicy, _migPolicy, args...)
{ } { }

View file

@ -75,7 +75,7 @@ public:
* @param args Parameters to construct the algorithm. * @param args Parameters to construct the algorithm.
*/ */
template<class... Args> template<class... Args>
Island(std::function<EOT&&(bEOT&)> _convertFromBase, std::function<bEOT&&(EOT&)> _convertToBase, eoPop<EOT>& pop, IntPolicy<EOT>& _intPolicy, MigPolicy<EOT>& _migPolicy, Args&... args); Island(std::function<EOT(bEOT&)> _convertFromBase, std::function<bEOT(EOT&)> _convertToBase, eoPop<EOT>& pop, IntPolicy<EOT>& _intPolicy, MigPolicy<EOT>& _migPolicy, Args&... args);
/** /**
* Constructor * Constructor
* @param _popSize Size of the algorithm population. * @param _popSize Size of the algorithm population.

View file

@ -94,9 +94,6 @@ void paradiseo::smp::IslandModel<EOT>::operator()()
for(auto& thread : threads) for(auto& thread : threads)
thread.join(); thread.join();
// Send last population
while(!listEmigrants.empty())
send();
// Wait the end of messages sending // Wait the end of messages sending
for(auto& message : sentMessages) for(auto& message : sentMessages)