2 * Sender of basic ping/pong example
4 * Copyright 2006,2007,2010 The SimGrid Team. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package.
10 import org.simgrid.msg.Host;
11 import org.simgrid.msg.HostNotFoundException;
12 import org.simgrid.msg.Msg;
13 import org.simgrid.msg.MsgException;
14 import org.simgrid.msg.Process;
16 public class Sender extends Process {
17 public Sender(String hostname, String name) throws HostNotFoundException {
18 super(hostname, name);
20 private final double commSizeLat = 1;
21 final double commSizeBw = 100000000;
23 public void main(String[] args) throws MsgException {
27 int hostCount = args.length;
29 Msg.info("host count: " + hostCount);
30 String mailboxes[] = new String[hostCount];
32 double computeDuration = 0;
35 for(int pos = 0; pos < args.length ; pos++) {
37 mailboxes[pos] = Host.getByName(args[pos]).getName();
38 } catch (HostNotFoundException e) {
39 Msg.info("Invalid deployment file: " + e.toString());
44 for (int pos = 0; pos < hostCount; pos++) {
45 time = Msg.getClock();
47 Msg.info("sender time: " + time);
49 task = new PingPongTask("no name",computeDuration,commSizeLat);
52 task.send(mailboxes[pos]);