#include <graphviz/cgraph.h>
#elif HAVE_AGRAPH_H
#include <graphviz/agraph.h>
+#define agnxtnode(dot, node) agnxtnode(node)
+#define agfstin(dot, node) agfstin(node)
+#define agnxtin(dot, edge) agnxtin(edge)
+#define agfstout(dot, node) agfstout(node)
+#define agnxtout(dot, edge) agnxtout(edge)
#endif
void dot_add_task(Agnode_t * dag_node);
static double dot_parse_double(const char *string)
{
- if (string == NULL)
- return -1;
- double value = -1;
- char *err;
-
- //ret = sscanf(string, "%lg", &value);
- errno = 0;
- value = strtod(string,&err);
- if(errno)
- {
- XBT_WARN("Failed to convert string to double: %s\n",strerror(errno));
- return -1;
- }
- return value;
+ if (string == NULL)
+ return -1;
+ double value = -1;
+ char *err;
+
+ //ret = sscanf(string, "%lg", &value);
+ errno = 0;
+ value = strtod(string,&err);
+ if(errno)
+ {
+ XBT_WARN("Failed to convert string to double: %s\n",strerror(errno));
+ return -1;
+ }
+ return value;
}
xbt_dict_set(jobs, "end", end_task, NULL);
Agnode_t *dag_node = NULL;
- for (dag_node = agfstnode(dag_dot); dag_node;
-#ifdef HAVE_CGRAPH_H
- dag_node = agnxtnode(dag_dot, dag_node)
-#elif HAVE_AGRAPH_H
- dag_node = agnxtnode(dag_node)
-#endif
- ) {
-
- dot_add_task(dag_node);
+ for (dag_node = agfstnode(dag_dot); dag_node; dag_node = agnxtnode(dag_dot, dag_node)) {
+ dot_add_task(dag_node);
}
agclose(dag_dot);
xbt_dict_free(&jobs);
SD_task_destroy(file);
xbt_dynar_free_container(&result);
}
- free(dag_dot);
return NULL;
}
Agedge_t *e;
int count = 0;
-#ifdef HAVE_CGRAPH_H
- for (e = agfstin(dag_dot, dag_node); e; e = agnxtin(dag_dot, e))
-#elif HAVE_AGRAPH_H
- for (e = agfstin(dag_node); e; e = agnxtin(e))
-#endif
- {
- dot_add_input_dependencies(current_job, e);
- count++;
+ for (e = agfstin(dag_dot, dag_node); e; e = agnxtin(dag_dot, e)) {
+ dot_add_input_dependencies(current_job, e);
+ count++;
}
if (count == 0 && current_job != root_task) {
SD_task_dependency_add(NULL, NULL, root_task, current_job);
}
count = 0;
-#ifdef HAVE_CGRAPH_H
- for (e = agfstout(dag_dot, dag_node); e; e = agnxtout(dag_dot, e))
-#elif HAVE_AGRAPH_H
- for (e = agfstout(dag_node); e; e = agnxtout(e))
-#endif
- {
-
+ for (e = agfstout(dag_dot, dag_node); e; e = agnxtout(dag_dot, e)) {
dot_add_output_dependencies(current_job, e);
count++;
}