X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b3973f5189df8d8983e47336546fd0259f0e2dab..f9e6853d2c5b7b867211700bc12f0ee57f640b30:/examples/java/reservationSurfPlugin/Sender.java diff --git a/examples/java/reservationSurfPlugin/Sender.java b/examples/java/reservationSurfPlugin/Sender.java index 5f6ca385a0..6f5ccf4c00 100644 --- a/examples/java/reservationSurfPlugin/Sender.java +++ b/examples/java/reservationSurfPlugin/Sender.java @@ -23,31 +23,33 @@ public class Sender extends Process { Msg.info("helloo!"); - String receiverName = args[0]; - double oldTime, curTime; + int hostCount = args.length; + + Msg.info("host count: " + hostCount); + String mailboxes[] = new String[hostCount]; + double time; double computeDuration = 10000; Task task; - oldTime = Msg.getClock(); - task = new Task("no name",computeDuration,commSizeLat); - task.send(receiverName); - curTime = Msg.getClock(); - Msg.info("Send duration: " + (curTime - oldTime)); - - TestPlugin.tp.updateBandwidthRoute("Jacquelin", "Boivin", 10E2); - oldTime = curTime; - task = new Task("no name",computeDuration,commSizeLat); - task.send(receiverName); - curTime = Msg.getClock(); - Msg.info("Send duration with update bandwidth: " + (curTime - oldTime)); - - TestPlugin.tp.limitBandwidthActions("Jacquelin", "Boivin", 10E1); - oldTime = curTime; - task = new Task("no name",computeDuration,commSizeLat); - task.send(receiverName); - curTime = Msg.getClock(); - Msg.info("Send normal duration with limited bandwidth: " + (curTime - oldTime)); - - Msg.info("goodbye!"); + for(int pos = 0; pos < args.length ; pos++) { + try { + mailboxes[pos] = Host.getByName(args[pos]).getName(); + } catch (HostNotFoundException e) { + Msg.info("Invalid deployment file: " + e.toString()); + System.exit(1); + } + } + + for (int pos = 0; pos < hostCount; pos++) { + time = Msg.getClock(); + + Msg.info("sender time: " + time); + + task = new Task("no name",computeDuration,commSizeLat); + + task.send(mailboxes[pos]); + } + + Msg.info("goodbye!"); } }