4 * Copyright 2006,2007 Martin Quinson, Malek Cherier
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package.
11 import org.simgrid.msg.Host;
12 import org.simgrid.msg.Msg;
13 import org.simgrid.msg.MsgException;
14 import org.simgrid.msg.Task;
15 import org.simgrid.msg.Process;
17 public class Receiver extends Process {
18 public Receiver(Host host, String name, String[]args) {
19 super(host,name,args);
21 final double commSizeLat = 1;
22 final double commSizeBw = 100000000;
24 public void main(String[] args) throws MsgException {
27 double communicationTime=0;
29 double time = Msg.getClock();
31 Msg.info("try to get a task");
33 PingPongTask task = (PingPongTask)Task.receive(getHost().getName());
34 double timeGot = Msg.getClock();
35 double timeSent = task.getTime();
37 Msg.info("Got at time "+ timeGot);
38 Msg.info("Was sent at time "+timeSent);
41 communicationTime=timeGot - time;
42 Msg.info("Communication time : " + communicationTime);
44 Msg.info(" --- bw "+ commSizeBw/communicationTime + " ----");