import org.simgrid.msg.Msg;
import org.simgrid.msg.MsgException;
import org.simgrid.msg.Process;
+import org.simgrid.msg.Task;
+
+import master_slave_bypass.FinalizeTask;
public class Master extends Process {
public Master(String hostname, String name) throws HostNotFoundException {
super(hostname, name);
}
public void main(String[] args) throws MsgException {
- Msg.info("Master Hello!");
-/* try {
+ Msg.info("Master Hello!");
+
+ //Create a slave on host "alice"
+ try {
+ Msg.info("Create process on host 'alice'");
Slave process2 = new Slave("alice","process2");
}
catch (MsgException e){
- System.out.println("Mes couilles!!!!!");
- } */
+ System.out.println("Process2!");
+ }
+
+ //Wait for slave "alice"
+ while(true)
+ {
+ Task task = Task.receive("alice");
+ if (task instanceof FinalizeTask) {
+ Msg.info("Received Finalize. I'm done. See you!");
+ break;
+ }
+ }
}
}