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)
25 xbt_dynar_t all_hosts;
26 msg_host_t first_host;
27 MSG_init(&argc, argv);
28 MSG_create_environment(argv[1]);
29 MSG_function_register("host", host);
30 all_hosts = MSG_hosts_as_dynar();
31 first_host = xbt_dynar_pop_as(all_hosts,msg_host_t);
32 MSG_process_create( "host", host, NULL, first_host);
33 xbt_dynar_free(&all_hosts);
36 XBT_INFO("Simulation time %g", MSG_get_clock());