\li \c TRACE_category_with_color(const char *category, const char *color)
\li \c MSG_task_set_category(m_task_t task, const char *category)
\li \c MSG_task_get_category(m_task_t task)
-
-\li <b>\c TRACE_sd_set_task_category (SD_task_t task, const char *category)</b>:
-This function should be called after the creation of a SimDAG task, to define the
-category of that task. The first parameter \c task must contain a task that was
-created with the function \c MSG_task_create. The second parameter
-\c category must contain a category that was previously defined by the function
-\c TRACE_category.
+\li \c SD_task_set_category(SD_task_t task, const char *category)
+\li \c SD_task_get_category(SD_task_t task)
\subsection instr_mark_functions Tracing marks functions
\li \c TRACE_declare_mark(const char *mark_type)
TRACE_category ("taskA");
TRACE_category ("taskB");
TRACE_category ("taskC");
- TRACE_sd_set_task_category (taskA, "taskA");
- TRACE_sd_set_task_category (taskB, "taskB");
- TRACE_sd_set_task_category (taskC, "taskC");
+ SD_task_set_category (taskA, "taskA");
+ SD_task_set_category (taskB, "taskB");
+ SD_task_set_category (taskC, "taskC");
/* if everything is ok, no exception is forwarded or rethrown by main() */
XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count,
const SD_workstation_t * list);
XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
+XBT_PUBLIC(void) SD_task_set_category (SD_task_t task, const char *category);
+XBT_PUBLIC(const char *) SD_task_get_category (SD_task_t task);
+
/** @brief A constant to use in SD_task_schedule to mean that there is no cost.
*
const char *category = depafter->src->category;
if (category){
TRACE_category (category);
- TRACE_sd_set_task_category (newfile, category);
+ SD_task_set_category (newfile, category);
}
}
#endif
const char *category = depbefore->src->category;
if (category){
TRACE_category (category);
- TRACE_sd_set_task_category (newfile, category);
+ SD_task_set_category (newfile, category);
}
}
#endif
const char *category = depbefore->src->category;
if (category){
TRACE_category (category);
- TRACE_sd_set_task_category (newfile, category);
+ SD_task_set_category (newfile, category);
}
}
#endif
char *category = A_dax__job_name;
if (category){
TRACE_category (category);
- TRACE_sd_set_task_category(current_job, category);
+ SD_task_set_category(current_job, category);
}
#endif
xbt_dict_set(jobs, A_dax__job_id, current_job, NULL);
if (category){
if (strlen (category) != 0){
TRACE_category (category);
- TRACE_sd_set_task_category (task, category);
+ SD_task_set_category (task, category);
}
}
}
SD_task_schedulev(task, count, list);
free(list);
}
+
+/**
+ * \brief Sets the tracing category of a task.
+ *
+ * This function should be called after the creation of a
+ * SimDAG task, to define the category of that task. The first
+ * parameter must contain a task that was created with the
+ * function #SD_task_create. The second parameter must contain
+ * a category that was previously declared with the function
+ * #TRACE_category.
+ *
+ * \param task The task to be considered
+ * \param category the name of the category to be associated to the task
+ *
+ * \see SD_task_get_category, TRACE_category, TRACE_category_with_color
+ */
+void SD_task_set_category (SD_task_t task, const char *category)
+{
+#ifdef HAVE_TRACING
+ TRACE_sd_set_task_category (task, category);
+#endif
+}
+
+/**
+ * \brief Gets the current tracing category of a task.
+ *
+ * \param task The task to be considered
+ *
+ * \see SD_task_set_category
+ *
+ * \return Returns the name of the tracing category of the given task, NULL otherwise
+ */
+const char *SD_task_get_category (SD_task_t task)
+{
+#ifdef HAVE_TRACING
+ return task->category;
+#else
+ return NULL;
+#endif
+}