git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@827 331e1502-861f-0410-8da2-ba01fb791d7f

This commit is contained in:
atantar 2007-11-30 09:42:52 +00:00
commit 540ec56e1d

View file

@ -223,6 +223,7 @@ private:
bool standbyMigration; bool standbyMigration;
std :: vector< Cooperative* > in, out, all; std :: vector< Cooperative* > in, out, all;
unsigned nbMigrations;
}; };
@ -281,10 +282,14 @@ template< class EOT > void peoSyncIslandMig< EOT > :: emigrate()
template< class EOT > void peoSyncIslandMig< EOT > :: immigrate() template< class EOT > void peoSyncIslandMig< EOT > :: immigrate()
{ {
assert( imm.size() ); assert( imm.size() );
while ( imm.size() ) {
replace( destination, imm.front() ) ; replace( destination, imm.front() ) ;
imm.pop(); imm.pop();
printDebugMessage( "peoSyncIslandMig: receiving some immigrants." ); }
printDebugMessage( "peoSyncIslandMig: receiving some immigrants." );
} }
template< class EOT > void peoSyncIslandMig< EOT > :: operator()() template< class EOT > void peoSyncIslandMig< EOT > :: operator()()
@ -294,6 +299,7 @@ template< class EOT > void peoSyncIslandMig< EOT > :: operator()()
{ {
explicitPassive = standbyMigration = false; explicitPassive = standbyMigration = false;
topology.setNeighbors( this, in, out ); all = topology; topology.setNeighbors( this, in, out ); all = topology;
nbMigrations = 0;
synchronizeCoopEx(); stop(); synchronizeCoopEx(); stop();
@ -315,8 +321,13 @@ template< class EOT > void peoSyncIslandMig< EOT > :: notifySending()
template< class EOT > void peoSyncIslandMig< EOT > :: notifyReceiving() template< class EOT > void peoSyncIslandMig< EOT > :: notifyReceiving()
{ {
if ( standbyMigration ) getOwner()->setActive(); nbMigrations++;
sem_post( &sync );
if ( nbMigrations == in.size() ) {
if ( standbyMigration ) getOwner()->setActive();
sem_post( &sync );
}
} }
template< class EOT > void peoSyncIslandMig< EOT > :: notifySendingSyncReq () { template< class EOT > void peoSyncIslandMig< EOT > :: notifySendingSyncReq () {