package jaceP2P;
import java.rmi.Naming;
+import java.rmi.RemoteException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Vector;
// Variables for Mapping
private int algo;
private double paramAlgo ;
+ private String idAlgo ;
public JaceSpawner(String superNode, int port, String comProtocol,
String[] args, int nbDaemonPerSpawner, int nbDaemonPerThread,
}
// /System.out.println("is running = false");
if (!JaceDaemon.Instance().isRunning())
- System.exit(0);
+ System.exit( 1 ) ;
}
public synchronized void signalDeadNode(JaceInterface host, int rankOfDead) {
ListeTask t = Register.Instance().getListeOfTasks();
ScanThreadSpawner.Instance().kill();
HeartBeatSpawner.Instance().kill();
+
for (int i = 0; i < s + 1; i++) {
new KillThread(i, debut, nbOfDaemonsPerSpawner,
int nbsdc = RunningApplication.Instance()
.getNumberOfSpawnerDisconnections();
+
System.out.println("Application finished successfully !");
// System.out.println("Application finished successfully !!!!!!");
// System.out.println("Application finished successfully !!!!!!");
RunningApplication.Instance().purge();
// System.exit(1);
}
+
+ /** Suprresion of the mapping algorithm on the SuperNode **/
+ centralServer.removeAlgo( idAlgo, 0 ) ;
}
- } catch (Exception e) {
- System.out
- .println("w aiiiiiiiiiiiiiirrrr" + e + " index=" + index);
+ } catch( Exception e ) {
+ System.err.println( "Error the application nodes scan!\n " + e ) ;
z = index;
}
/*
.println("JaceP2P_Error in JaceSpawner.exportObject() when creating the local JaceSpawnerServer "
+ e);
// System.err.println("exit ds JaceSpawner.exportObject");
- System.exit(0);
+ System.exit( 1 ) ;
}
}
connectSuperNode();
}
}
+
+ idAlgo = LocalHost.Instance().getIP() ;
+
if (registerSpawner.getSize() != (nbTasks + nbExtraSpawners)) {
System.err.println("I did not recieve enough nodes from superNode!!!! \n killing application !!!!");
for (int i = 0; i < registerSpawner.getSize(); i++) {
System.err.println("The reserved node was unable to reconnect to the super node");
}
}
- System.exit(0);
+ System.exit( 1 ) ;
}
spawnersList = new Vector<Object>();
System.exit(0);
}
}
+
+
+ /**
+ * Set the identifier of the mapping algorithm used.
+ * @param _s The mapping identifier
+ *
+ * @author Sébastien Miquée
+ */
+ public void setIdAlgo( String _s ) throws RemoteException
+ {
+ idAlgo = _s ;
+ }
public class TransformThread extends Thread {
int i;
System.out.println("waiting till transform of spawner " + j
+ " is finished");
while ((spawnersList.elementAt(j) instanceof Node))
+ {
try {
Thread.sleep(20);
} catch (Exception e) {
}
+ }
+
+ try {
+ ((JaceSpawnerInterface)spawnersList.elementAt( i )).setIdAlgo( idAlgo ) ;
+ } catch (RemoteException e) {
+ System.err.println( "Unable to set Mapping Algorithm identifier" ) ;
+ e.printStackTrace();
+ }
+
}
System.out.println("End Transformation of all spawners. Beginning the computing processes");