X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9dd79081a792879245787203a8407c7bff23726a..d329aa1e53719e607fe180edfc7d6ecf49593fad:/teshsuite/simdag/platforms/flatifier.cpp diff --git a/teshsuite/simdag/platforms/flatifier.cpp b/teshsuite/simdag/platforms/flatifier.cpp index 408876fa67..ccda6312b0 100644 --- a/teshsuite/simdag/platforms/flatifier.cpp +++ b/teshsuite/simdag/platforms/flatifier.cpp @@ -14,7 +14,7 @@ #include #include - +#include "src/surf/network_interface.hpp" #include "simgrid/simdag.h" #include "xbt/log.h" #include "xbt/dict.h" @@ -31,20 +31,18 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(flatifier, static int name_compare_hosts(const void *n1, const void *n2) { - char name1[80], name2[80]; - strcpy(name1, SD_workstation_get_name(*((SD_workstation_t *) n1))); - strcpy(name2, SD_workstation_get_name(*((SD_workstation_t *) n2))); - - return strcmp(name1, name2); + return strcmp( + sg_host_get_name(*(sg_host_t *) n1), + sg_host_get_name(*(sg_host_t *) n2) + ); } static int name_compare_links(const void *n1, const void *n2) { - char name1[80], name2[80]; - strcpy(name1, sg_link_name(*((SD_link_t *) n1))); - strcpy(name2, sg_link_name(*((SD_link_t *) n2))); - - return strcmp(name1, name2); + return strcmp( + sg_link_name(*(SD_link_t *) n1), + sg_link_name(*(SD_link_t *) n2) + ); } static int parse_cmdline(int *timings, int *downgrade, char **platformFile, int argc, char **argv) @@ -100,17 +98,10 @@ int main(int argc, char **argv) sg_netcard_t value1; sg_netcard_t value2; - const SD_workstation_t *hosts; + const sg_host_t *hosts; const SD_link_t *links; xbt_os_timer_t parse_time = xbt_os_timer_new(); -#ifdef _XBT_WIN32 - setbuf(stderr, NULL); - setbuf(stdout, NULL); -#else - setvbuf(stdout, NULL, _IOLBF, 0); -#endif - SD_init(&argc, argv); if (parse_cmdline(&timings, &downgrade, &platformFile, argc, argv) || !platformFile) { @@ -127,8 +118,8 @@ int main(int argc, char **argv) create_environment(parse_time, platformFile); if (timings) { - XBT_INFO("Parsing time: %fs (%d hosts, %d links)", - xbt_os_timer_elapsed(parse_time),SD_workstation_get_count(), + XBT_INFO("Parsing time: %fs (%zu hosts, %d links)", + xbt_os_timer_elapsed(parse_time),sg_host_count(), sg_link_count()); } else { printf("\n"); @@ -138,18 +129,18 @@ int main(int argc, char **argv) printf("\n"); // Hosts - totalHosts = SD_workstation_get_count(); - hosts = SD_workstation_get_list(); - qsort((void *) hosts, totalHosts, sizeof(SD_workstation_t), + totalHosts = sg_host_count(); + hosts = sg_host_list(); + qsort((void *) hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts); for (i = 0; i < totalHosts; i++) { printf(" 1) { - printf(" core=\"%d\"", SD_workstation_get_cores(hosts[i])); + sg_host_get_name(hosts[i]), + sg_host_speed(hosts[i])); + props = sg_host_get_properties(hosts[i]); + if (sg_host_core_count(hosts[i])>1) { + printf(" core=\"%d\"", sg_host_core_count(hosts[i])); } if (props && !xbt_dict_is_empty(props)) { printf(">\n"); @@ -173,7 +164,7 @@ int main(int argc, char **argv) // Links totalLinks = sg_link_count(); - links = SD_link_get_list(); + links = sg_link_list(); qsort((void *) links, totalLinks, sizeof(SD_link_t), name_compare_links); @@ -202,7 +193,7 @@ int main(int argc, char **argv) ,dst); xbt_dynar_t route=NULL; value2 = sg_host_by_name(dst)->pimpl_netcard; - routing_get_route_and_latency(value1, value2, &route,NULL); + routing_platf->getRouteAndLatency(value1, value2, &route,NULL); for(i=0;igetRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL); for(i=0;igetRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL); for(i=0;ipimpl_netcard; - routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route, NULL); + routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,&route, NULL); for(i=0;i