/* initialize them */
act->name = xbt_strdup(name);
act->source = sender;
-
+#ifdef HAVE_TRACING
+ act->category = NULL;
+#endif
act->surf_action =
surf_workstation_model->extension.workstation.communicate(sender->host,
/* initialize them */
act->source = host;
act->name = xbt_strdup(name);
+#ifdef HAVE_TRACING
+ act->category = NULL;
+#endif
/* set communication */
act->surf_action =
surf_workstation_model->action_data_set(act->surf_action, act);
DEBUG1("Create execute action %p", act);
+#ifdef HAVE_TRACING
+ TRACE_smx_action_execute (act);
+#endif
return act;
}
/* initialize them */
act->source = host;
act->name = xbt_strdup(name);
+#ifdef HAVE_TRACING
+ act->category = NULL;
+#endif
act->surf_action =
surf_workstation_model->extension.workstation.sleep(host->host, duration);
* This functions stops the execution of an action. It calls a surf functions.
* \param action The SIMIX action
*/
-void SIMIX_action_cancel(smx_action_t action)
+XBT_INLINE void SIMIX_action_cancel(smx_action_t action)
{
xbt_assert0((action != NULL), "Invalid parameter");
* \param action The SIMIX action
* \param priority The new priority
*/
-void SIMIX_action_set_priority(smx_action_t action, double priority)
+XBT_INLINE void SIMIX_action_set_priority(smx_action_t action, double priority)
{
xbt_assert0((action != NULL), "Invalid parameter");
return;
}
+/**
+ * \brief Resumes the execution of an action.
+ *
+ * This functions restarts the execution of an action. It just calls the right SURF function.
+ * \param action The SIMIX action
+ * \param priority The new priority
+ */
+XBT_INLINE void SIMIX_action_resume(smx_action_t action)
+{
+ xbt_assert0((action != NULL), "Invalid parameter");
+
+ surf_workstation_model->resume(action->surf_action);
+ return;
+}
+
+/**
+ * \brief Suspends the execution of an action.
+ *
+ * This functions suspends the execution of an action. It just calls the right SURF function.
+ * \param action The SIMIX action
+ * \param priority The new priority
+ */
+XBT_INLINE void SIMIX_action_suspend(smx_action_t action)
+{
+ xbt_assert0((action != NULL), "Invalid parameter");
+
+ surf_workstation_model->suspend(action->surf_action);
+ return;
+}
+
/**
* \brief Destroys an action
*
if (action->surf_action)
action->surf_action->model_type->action_unref(action->surf_action);
-
+#ifdef HAVE_TRACING
+ TRACE_smx_action_destroy (action);
+#endif
xbt_free(action);
return 1;
}
*
* \param action The SIMIX action
*/
-void SIMIX_action_use(smx_action_t action)
+XBT_INLINE void SIMIX_action_use(smx_action_t action)
{
XBT_IN3("(%p:'%s',%d)", action, action->name, action->refcount);
xbt_assert0((action != NULL), "Invalid parameter");
*
* \param action The SIMIX action
*/
-void SIMIX_action_release(smx_action_t action)
+XBT_INLINE void SIMIX_action_release(smx_action_t action)
{
xbt_assert0((action != NULL), "Invalid parameter");
*
* When the action terminates, the semaphore gets signaled automatically.
*/
-void SIMIX_register_action_to_semaphore(smx_action_t action, smx_sem_t sem) {
+XBT_INLINE void SIMIX_register_action_to_semaphore(smx_action_t action, smx_sem_t sem) {
DEBUG2("Register action %p to semaphore %p (and otherwise)", action, sem);
xbt_fifo_push(sem->actions, action);
*
* Destroys the "links" from the semaphore to this action.
*/
-void SIMIX_unregister_action_to_semaphore(smx_action_t action,
+XBT_INLINE void SIMIX_unregister_action_to_semaphore(smx_action_t action,
smx_sem_t sem)
{
xbt_fifo_remove_all(sem->actions, action);
* \param action The SIMIX action
* \return Remains cost
*/
-double SIMIX_action_get_remains(smx_action_t action)
+XBT_INLINE double SIMIX_action_get_remains(smx_action_t action)
{
xbt_assert0((action != NULL), "Invalid parameter");
return surf_workstation_model->get_remains(action->surf_action);
/* initialize them */
act->name = xbt_strdup(name);
+#ifdef HAVE_TRACING
+ act->category = NULL;
+#endif
/* set action */
return act;
}
-e_surf_action_state_t SIMIX_action_get_state(smx_action_t action)
+XBT_INLINE e_surf_action_state_t SIMIX_action_get_state(smx_action_t action)
{
xbt_assert0((action != NULL), "Invalid parameter");
return surf_workstation_model->action_state_get(action->surf_action);
DEBUG1("\t %p", cond);
}
-char *SIMIX_action_get_name(smx_action_t action)
+XBT_INLINE char *SIMIX_action_get_name(smx_action_t action)
{
xbt_assert0((action != NULL), "Invalid parameter");
return action->name;
}
/** @brief Change the name of the action. Warning, the string you provide is not strdup()ed */
-void SIMIX_action_set_name(smx_action_t action,char *name)
+XBT_INLINE void SIMIX_action_set_name(smx_action_t action,char *name)
{
+ xbt_free(action->name);
action->name = name;
}