Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
wipe out old code based on ids for nodes
[simgrid.git] / src / instr / variables_instr.c
index bd1c38a..1642943 100644 (file)
@@ -1,29 +1,26 @@
-/*
- * variables_instr.c
- *
- *  Created on: Feb 23, 2010
- *      Author: Lucas Schnorr
- *     License: This program is free software; you can redistribute
- *              it and/or modify it under the terms of the license
- *              (GNU LGPL) which comes with this package.
- *
- *     Copyright (c) 2009 The SimGrid team.
- */
+/* Copyright (c) 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "instr/private.h"
-#include "instr/config.h"
 #include "surf/surf_private.h"
 #include "surf/network_private.h"
 
 #ifdef HAVE_TRACING
 
-extern routing_t used_routing;
+extern routing_global_t global_routing;
 
 void __TRACE_link_variable (double time, const char *src, const char *dst, const char *variable, double value, const char *what)
 {
+       char valuestr[100];
+       xbt_dynar_t route = NULL;
+       unsigned int i;
+    void *link_ptr;
+    char *link = NULL;
   if (!IS_TRACING || !IS_TRACING_PLATFORM) return;
 
-  char valuestr[100];
   snprintf (valuestr, 100, "%g", value);
 
   if (strcmp (what, "declare") == 0){
@@ -31,17 +28,11 @@ void __TRACE_link_variable (double time, const char *src, const char *dst, const
        return;
   }
 
-  if (!used_routing) return;
-
-  int src_id, dst_id;
-  src_id = *(int*)xbt_dict_get(used_routing->host_id,src);
-  dst_id = *(int*)xbt_dict_get(used_routing->host_id,dst);
-  xbt_dynar_t route = used_routing->get_route(src_id, dst_id);
-
-  unsigned int i;
-  void *link_ptr;
+  if (!global_routing) return;
+  route = global_routing->get_route(src, dst);
+  
   xbt_dynar_foreach(route, i, link_ptr) {
-       char *link = (*(link_CM02_t)link_ptr).lmm_resource.generic_resource.name;
+       link = (*(link_CM02_t)link_ptr).lmm_resource.generic_resource.name;
 
        if (strcmp (what, "set") == 0){
          pajeSetVariable (time, variable, link, valuestr);
@@ -55,9 +46,9 @@ void __TRACE_link_variable (double time, const char *src, const char *dst, const
 
 void __TRACE_host_variable (double time, const char *variable, double value, const char *what)
 {
+       char valuestr[100];
   if (!IS_TRACING || !IS_TRACING_PLATFORM) return;
 
-  char valuestr[100];
   snprintf (valuestr, 100, "%g", value);
 
   if (strcmp (what, "declare") == 0){