Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #193 from Takishipp/signals
[simgrid.git] / src / surf / xml / surfxml_sax_cb.cpp
index b2513fd..72e5825 100644 (file)
@@ -66,6 +66,10 @@ void surf_parse_assert_netpoint(char* hostname, const char* pre, const char* pos
 
   std::vector<simgrid::kernel::routing::NetPoint*> list;
   simgrid::s4u::Engine::instance()->netpointList(&list);
+  std::sort(list.begin(), list.end(),
+      [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
+      return a->name() < b->name();
+  });
   bool first = true;
   for (auto np : list) {
     if (np->isNetZone())
@@ -1111,7 +1115,8 @@ void surf_parse_open(const char *file)
   xbt_free(dir);
 
   surf_file_to_parse = surf_fopen(file, "r");
-  xbt_assert(surf_file_to_parse != nullptr, "Unable to open '%s'\n", file);
+  if (surf_file_to_parse == nullptr)
+    xbt_die("Unable to open '%s'\n", file);
   surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, YY_BUF_SIZE);
   surf_parse__switch_to_buffer(surf_input_buffer);
   surf_parse_lineno = 1;