X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0afab0e550e09d35a4aaaae802c7f2ea17d2b860..3cf8dfbfab4595b3e7ae85d3cd89ce9dbcdd7a24:/examples/msg/tracing/user_variables.c diff --git a/examples/msg/tracing/user_variables.c b/examples/msg/tracing/user_variables.c index 65697ff199..b338130b8d 100644 --- a/examples/msg/tracing/user_variables.c +++ b/examples/msg/tracing/user_variables.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010. The SimGrid Team. +/* Copyright (c) 2010, 2012-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -6,26 +6,18 @@ /** @addtogroup MSG_examples * - * - tracing/user_variables.c: This program demonstrates how to - * trace user variables associated to the hosts of the platform file. - * You might want to run this program with the following parameters: - * --cfg=tracing:1 - * --cfg=tracing/platform:1 + * - tracing/user_variables.c: This program demonstrates how to trace user variables associated to the hosts of + * the platform file. You might want to run this program with the following parameters: + * --cfg=tracing:yes + * --cfg=tracing/platform:yes * (See \ref tracing_tracing_options for details) */ -#include -#include "msg/msg.h" -#include "xbt/sysdep.h" /* calloc, printf */ +#include "simgrid/msg.h" -/* Create a log channel to have nice outputs. */ -#include "xbt/log.h" -#include "xbt/asserts.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); -int master(int argc, char *argv[]); - -int master(int argc, char *argv[]) +static int master(int argc, char *argv[]) { const char *hostname = MSG_host_get_name(MSG_host_self()); int i; @@ -56,7 +48,6 @@ int master(int argc, char *argv[]) return 0; } -/** Main function */ int main(int argc, char *argv[]) { MSG_init(&argc, argv); @@ -65,9 +56,7 @@ int main(int argc, char *argv[]) exit(1); } - char *platform_file = argv[1]; - char *deployment_file = argv[2]; - MSG_create_environment(platform_file); + MSG_create_environment(argv[1]); //declaring user variables TRACE_host_variable_declare("HDD_capacity"); @@ -76,7 +65,7 @@ int main(int argc, char *argv[]) //register functions and launch deployment MSG_function_register("master", master); MSG_function_register("slave", master); - MSG_launch_application(deployment_file); + MSG_launch_application(argv[2]); MSG_main(); @@ -100,9 +89,9 @@ int main(int argc, char *argv[]) xbt_dynar_free (&link_variables); } - //create a customized triva graph configuration file + //create a customized viva graph configuration file FILE *fp; - fp = fopen ("triva_graph.plist", "w"); + fp = fopen ("viva_graph.plist", "w"); if (!fp){ return 1; }