1 /* Copyright (c) 2008-2015. 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 #include "simgrid/msg.h"
11 int host(int argc, char *argv[]);
13 XBT_LOG_NEW_DEFAULT_CATEGORY(basic_tracing,"Messages specific for this example");
15 int host(int argc, char *argv[])
17 XBT_INFO("Sleep for 1s");
22 int main(int argc, char **argv)
24 MSG_init(&argc, argv);
25 MSG_create_environment(argv[1]);
26 MSG_function_register("host", host);
27 xbt_dynar_t all_hosts = MSG_hosts_as_dynar();
28 MSG_process_create( "host", host, NULL, xbt_dynar_pop_as(all_hosts,msg_host_t));
29 xbt_dynar_free(&all_hosts);
32 XBT_INFO("Simulation time %g", MSG_get_clock());