From d9a2ba6da1bdc02e8adeb3e87f792d5291b2ea10 Mon Sep 17 00:00:00 2001 From: navarrop Date: Thu, 2 Dec 2010 19:59:40 +0000 Subject: [PATCH 1/1] Change flatifier for having router. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8920 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- teshsuite/simdag/platforms/flatifier.c | 68 +- teshsuite/simdag/platforms/flatifier.tesh | 780 +++++++++++++--------- 2 files changed, 525 insertions(+), 323 deletions(-) diff --git a/teshsuite/simdag/platforms/flatifier.c b/teshsuite/simdag/platforms/flatifier.c index f036d63f58..7285eaecda 100644 --- a/teshsuite/simdag/platforms/flatifier.c +++ b/teshsuite/simdag/platforms/flatifier.c @@ -19,6 +19,8 @@ #include "xbt/log.h" #include "xbt/dict.h" #include "xbt/ex.h" +#include "surf/surf.h" +#include "surf/surf_private.h" XBT_LOG_NEW_DEFAULT_CATEGORY(validator, "Logging specific to this SimDag example"); @@ -45,10 +47,13 @@ int main(int argc, char **argv) { char *platformFile = NULL; int totalHosts, totalLinks, tmp_length; - int i, j, k; + int j, k; + unsigned int i; xbt_dict_t props = NULL; xbt_dict_cursor_t cursor = NULL; - char *key, *data; + xbt_dict_cursor_t cursor_src = NULL; + xbt_dict_cursor_t cursor_dst = NULL; + char *src,*dst,*key,*data; xbt_ex_t e; const SD_workstation_t *hosts; @@ -63,13 +68,13 @@ int main(int argc, char **argv) } CATCH(e) { xbt_die(bprintf("Error while loading %s: %s",platformFile,e.msg)); } - printf("\n"); printf("\n"); printf("\n"); printf("\n"); + // Hosts totalHosts = SD_workstation_get_number(); hosts = SD_workstation_get_list(); qsort((void *) hosts, totalHosts, sizeof(SD_workstation_t), @@ -91,6 +96,16 @@ int main(int argc, char **argv) } } + // Routers + xbt_dict_foreach(global_routing->where_network_elements, cursor, key, data) { + if(((network_element_info_t)xbt_dict_get(global_routing->where_network_elements, key))->rc_type + == SURF_NETWORK_ELEMENT_ROUTER) + { + printf(" \n",key); + } + } + + // Links totalLinks = SD_link_get_number(); links = SD_link_get_list(); qsort((void *) links, totalLinks, sizeof(SD_link_t), name_compare_links); @@ -109,22 +124,39 @@ int main(int argc, char **argv) } } - for (i = 0; i < totalHosts; i++) { - for (j = 0; j < totalHosts; j++) { - tmp = SD_route_get_list(hosts[i], hosts[j]); - if (tmp) { - printf(" \n ", - SD_workstation_get_name(hosts[i]), - SD_workstation_get_name(hosts[j])); - - tmp_length = SD_route_get_size(hosts[i], hosts[j]); - for (k = 0; k < tmp_length; k++) { - printf("", SD_link_get_name(tmp[k])); - } - printf("\n \n"); - } - } + // Routes + xbt_dict_foreach(global_routing->where_network_elements, cursor_src, src, data) + { + if(((network_element_info_t)xbt_dict_get(global_routing->where_network_elements, src))->rc_type + == SURF_NETWORK_ELEMENT_ROUTER || + ((network_element_info_t)xbt_dict_get(global_routing->where_network_elements, src))->rc_type + == SURF_NETWORK_ELEMENT_HOST) + { + xbt_dict_foreach(global_routing->where_network_elements, cursor_dst, dst, data) + { + if(((network_element_info_t)xbt_dict_get(global_routing->where_network_elements, dst))->rc_type + == SURF_NETWORK_ELEMENT_ROUTER || + ((network_element_info_t)xbt_dict_get(global_routing->where_network_elements, dst))->rc_type + == SURF_NETWORK_ELEMENT_HOST) + { + printf(" \n " + ,src + ,dst); + xbt_dynar_t route = global_routing->get_route(src,dst); + for(i=0;iname); + printf("",link_name); + } + printf("\n \n"); + + } + } + } } + printf("\n"); printf("\n"); SD_exit(); diff --git a/teshsuite/simdag/platforms/flatifier.tesh b/teshsuite/simdag/platforms/flatifier.tesh index d3ff0f4fe5..bdc2b5d2ed 100644 --- a/teshsuite/simdag/platforms/flatifier.tesh +++ b/teshsuite/simdag/platforms/flatifier.tesh @@ -1,5 +1,7 @@ -$ ./flatifier$EXEEXT one_cluster.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +#! ./tesh + +$ ./flatifier$EXEEXT one_cluster.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -9,6 +11,7 @@ $ ./flatifier$EXEEXT one_cluster.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n > > > +> > > > @@ -17,86 +20,119 @@ $ ./flatifier$EXEEXT one_cluster.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n > > > -> -> +> +> > -> -> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> > > -> +> +> +> +> +> +> +> +> +> +> > > -> +> > > -> +> +> +> +> +> +> +> > > -> +> > > -> -> -> -> +> > > -> +> > > -> +> > -> -> -> -> -> -> -> -> -> -> -> +> +> > -> -> +> +> > > -> +> > > -> -> -> -> +> > > -> +> > > -> +> +> +> +> +> +> +> > > -> +> > > -> -> -> -> +> > > -> +> > > -> +> > > > -$ ./flatifier$EXEEXT one_host_availability.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_host_availability.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -104,13 +140,13 @@ $ ./flatifier$EXEEXT one_host_availability.xml --log=root.fmt:[%10.6r]%e(%i:%P@% > > > -> +> > > > -$ ./flatifier$EXEEXT one_host_properties.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_host_properties.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -122,13 +158,13 @@ $ ./flatifier$EXEEXT one_host_properties.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h) > > > -> +> > > > -$ ./flatifier$EXEEXT one_host_state_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_host_state_file.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -136,13 +172,13 @@ $ ./flatifier$EXEEXT one_host_state_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h) > > > -> +> > > > -$ ./flatifier$EXEEXT one_host_state_off.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_host_state_off.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -150,13 +186,13 @@ $ ./flatifier$EXEEXT one_host_state_off.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)% > > > -> +> > > > -$ ./flatifier$EXEEXT one_host_state_on.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_host_state_on.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -164,13 +200,13 @@ $ ./flatifier$EXEEXT one_host_state_on.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e > > > -> +> > > > -$ ./flatifier$EXEEXT one_host_trace_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_host_trace_file.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -178,13 +214,13 @@ $ ./flatifier$EXEEXT one_host_trace_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h) > > > -> +> > > > -$ ./flatifier$EXEEXT one_host_trace_inside.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_host_trace_inside.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -192,13 +228,13 @@ $ ./flatifier$EXEEXT one_host_trace_inside.xml --log=root.fmt:[%10.6r]%e(%i:%P@% > > > -> +> > > > -$ ./flatifier$EXEEXT one_host.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_host.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -206,13 +242,13 @@ $ ./flatifier$EXEEXT one_host.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n > > > -> +> > > > -$ ./flatifier$EXEEXT one_link_availability.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_link_availability.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -221,13 +257,13 @@ $ ./flatifier$EXEEXT one_link_availability.xml --log=root.fmt:[%10.6r]%e(%i:%P@% > > > -> +> > > > -$ ./flatifier$EXEEXT one_link_fatpipe.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_link_fatpipe.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -236,13 +272,13 @@ $ ./flatifier$EXEEXT one_link_fatpipe.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e% > > > -> +> > > > -$ ./flatifier$EXEEXT one_link_shared.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_link_shared.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -251,13 +287,13 @@ $ ./flatifier$EXEEXT one_link_shared.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m > > > -> +> > > > -$ ./flatifier$EXEEXT one_link_state_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT one_link_state_file.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -266,13 +302,13 @@ $ ./flatifier$EXEEXT one_link_state_file.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h) > > > -> +> > > > -$ ./flatifier$EXEEXT three_hosts_non_symmetric_route.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT three_hosts_non_symmetric_route.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -285,37 +321,37 @@ $ ./flatifier$EXEEXT three_hosts_non_symmetric_route.xml --log=root.fmt:[%10.6r] > > > -> -> -> -> +> > > -> +> > -> -> -> -> -> -> -> -> +> +> > > -> +> +> +> +> > > -> +> > -> -> +> +> +> +> +> +> +> +> > > > -$ ./flatifier$EXEEXT two_clusters.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT two_clusters.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -330,6 +366,8 @@ $ ./flatifier$EXEEXT two_clusters.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n > > > +> +> > > > @@ -346,311 +384,443 @@ $ ./flatifier$EXEEXT two_clusters.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n > > > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> +> +> +> +> +> +> +> +> +> +> +> +> > > -> +> +> +> +> > > -> +> +> +> +> +> +> +> +> +> +> +> +> +> > > -> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> +> +> +> > > -> +> > -> -> +> +> > -> -> +> +> > > -> -> -> -> +> > > -> -> -> -> +> > > -> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> +> +> +> +> +> +> > > -> +> +> +> +> +> +> +> > > -> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> > -> -> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> +> > > > -$ ./flatifier$EXEEXT two_hosts_multi_hop.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT two_hosts_multi_hop.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -662,22 +832,22 @@ $ ./flatifier$EXEEXT two_hosts_multi_hop.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h) > > > -> +> > > -> +> > > -> +> > > -> +> > > > -$ ./flatifier$EXEEXT two_hosts_one_link.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n -> [ 0.000000] (0:@) surf_workstation_model_init_ptask_L07 +$ ./flatifier$EXEEXT two_hosts_one_link.xml --log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n +> [ 0.000000] [0:@] surf_workstation_model_init_ptask_L07 > > > @@ -687,16 +857,16 @@ $ ./flatifier$EXEEXT two_hosts_one_link.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)% > > > -> +> > > -> +> > > -> +> > > -> +> > > > -- 2.20.1