Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #190 from Takishipp/clean_events
[simgrid.git] / teshsuite / simdag / flatifier / flatifier.cpp
index 5baf868..7810dd2 100644 (file)
@@ -13,6 +13,7 @@
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
 
+#include <algorithm>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(flatifier, "Logging specific to this platform parsing tool");
 
@@ -31,7 +32,7 @@ static bool parse_cmdline(int* timings, char** platformFile, int argc, char** ar
   bool parse_ok = true;
   for (int i = 1; i < argc; i++) {
     if (std::strlen(argv[i]) > 1 && argv[i][0] == '-' && argv[i][1] == '-') {
-      if (!std::strcmp(argv[i], "--timings")) {
+      if (not std::strcmp(argv[i], "--timings")) {
         *timings = 1;
       } else {
         parse_ok = false;
@@ -61,7 +62,8 @@ static void dump_platform()
   int version = 4;
   xbt_dict_t props = nullptr;
   xbt_dict_cursor_t cursor = nullptr;
-  char *key, *data;
+  char* key;
+  char* data;
 
   std::printf("<?xml version='1.0'?>\n");
   std::printf("<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">\n");
@@ -79,7 +81,7 @@ static void dump_platform()
     if (hosts[i]->coreCount() > 1) {
       std::printf(" core=\"%d\"", hosts[i]->coreCount());
     }
-    if (props && !xbt_dict_is_empty(props)) {
+    if (props && not xbt_dict_is_empty(props)) {
       std::printf(">\n");
       xbt_dict_foreach (props, cursor, key, data) {
         std::printf("    <prop id=\"%s\" value=\"%s\"/>\n", key, data);
@@ -128,7 +130,7 @@ static void dump_platform()
       std::vector<simgrid::surf::LinkImpl*> route;
       simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
       simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, &route, nullptr);
-      if (!route.empty()) {
+      if (not route.empty()) {
         std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", host1->cname(), host2->cname());
         for (auto link : route)
           std::printf("<link_ctn id=\"%s\"/>", link->cname());
@@ -201,7 +203,6 @@ int main(int argc, char** argv)
     dump_platform();
   }
 
-  SD_exit();
   xbt_os_timer_free(parse_time);
 
   return 0;