#define ROUTE(i,j) routing_table[(i)+(j)*nb_workstation]
static network_link_KCCFLN05_t loopback = NULL;
-static xbt_dict_t network_link_set = NULL;
+/*xbt_dict_t network_link_set = NULL;*/
/* convenient function */
static void __update_cpu_usage(cpu_KCCFLN05_t cpu)
return NULL;
}
+/* returns a NULL-terminated array of network_link_KCCFLN05_t */
+static const void** get_route(void *src, void *dst) {
+ cpu_KCCFLN05_t card_src = src;
+ cpu_KCCFLN05_t card_dst = dst;
+ route_KCCFLN05_t route = &(ROUTE(card_src->id, card_dst->id));
+ int route_size = route->size;
+
+ /* add NULL at the end of the array if not present */
+ route->links = xbt_realloc(route->links, (route_size+1) * sizeof(route_KCCFLN05_t));
+ route->links[route_size] = NULL;
+
+ return (const void**) route->links;
+}
/**************************************/
/*** Resource Creation & Destruction **/
surf_workstation_resource->extension_public->get_available_speed = get_available_speed;
surf_workstation_resource->extension_public->communicate = communicate;
surf_workstation_resource->extension_public->execute_parallel_task = execute_parallel_task;
+ surf_workstation_resource->extension_public->get_route = get_route;
workstation_set = xbt_dict_new();
network_link_set = xbt_dict_new();