Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tracing vivaldi x,y,h for each host
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 15 Apr 2010 09:34:25 +0000 (09:34 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 15 Apr 2010 09:34:25 +0000 (09:34 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7584 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/instr/private.h
src/instr/surf_instr.c
src/surf/network_vivaldi.c

index d537b55..b0a78f5 100644 (file)
@@ -118,6 +118,7 @@ void TRACE_surf_routing_full_parse_end (char *link_name, int src, int dst);
 void TRACE_surf_missing_link (void);
 void TRACE_surf_define_host_id (const char *name, int host_id);
 void TRACE_msg_clean (void);
 void TRACE_surf_missing_link (void);
 void TRACE_surf_define_host_id (const char *name, int host_id);
 void TRACE_msg_clean (void);
+void TRACE_surf_vivaldi_parse_host (char *host, double x, double y, double h);
 
 //for tracing gtnets
 void TRACE_surf_gtnets_communicate (void *action, int src, int dst);
 
 //for tracing gtnets
 void TRACE_surf_gtnets_communicate (void *action, int src, int dst);
index 0660513..6474c8e 100644 (file)
@@ -433,4 +433,17 @@ void TRACE_msg_clean (void)
   }
 }
 
   }
 }
 
+void TRACE_surf_vivaldi_parse_host (char *host, double x, double y, double h)
+{
+  if (!IS_TRACING || !IS_TRACING_PLATFORM) return;
+
+  char valuestr[100];
+  snprintf (valuestr, 100, "%g", x);
+  pajeSetVariable (0, "vivaldi_x", host, valuestr);
+  snprintf (valuestr, 100, "%g", y);
+  pajeSetVariable (0, "vivaldi_y", host, valuestr);
+  snprintf (valuestr, 100, "%g", h);
+  pajeSetVariable (0, "vivaldi_h", host, valuestr);
+}
+
 #endif
 #endif
index 7b9b40b..a3b5294 100644 (file)
@@ -216,6 +216,10 @@ static void netviva_parse_host(void) {
   coord->y = atof(xbt_dynar_get_as(ctn, 1, char*));
   coord->h = atof(xbt_dynar_get_as(ctn, 2, char*));
 
   coord->y = atof(xbt_dynar_get_as(ctn, 1, char*));
   coord->h = atof(xbt_dynar_get_as(ctn, 2, char*));
 
+#ifdef HAVE_TRACING
+  TRACE_surf_vivaldi_parse_host (A_surfxml_host_id, coord->x, coord->y, coord->h);
+#endif
+
   xbt_dynar_free(&ctn);
   xbt_dict_set(coords, A_surfxml_host_id,coord,NULL);
 }
   xbt_dynar_free(&ctn);
   xbt_dict_set(coords, A_surfxml_host_id,coord,NULL);
 }
@@ -265,6 +269,12 @@ void surf_network_model_init_Vivaldi(const char *filename)
   update_model_description(surf_network_model_description,
                            "Vivaldi", surf_network_model);
 
   update_model_description(surf_network_model_description,
                            "Vivaldi", surf_network_model);
 
+#ifdef HAVE_TRACING
+  __TRACE_host_variable(0,"vivaldi_x",0,"declare");
+  __TRACE_host_variable(0,"vivaldi_y",0,"declare");
+  __TRACE_host_variable(0,"vivaldi_h",0,"declare");
+#endif
+
   xbt_cfg_set_string(_surf_cfg_set, "routing", "none");
   routing_model_create(sizeof(double), NULL);
 }
   xbt_cfg_set_string(_surf_cfg_set, "routing", "none");
   routing_model_create(sizeof(double), NULL);
 }