A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename routing_component to as, since that's just an AS at the end of the day
[simgrid.git]
/
src
/
surf
/
surf_routing_cluster.c
diff --git
a/src/surf/surf_routing_cluster.c
b/src/surf/surf_routing_cluster.c
index
5438a30
..
8a25091
100644
(file)
--- a/
src/surf/surf_routing_cluster.c
+++ b/
src/surf/surf_routing_cluster.c
@@
-7,25
+7,19
@@
/* Global vars */
extern routing_global_t global_routing;
/* Global vars */
extern routing_global_t global_routing;
-extern routing_component_t current_routing;
-extern model_type_t current_routing_model;
-extern xbt_dynar_t link_list;
-extern xbt_dict_t cluster_host_link;
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
-/* Routing model structure */
+/* This routing is specifically setup to represent clusters, aka homogeneous sets of machines
+ * Note that a router is created, easing the interconnexion with the rest of the world.
+ */
-typedef struct {
- s_routing_component_t generic_routing;
- xbt_dict_t dict_processing_units;
- xbt_dict_t dict_autonomous_systems;
-} s_routing_component_cluster_t, *routing_component_cluster_t;
+static xbt_dict_t cluster_host_link = NULL; /* for tag cluster */
/* Business methods */
/* Business methods */
-static route_extended_t cluster_get_route(
routing_component_t rc
,
-
const char *src,
-
const char *dst) {
+static route_extended_t cluster_get_route(
AS_t as
,
+ const char *src,
+ const char *dst) {
xbt_dynar_t links_list = xbt_dynar_new(global_routing->size_of_link, NULL);
xbt_dynar_t links_list = xbt_dynar_new(global_routing->size_of_link, NULL);
@@
-34,7
+28,7
@@
static route_extended_t cluster_get_route(routing_component_t rc,
info = xbt_dict_get_or_null(cluster_host_link,src);
if(info) xbt_dynar_push_as(links_list,void*,info->link_up); //link_up
info = xbt_dict_get_or_null(cluster_host_link,src);
if(info) xbt_dynar_push_as(links_list,void*,info->link_up); //link_up
- info = xbt_dict_get_or_null(cluster_host_link,
rc
->name);
+ info = xbt_dict_get_or_null(cluster_host_link,
as
->name);
if(info) xbt_dynar_push_as(links_list,void*,info->link_up); //link_bb
info = xbt_dict_get_or_null(cluster_host_link,dst);
if(info) xbt_dynar_push_as(links_list,void*,info->link_up); //link_bb
info = xbt_dict_get_or_null(cluster_host_link,dst);
@@
-48,10
+42,17
@@
static route_extended_t cluster_get_route(routing_component_t rc,
}
/* Creation routing model functions */
}
/* Creation routing model functions */
-
void *
model_cluster_create(void)
+
AS_t
model_cluster_create(void)
{
{
-
routing_component_cluster_t new_component = model_rulebased
_create();
-
new_component->generic_routing.
get_route = cluster_get_route;
+
AS_t result = model_none
_create();
+
result->
get_route = cluster_get_route;
- return new_component;
+ return (AS_t) result;
+}
+
+void surf_routing_cluster_add_link(const char* host_id,surf_parsing_link_up_down_t info) {
+ if(!cluster_host_link)
+ cluster_host_link = xbt_dict_new();
+
+ xbt_dict_set(cluster_host_link,host_id,info,xbt_free);
}
}