1 /* Copyright (c) 2006-2014. The SimGrid Team.
2 * All rights reserved. */
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. */
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;
15 public class Sender extends Process {
16 public Sender(Host host, String name, String[] args) {
17 super(host,name,args);
19 private final double commSizeLat = 1;
20 final double commSizeBw = 100000000;
22 public void main(String[] args) throws MsgException {
26 int hostCount = args.length;
28 Msg.info("host count: " + hostCount);
29 String mailboxes[] = new String[hostCount];
31 double computeDuration = 10000;
34 for(int pos = 0; pos < args.length ; pos++) {
36 mailboxes[pos] = Host.getByName(args[pos]).getName();
37 } catch (HostNotFoundException e) {
38 Msg.info("Invalid deployment file: " + e.toString());
43 for (int pos = 0; pos < hostCount; pos++) {
44 time = Msg.getClock();
46 Msg.info("sender time: " + time);
48 task = new Task("no name",computeDuration,commSizeLat);
50 task.send(mailboxes[pos]);