From 9a0e58779c6f987930d96b8a9655b3c8aeb6c2c5 Mon Sep 17 00:00:00 2001 From: canape Date: Thu, 17 Jan 2008 15:37:05 +0000 Subject: [PATCH] git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@894 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-peo/src/peoAsyncIslandMig.h | 42 ++++----------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/trunk/paradiseo-peo/src/peoAsyncIslandMig.h b/trunk/paradiseo-peo/src/peoAsyncIslandMig.h index 22ea427c0..f32f6ef93 100644 --- a/trunk/paradiseo-peo/src/peoAsyncIslandMig.h +++ b/trunk/paradiseo-peo/src/peoAsyncIslandMig.h @@ -190,21 +190,13 @@ template< class EOT, class TYPE > class peoAsyncIslandMig : public Cooperative, private: continuator & cont; // continuator - eoSelect< EOT >& select; // the selection strategy eoReplacement< EOT >& replace; // the replacement strategy Topology& topology; // the neighboring topology - - // source and destination populations peoData & source; peoData & destination; - - // immigrants & emigrants in the queue - std :: queue< peoData* > imm; - std :: queue< peoData* > em; - - std :: vector< TYPE > vect; - + std :: queue< TYPE > imm; + std :: queue< TYPE > em; std :: queue< Cooperative* > coop_em; }; @@ -227,35 +219,21 @@ template< class EOT , class TYPE> peoAsyncIslandMig< EOT, TYPE > :: peoAsyncIsla template< class EOT , class TYPE> void peoAsyncIslandMig< EOT, TYPE > :: pack() { - - std::cout << "[peoAsyncIslandMig] [pack] [begin]" << std::endl ; lock (); - ::pack( coop_em.front()->getKey() ); - //::pack(em.front()); - - //coop_em.front()->getKey().pack(); - //std::cout << em.front() << std::endl ; - em.front()->pack(); - + em.front().pack(); coop_em.pop(); em.pop(); - unlock(); - std::cout << "[peoAsyncIslandMig] [pack] [end]" << std::endl ; } template< class EOT , class TYPE> void peoAsyncIslandMig< EOT , TYPE> :: unpack() { - lock (); - - peoData mig; - //::unpack( mig ); + TYPE mig; mig.unpack(); - imm.push( &mig ); - + imm.push( mig ); unlock(); } @@ -264,7 +242,6 @@ template< class EOT , class TYPE> void peoAsyncIslandMig< EOT, TYPE > :: packSyn template< class EOT , class TYPE> void peoAsyncIslandMig< EOT , TYPE> :: emigrate() { - std::cout << "[peoAsyncIslandMig] [emigrate] [begin]" << std::endl ; std :: vector< Cooperative* >in, out; topology.setNeighbors( this, in, out ); @@ -272,23 +249,18 @@ template< class EOT , class TYPE> void peoAsyncIslandMig< EOT , TYPE> :: emigrat { TYPE mig; - vect.push_back(mig); //select( source, mig ); - //em.push( &mig ); - - em.push(&(vect[vect.size()-1])); - + em.push( mig ); coop_em.push( out[i] ); send( out[i] ); printDebugMessage( "sending some emigrants." ); } - std::cout << "[peoAsyncIslandMig] [emigrate] [end]" << std::endl ; } template< class EOT , class TYPE> void peoAsyncIslandMig< EOT , TYPE> :: immigrate() { - + lock (); {