1 /* Copyright (c) 2008-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. */
10 #include "surf/surf_private.h"
12 int host(int argc, char *argv[]);
14 XBT_LOG_NEW_DEFAULT_CATEGORY(basic_tracing,"Messages specific for this example");
16 int host(int argc, char *argv[])
18 XBT_INFO("Sleep for 1s");
23 int main(int argc, char **argv)
26 xbt_dynar_t all_hosts;
27 msg_host_t first_host;
28 MSG_init(&argc, argv);
29 MSG_create_environment(argv[1]);
30 MSG_function_register("host", host);
31 all_hosts = MSG_hosts_as_dynar();
32 first_host = xbt_dynar_pop_as(all_hosts,msg_host_t);
33 MSG_process_create( "host", host, NULL, first_host);
34 xbt_dynar_free(&all_hosts);
37 XBT_INFO("Simulation time %g", MSG_get_clock());