Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
end of MSG examples doc revision
[simgrid.git] / examples / msg / trace-user-variables / trace-user-variables.c
index 5e6a057..aef88a6 100644 (file)
@@ -5,19 +5,21 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /** @addtogroup MSG_examples
+ *
+ * @section msg_ex_tracing_user_variables Tracing user variables
+ * The tracing mechanism of SimGrid also allows to associate user variables to resources described in the platform file.
+ * The following examples illustrate this feature. They have to be run with the <i>--cfg=tracing:yes</i> and
+ * <i>--cfg=tracing/platform:yes</i> options.
  * 
- * - <b>tracing/user_variables.c</b>: 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)
+ * - <b>Hosts: trace-user-variables/trace-user-variables.c</b>. This example shows how user defined variables can be
+ *   associated to an host and how to manage the tracing of their evolution.
  */
 #include <stdio.h>
 #include "simgrid/msg.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int master(int argc, char *argv[])
+static int trace_fun(int argc, char *argv[])
 {
   const char *hostname = MSG_host_get_name(MSG_host_self());
   int i;
@@ -61,8 +63,8 @@ int main(int argc, char *argv[])
   TRACE_host_variable_declare("HDD_utilization");
 
   //register functions and launch deployment
-  MSG_function_register("master", master);
-  MSG_function_register("slave", master);
+  MSG_function_register("master", trace_fun);
+  MSG_function_register("worker", trace_fun);
   MSG_launch_application(argv[2]);
 
   MSG_main();