+
+/** \ingroup m_task_management
+ * \brief Cancel a #m_task_t.
+ * \param task the taskt to cancel. If it was executed or transfered, it
+ stops the process that were working on it.
+ */
+MSG_error_t MSG_task_cancel(m_task_t task)
+{
+ xbt_assert0((task != NULL), "Invalid parameter");
+
+ if(task->simdata->compute) {
+ surf_workstation_resource->common_public->action_cancel(task->simdata->compute);
+ return MSG_OK;
+ }
+ if(task->simdata->comm) {
+ surf_workstation_resource->common_public->action_cancel(task->simdata->comm);
+ return MSG_OK;
+ }
+
+ return MSG_FATAL;
+}
+