private ArrayList<GNode> gnodes = null;
private Algo al = null ;
private int count = 0 ;
- private boolean inDemand = false, operating = false ;
+ private boolean inDemand = false, operating = false, authorized = false ;
// private boolean daemonListChange ;
// Constructors
/** Initialization of Grid architecture (G5K for now) **/
Grid grid = Utils.createGridG5k(gnodes);
grid.initClusters();
+
/** Creation of tasks GTask **/
ArrayList<GTask> ts = new ArrayList<GTask>();
}
}
}
+
Graph graph = new Graph();
/** Launching the Mapping **/
al.map();
+
/** Transforming mapping in register **/
Mapping mp = al.getMapping();
-
+
+
/** Creating the register **/
ArrayList<GNode> ag = mp.getMappedGNodes();
+ authorized = true ;
+
for (int i = 0; i < ag.size(); i++) {
reg.addNode((Node) ag.get(i).getNode());
gnodes.remove(ag.get(i));
Register.Instance().removeNode((Node) ag.get(i).getNode());
}
+
+ authorized = false ;
if (ag.size() != 0) {
SuperNodeListe.Instance().forwardCountNode();
GNode removedGNode = null ;
if( _n != null )
- {
- workingOnGnodes() ;
+ {
+ boolean free = false ;
+
+ if( ! operating )
+ {
+ workingOnGnodes() ;
+ free = true ;
+ }
for( int i = 0 ; i < gnodes.size() ; i++ )
{
SuperNodeListe.Instance().removeGNode( removedGNode ) ;
- operating = false ;
+ if( free )
+ {
+ operating = false ;
+ }
}
while( ! operating )
{
inDemand = true ;
+ tmp = true ;
tmp = tmp && SuperNodeListe.Instance().workingOnGnodes() ;
{
System.out.println( "Replacing node found." ) ;
node = (Node) remp.getNode() ;
+
+ authorized = true ;
+
delGNodeFromList( node ) ;
+
+ authorized = false ;
+
SuperNodeListe.Instance().forwardCountNode();
} else {
System.err.println( "Replacing node not found !!" ) ;
{
System.out.println( "Other new node found." ) ;
node = (Node) remp.getNode() ;
+
+ authorized = true ;
+
delGNodeFromList( node ) ;
+
+ authorized = false ;
+
SuperNodeListe.Instance().forwardCountNode();
} else {
System.err.println( "Other new node not found !!" ) ;
al = _al ;
}
+
@Override
/**
* Allow or deny the use of operations on the gnodes list, in order to
* @author miquee
* @return The authorization or not to block gnodes
*/
- public boolean blockForMapping()
+ public boolean blockForMapping() throws RemoteException
{
while( inDemand )
{
}
}
- if( operating )
+ if( operating && ! authorized )
{
return false ;
} else {