From: Frederic Suter Date: Fri, 1 Apr 2016 09:26:39 +0000 (+0200) Subject: end slavery in java world X-Git-Tag: v3_13~180^2~12^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/37878bb1d8861fa7618dee787e03d76d56648bc7 end slavery in java world --- diff --git a/examples/java/app/masterworker/Master.java b/examples/java/app/masterworker/Master.java index a030b69438..6c2b872c70 100644 --- a/examples/java/app/masterworker/Master.java +++ b/examples/java/app/masterworker/Master.java @@ -1,4 +1,4 @@ -/* Master of a basic master/slave example in Java */ +/* Master of a basic master/worker example in Java */ /* Copyright (c) 2006-2014. The SimGrid Team. * All rights reserved. */ diff --git a/examples/java/app/masterworker/README b/examples/java/app/masterworker/README index 14bc4c4a3e..56d2f2988f 100644 --- a/examples/java/app/masterworker/README +++ b/examples/java/app/masterworker/README @@ -1,7 +1,7 @@ This is a somehow basic master/workers example. There is 2 kind of processes: - * Master: creates some tasks, and dispatches them to its slaves + * Master: creates some tasks, and dispatches them to its workers * Worker: get tasks from the master and run them At the end of the execution: diff --git a/examples/java/app/masterworker/Worker.java b/examples/java/app/masterworker/Worker.java index 9ca9a2d26a..ff68aacd6f 100644 --- a/examples/java/app/masterworker/Worker.java +++ b/examples/java/app/masterworker/Worker.java @@ -26,7 +26,7 @@ public class Worker extends Process { } int num = Integer.valueOf(args[0]).intValue(); - //Msg.info("Receiving on 'slave_"+num+"'"); + //Msg.info("Receiving on 'worker_"+num+"'"); while(true) { Task task = Task.receive("worker_"+num); diff --git a/examples/java/cloud/masterworker/Master.java b/examples/java/cloud/masterworker/Master.java index 28f424b90b..c783dec801 100644 --- a/examples/java/cloud/masterworker/Master.java +++ b/examples/java/cloud/masterworker/Master.java @@ -24,11 +24,11 @@ public class Master extends Process { } public void main(String[] args) throws MsgException { - int slavesCount = Main.hostNB; + int workersCount = Main.hostNB; ArrayList vms = new ArrayList(); // Create one VM per host and bind a process inside each one. - for (int i = 0; i < slavesCount; i++) { + for (int i = 0; i < workersCount; i++) { Msg.info("create VM0"+i); VM vm = new VM(hosts[i+1],"VM0"+i); vm.start(); @@ -41,7 +41,7 @@ public class Master extends Process { Msg.info("Launched " + vms.size() + " VMs"); Msg.info("Send a first batch of work to everyone"); - workBatch(slavesCount); + workBatch(workersCount); Msg.info("Suspend all VMs"); for (int i = 0; i < vms.size(); i++) { @@ -63,11 +63,11 @@ public class Master extends Process { /* Msg.info("Add one more process per VM."); for (int i = 0; i < vms.size(); i++) { VM vm = vms.get(i); - Slave slave = new Slave(vm,i + vms.size()); - slave.start(); + Worker worker = new Worker(vm,i + vms.size()); + worker.start(); } - workBatch(slavesCount * 2); + workBatch(workersCount * 2); */ Msg.info("Migrate everyone to "+hosts[3].getName()); @@ -85,8 +85,8 @@ public class Master extends Process { Msg.info("Master done."); } - public void workBatch(int slavesCount) throws MsgException { - for (int i = 0; i < slavesCount; i++) { + public void workBatch(int workersCount) throws MsgException { + for (int i = 0; i < workersCount; i++) { Task task = new Task("Task0" + i, Main.task_comp_size, Main.task_comm_size); Msg.info("Sending to WRK0" + i); task.send("MBOX:WRK0" + i); diff --git a/examples/java/process/kill/Killer.java b/examples/java/process/kill/Killer.java index b46590838e..35c799073c 100644 --- a/examples/java/process/kill/Killer.java +++ b/examples/java/process/kill/Killer.java @@ -1,5 +1,3 @@ -/* Master of a basic master/slave example in Java */ - /* Copyright (c) 2006-2014. The SimGrid Team. * All rights reserved. */