Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "Remove XBT_INFO call"
[simgrid.git] / examples / java / reservationSurfPlugin / Sender.java
1 /* Copyright (c) 2006-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 package reservationSurfPlugin;
8 import org.simgrid.msg.Host;
9 import org.simgrid.msg.HostNotFoundException;
10 import org.simgrid.msg.Msg;
11 import org.simgrid.msg.MsgException;
12 import org.simgrid.msg.Process;
13 import org.simgrid.msg.Task;
14
15 public class Sender extends Process {
16         public Sender(Host host, String name, String[] args) {
17                 super(host,name,args);
18         }
19     private final double commSizeLat = 1;
20     final double commSizeBw = 100000000;
21
22     public void main(String[] args) throws MsgException {
23
24        Msg.info("helloo!");
25
26        String receiverName = args[0];
27        double oldTime, curTime;
28        double computeDuration = 10000;
29        Task task;
30
31        oldTime = Msg.getClock();
32              task = new Task("no name",computeDuration,commSizeLat);
33              task.send(receiverName);
34        curTime = Msg.getClock();
35        Msg.info("Send duration: " + (curTime - oldTime));
36
37        TestPlugin.tp.updateBandwidthRoute("Jacquelin", "Boivin", 10E2);
38        oldTime = curTime;
39        task = new Task("no name",computeDuration,commSizeLat);
40        task.send(receiverName);
41        curTime = Msg.getClock();
42        Msg.info("Send duration with update bandwidth: " + (curTime - oldTime));
43
44        TestPlugin.tp.limitBandwidthActions("Jacquelin", "Boivin", 10E1);
45        oldTime = curTime;
46        task = new Task("no name",computeDuration,commSizeLat);
47        task.send(receiverName);
48        curTime = Msg.getClock();
49        Msg.info("Send normal duration with limited bandwidth: " + (curTime - oldTime));
50
51        Msg.info("goodbye!");
52     }
53 }