2 * Copyright (c) 2006-2013. The SimGrid Team.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package.
9 import org.simgrid.msg.Host;
10 import org.simgrid.msg.Msg;
11 import org.simgrid.msg.MsgException;
12 import org.simgrid.msg.Task;
13 import org.simgrid.msg.Process;
15 public class Receiver extends Process {
16 public Receiver(Host host, String name, String[]args) {
17 super(host,name,args);
19 final double commSizeLat = 1;
20 final double commSizeBw = 100000000;
22 public void main(String[] args) throws MsgException {
25 double communicationTime=0;
27 double time = Msg.getClock();
29 Msg.info("try to get a task");
31 PingPongTask task = (PingPongTask)Task.receive(getHost().getName());
32 double timeGot = Msg.getClock();
33 double timeSent = task.getTime();
35 Msg.info("Got at time "+ timeGot);
36 Msg.info("Was sent at time "+timeSent);
39 communicationTime=timeGot - time;
40 Msg.info("Communication time : " + communicationTime);
42 Msg.info(" --- bw "+ commSizeBw/communicationTime + " ----");