1 /* Copyright (c) 2006-2014, 2016. 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. */
9 /** This example demonstrates the use of the Task.dsend() method.
11 * This way, the sender can be detached from the communication: it is not blocked as with Task.send()
12 * and has nothing to do at the end as with Task.isend() where it must do a Comm.wait().
15 import org.simgrid.msg.Host;
16 import org.simgrid.msg.HostNotFoundException;
17 import org.simgrid.msg.Msg;
21 /* This is just to ensure that nobody creates an instance of this singleton */
22 throw new IllegalAccessError("Utility class");
25 public static void main(String[] args) throws HostNotFoundException {
28 String platform = "../platforms/small_platform.xml";
29 if (args.length >= 1) {
30 platform = args[0]; // Override the default value if passed on the command line
33 /* construct the platform and deploy the application */
34 Msg.createEnvironment(platform);
35 Host[] hosts = Host.all();
36 new Sender(hosts[0],"Sender").start();
37 for (int i=1; i < hosts.length; i++){
38 new Receiver(hosts[i], "Receiver").start();
40 /* execute the simulation. */