returns the currently executed task in the SD_SEQUENTIAL_ACCESSED_MODE
Then it's easy to get the kind of this task with SD_task_get_kind
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7734
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
double
communication_amount);
+XBT_PUBLIC(SD_task_t) SD_workstation_get_current_task (SD_workstation_t workstation);
/** @} */
/************************** Task handling ************************************/
}
xbt_free(w);
}
+
+/**
+ * \brief Returns the kind of the task currently running on a workstation
+ * Only call this with sequential access mode set
+ * \param workstation a workstation */
+SD_task_t SD_workstation_get_current_task(SD_workstation_t workstation)
+{
+ SD_CHECK_INIT_DONE();
+ xbt_assert0(workstation != NULL, "Invalid parameter");
+ xbt_assert0(workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS,
+ "Access mode must be set to SD_WORKSTATION_SEQUENTIAL_ACCESS"
+ " to use this function");
+
+ return (workstation->current_task);
+}