Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make the RemoteApp a field of the Exploration, and sanitize initialization
[simgrid.git] / src / dag / loaders.cpp
index 5a313317b0a13b8dfec24dab28ec88261013d121..c6d288db6b7215f62333fb926692b9b33cd96897 100644 (file)
@@ -72,8 +72,7 @@ static bool check_for_cycle(const std::vector<simgrid::s4u::ActivityPtr>& dag)
 
 static YY_BUFFER_STATE input_buffer;
 
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
 
 static std::vector<ActivityPtr> result;
 static std::map<std::string, ExecPtr, std::less<>> jobs;
@@ -110,10 +109,8 @@ std::vector<ActivityPtr> create_DAG_from_DAX(const std::string& filename)
    * Files not produced in the system are said to be produced by root task (top of DAG).
    * Files not consumed in the system are said to be consumed by end task (bottom of DAG).
    */
-  CommPtr file;
-
-  for (auto const& elm : files) {
-    file = elm.second;
+  for (auto const& [_, elm] : files) {
+    CommPtr file = elm;
     CommPtr newfile;
     if (file->dependencies_solved()) {
       for (auto const& it : file->get_successors()) {
@@ -185,7 +182,7 @@ std::vector<ActivityPtr> create_DAG_from_dot(const std::string& filename)
   FILE* in_file = fopen(filename.c_str(), "r");
   xbt_assert(in_file != nullptr, "Failed to open file: %s", filename.c_str());
 
-  Agraph_t* dag_dot = agread(in_file, NIL(Agdisc_t*));
+  Agraph_t* dag_dot = agread(in_file, nullptr);
 
   std::unordered_map<std::string, ActivityPtr> activities;
   std::vector<ActivityPtr> dag;
@@ -293,8 +290,7 @@ std::vector<ActivityPtr> create_DAG_from_dot(const std::string& filename)
           "Please install graphviz, graphviz-dev, and libgraphviz-dev (and erase CMakeCache.txt) before recompiling.");
 }
 #endif
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
 
 void STag_dax__adag()
 {