Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
guess what? more refactoring!
[simgrid.git] / examples / msg / tracing / ms.c
index 8b6d5ce..697a814 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * enable the tracing of categorized resource utilization, the use of trace marks,
  * and user variables associated to the hosts of the platform file.
  * You might want to run this program with the following parameters:
- * --cfg=tracing/categorized:1
- * --cfg=tracing/uncategorized:1
+ * --cfg=tracing/categorized:yes
+ * --cfg=tracing/uncategorized:yes
  * --cfg=viva/categorized:viva_cat.plist
  * --cfg=viva/uncategorized:viva_uncat.plist
  * (See \ref tracing_tracing_options for details)
  */
 
 #include <stdio.h>
-#include "msg/msg.h"
+#include "simgrid/msg.h"
 #include "xbt/sysdep.h"         /* calloc, printf */
 
 /* Create a log channel to have nice outputs. */
@@ -32,13 +32,13 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
 int master(int argc, char *argv[]);
 int slave(int argc, char *argv[]);
 
-/** Emitter function  */
+/** sender function  */
 int master(int argc, char *argv[])
 {
-  long number_of_tasks = atol(argv[1]);
-  double task_comp_size = atof(argv[2]);
-  double task_comm_size = atof(argv[3]);
-  long slaves_count = atol(argv[4]);
+  long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
+  double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
+  double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
+  long slaves_count = xbt_str_parse_int(argv[4], "Invalid amount of slaves: %s");
 
   //setting the variable "is_master" (previously declared) to value 1
   TRACE_host_variable_set(MSG_host_get_name(MSG_host_self()), "is_master", 1);
@@ -88,7 +88,7 @@ int slave(int argc, char *argv[])
     //to the variable "task_computation"
     TRACE_host_variable_add(MSG_host_get_name(MSG_host_self()),
                             "task_computation",
-                            MSG_task_get_compute_duration(task));
+                            MSG_task_get_flops_amount(task));
     MSG_task_execute(task);
     MSG_task_destroy(task);
     task = NULL;