X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6b188a3ca7fe91cf125a08229fb4fe51eee26e6d..9687670d5440f10286a0dbc5aab95bb4eb9b6138:/teshsuite/simdag/platforms/basic_tracing.c diff --git a/teshsuite/simdag/platforms/basic_tracing.c b/teshsuite/simdag/platforms/basic_tracing.c index 10bb847641..92a77b321a 100644 --- a/teshsuite/simdag/platforms/basic_tracing.c +++ b/teshsuite/simdag/platforms/basic_tracing.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2008-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -6,7 +6,7 @@ #include #include -#include "msg/msg.h" +#include "simgrid/msg.h" #include "surf/surf_private.h" int host(int argc, char *argv[]); @@ -23,14 +23,19 @@ int host(int argc, char *argv[]) int main(int argc, char **argv) { int res; - MSG_global_init(&argc, argv); + xbt_dynar_t all_hosts; + msg_host_t first_host; + MSG_init(&argc, argv); MSG_create_environment(argv[1]); MSG_function_register("host", host); - MSG_process_create( "host", host, NULL, MSG_get_host_table()[0] ); + all_hosts = MSG_hosts_as_dynar(); + first_host = xbt_dynar_pop_as(all_hosts,msg_host_t); + MSG_process_create( "host", host, NULL, first_host); + xbt_dynar_free(&all_hosts); res = MSG_main(); XBT_INFO("Simulation time %g", MSG_get_clock()); - MSG_clean(); + if (res == MSG_OK) return 0; else