X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a182030b5a8c0db05a1de18ca230b61e76363ebc..5e2dd3ecf166c2d82974beb220aeb8dd4200f105:/src/instr/variables_instr.c diff --git a/src/instr/variables_instr.c b/src/instr/variables_instr.c index 7b6be993fe..bc51c874a8 100644 --- a/src/instr/variables_instr.c +++ b/src/instr/variables_instr.c @@ -1,14 +1,8 @@ -/* - * 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 "surf/surf_private.h" @@ -16,13 +10,19 @@ #ifdef HAVE_TRACING -extern routing_t used_routing; +// extern routing_t used_routing; // COMMENTED BY DAVID +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]; + int src_id, dst_id; + 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){ @@ -30,17 +30,17 @@ 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); +// if (!used_routing) return; +// +// src_id = *(int*)xbt_dict_get(used_routing->host_id,src); +// dst_id = *(int*)xbt_dict_get(used_routing->host_id,dst); +// 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); @@ -54,9 +54,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){