Algorithmique Numérique Distribuée Public GIT Repository
 author Martin Quinson Tue, 26 Jul 2016 21:37:47 +0000 (23:37 +0200) committer Martin Quinson Tue, 26 Jul 2016 21:37:47 +0000 (23:37 +0200)

index 44c32f9..6dfe768 100644 (file)
}

-    if ((*it)->marked == 0)
+    if (it->marked == 0)
return false;
if ((*it)->marked == 0)
return false;
return true;
}

-    if ((*it)->marked == 0)
+    if (it->marked == 0)
return false;
-    if ((*it)->marked == 0)
+    if (it->marked == 0)
return false;
return true;
}
@@ -77,16 +77,16 @@ bool acyclic_graph_detail(xbt_dynar_t dag){
continue;
-        (*it)->marked = 1;
+        it->marked = 1;
// Inputs are communication, hence they can have only one predecessor
if (children_are_marked(input_pred))
xbt_dynar_push(next, &input_pred);
}
-        if (children_are_marked(*it))
-          xbt_dynar_push(next, &(*it));
+        if (children_are_marked(it))
+          xbt_dynar_push(next, &it);
}
}
xbt_dynar_free(&current);
@@ -134,16 +134,16 @@ bool acyclic_graph_detail(xbt_dynar_t dag){
continue;
-          (*it)->marked = 1;
+          it->marked = 1;
// outputs are communication, hence they can have only one successor
if (parents_are_marked(output_succ))
xbt_dynar_push(next, &output_succ);
}
-          if (parents_are_marked(*it))
-            xbt_dynar_push(next, &(*it));
+          if (parents_are_marked(it))
+            xbt_dynar_push(next, &it);
}
xbt_dynar_free(&current);
current = next;
@@ -221,29 +221,29 @@ xbt_dynar_t SD_daxload(const char *filename)
xbt_dict_foreach(files, cursor, name, file) {
if (file->predecessors->empty()) {
-      for (std::set<SD_task_t>::iterator it=file->successors->begin(); it!=file->successors->end(); ++it){
+      for (SD_task_t it : *file->successors) {
xbt_dynar_push(result, &newfile);
}
} else if (file->successors->empty()) {
-      for (std::set<SD_task_t>::iterator it=file->predecessors->begin(); it!=file->predecessors->end(); ++it){
+      for (SD_task_t it : *file->predecessors){
xbt_dynar_push(result, &newfile);
}
} else {
-      for (std::set<SD_task_t>::iterator it=file->predecessors->begin(); it!=file->predecessors->end(); ++it){
-        for (std::set<SD_task_t>::iterator it2=file->successors->begin(); it2!=file->successors->end(); ++it2){
-          if (*it == *it2) {
+      for (SD_task_t it : *file->predecessors) {
+        for (SD_task_t it2 : *file->successors) {
+          if (it == it2) {
XBT_WARN ("File %s is produced and consumed by task %s."
-                      "This loop dependency will prevent the execution of the task.", file->name, (*it)->name);
+                      "This loop dependency will prevent the execution of the task.", file->name, it->name);
}
xbt_dynar_push(result, &newfile);
}
}
index 4f55b83..66f3c61 100644 (file)
@@ -150,39 +150,39 @@ xbt_dynar_t SD_simulate(double how_long) {

/* remove the dependencies after this task */
-          XBT_DEBUG("Release dependency on %s: %zu remain(s). Becomes schedulable if %zu=0", SD_task_get_name((*succ)),
-              (*succ)->predecessors->size()+(*succ)->inputs->size(), (*succ)->predecessors->size());
+        for (auto succ : *task->successors) {
+          XBT_DEBUG("Release dependency on %s: %zu remain(s). Becomes schedulable if %zu=0", SD_task_get_name(succ),
+              succ->predecessors->size()+succ->inputs->size(), succ->predecessors->size());

-          if (SD_task_get_state((*succ)) == SD_NOT_SCHEDULED && (*succ)->predecessors->empty())
+          if (SD_task_get_state(succ) == SD_NOT_SCHEDULED && succ->predecessors->empty())

-          if (SD_task_get_state((*succ)) == SD_SCHEDULED && (*succ)->predecessors->empty() && (*succ)->inputs->empty())
+          if (SD_task_get_state(succ) == SD_SCHEDULED && succ->predecessors->empty() && succ->inputs->empty())

-          if (SD_task_get_state((*succ)) == SD_RUNNABLE && !sd_global->watch_point_reached)
+          if (SD_task_get_state(succ) == SD_RUNNABLE && !sd_global->watch_point_reached)
}

+        for (auto output : *task->outputs) {
else

if (SD_task_get_state(comm_dst) == SD_NOT_SCHEDULED && comm_dst->predecessors->empty()){
XBT_DEBUG("%s is a transfer, %s may be ready now if %zu=0",
}
-          if (SD_task_get_state(*output) == SD_RUNNABLE && !sd_global->watch_point_reached)
+          if (SD_task_get_state(output) == SD_RUNNABLE && !sd_global->watch_point_reached)
}