XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files");
#undef CLEANUP
-#include <cgraph.h>
+
+#ifdef HAVE_CGRAPH_H
+ #include <graphviz/cgraph.h>
+#elif HAVE_AGRAPH_H
+ #include <graphviz/agraph.h>
+#endif
void dot_add_task(Agnode_t * dag_node);
void dot_add_input_dependencies(SD_task_t current_job, Agedge_t * edge);
SD_task_destroy(t);
}
+static void TRACE_sd_dotloader (SD_task_t task, const char *category)
+{
+ if (category){
+ if (strlen (category) != 0){
+ TRACE_category (category);
+ TRACE_sd_set_task_category (task, category);
+ }
+ }
+}
+
/** @brief loads a DOT file describing a DAG
*
* See http://www.graphviz.org/doc/info/lang.html
Agnode_t *dag_node = NULL;
for (dag_node = agfstnode(dag_dot); dag_node;
+ #ifdef HAVE_CGRAPH_H
dag_node = agnxtnode(dag_dot, dag_node)) {
- dot_add_task(dag_node);
+ #elif HAVE_AGRAPH_H
+ dag_node = agnxtnode(dag_node)) {
+ #endif
+
+ dot_add_task(dag_node);
}
agclose(dag_dot);
xbt_dict_free(&jobs);
if (current_job == NULL) {
current_job =
SD_task_create_comp_seq(name, (void *) performer, runtime);
+#ifdef HAVE_TRACING
+ TRACE_sd_dotloader (current_job, agget (dag_node, (char*)"category"));
+#endif
xbt_dict_set(jobs, name, current_job, NULL);
xbt_dynar_push(result, ¤t_job);
}
Agedge_t *e;
int count = 0;
- for (e = agfstin(dag_dot, dag_node); e; e = agnxtin(dag_dot, e)) {
- dot_add_input_dependencies(current_job, e);
- count++;
+
+ #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++;
}
if (count == 0 && current_job != root_task) {
SD_task_dependency_add(NULL, NULL, root_task, current_job);
}
count = 0;
- for (e = agfstout(dag_dot, dag_node); e; e = agnxtout(dag_dot, e)) {
+ #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
+
dot_add_output_dependencies(current_job, e);
count++;
}
file = xbt_dict_get_or_null(files, name);
if (file == NULL) {
file = SD_task_create_comm_e2e(name, NULL, size);
+#ifdef HAVE_TRACING
+ TRACE_sd_dotloader (file, agget (edge, (char*)"category"));
+#endif
xbt_dict_set(files, name, file, &dot_task_free);
} else {
if (SD_task_get_amount(file) != size) {
file = xbt_dict_get_or_null(files, name);
if (file == NULL) {
file = SD_task_create_comm_e2e(name, NULL, size);
+#ifdef HAVE_TRACING
+ TRACE_sd_dotloader (file, agget (edge, (char*)"category"));
+#endif
xbt_dict_set(files, name, file, &dot_task_free);
} else {
if (SD_task_get_amount(file) != size) {