X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/931e26e928ecd6de21bd1450de7ac17a9780cbd4..9f1b83fd35a713664c907baf85e6d7e2715c4a83:/teshsuite/simdag/platforms/flatifier.cpp diff --git a/teshsuite/simdag/platforms/flatifier.cpp b/teshsuite/simdag/platforms/flatifier.cpp index a2178440ec..581b75580f 100644 --- a/teshsuite/simdag/platforms/flatifier.cpp +++ b/teshsuite/simdag/platforms/flatifier.cpp @@ -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,7 +98,7 @@ 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(); @@ -127,8 +125,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 +136,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");