-/* Copyright (c) 2005 Henri Casanova. All rights reserved. */
+/* Copyright (c) 2007, 2008, 2009, 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. */
gtnets_link->bw_current = bw;
gtnets_link->lat_current = lat;
gtnets_link->id = link_count;
-
+#ifdef HAVE_TRACING
+ TRACE_surf_link_declaration (name, bw, lat);
+#endif
xbt_dict_set(surf_network_model->resource_set, name, gtnets_link,
surf_resource_free);
}
DEBUG2("Action (%p) remains old value: %f", action,
action->generic_action.remains);
double remain = gtnets_get_flow_rx(action);
+
+#ifdef HAVE_TRACING
+ // tracing resource utilization
+ int src = TRACE_surf_gtnets_get_src (action);
+ int dst = TRACE_surf_gtnets_get_dst (action);
+ if (src != -1 && dst != -1){
+ xbt_dynar_t route = used_routing->get_route(src, dst);
+ network_link_GTNETS_t link;
+ unsigned int i;
+ xbt_dynar_foreach(route, i, link) {
+
+ TRACE_surf_link_set_utilization (link->generic_resource.name,
+ action->generic_action.data, (action->generic_action.remains-remain)/delta, now-delta, delta);
+ }
+ }
+#endif
+
DEBUG1("Remain value returned by GTNetS : %f", remain);
//need to trust this remain value
if (remain == 0) {
action = (surf_action_network_GTNETS_t) (metadata[i]);
action->generic_action.finish = now + time_to_next_flow_completion;
+#ifdef HAVE_TRACING
+ TRACE_surf_gtnets_destroy (action);
+#endif
action_state_set((surf_action_t) action, SURF_ACTION_DONE);
DEBUG1("----> Action (%p) just terminated", action);
}
xbt_assert2(0, "Not route between host %s and host %s", src_name,
dst_name);
}
+#ifdef HAVE_TRACING
+ TRACE_surf_gtnets_communicate (action, src, dst);
+#endif
return (surf_action_t) action;
}
xbt_dict_free(&surf_network_model->resource_set);
surf_model_exit(surf_network_model);
-
- free(surf_network_model);
surf_network_model = NULL;
gtnets_finalize();