1 /* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
7 import org.simgrid.msg.Host;
8 import org.simgrid.msg.HostNotFoundException;
9 import org.simgrid.msg.Msg;
10 import org.simgrid.msg.MsgException;
11 import org.simgrid.msg.Process;
13 public class Sender extends Process {
14 private static final double COMM_SIZE_LAT = 1;
16 public Sender(String hostname, String name, String[] args) throws HostNotFoundException {
17 super(hostname,name,args);
20 public void main(String[] args) throws MsgException {
21 Msg.info("Host count: " + args.length);
23 for (int i = 0 ; i<Main.TASK_COUNT; i++) {
25 for(int pos = 0; pos < args.length ; pos++) {
26 String hostname = Host.getByName(args[pos]).getName(); // Make sure that this host exists
28 double time = Msg.getClock();
29 Msg.info("sender time: " + time);
31 PingPongTask task = new PingPongTask("no name", /* Duration: 0 flops */ 0, COMM_SIZE_LAT, time);