X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b757886241c3fc8c055842b3cf7fef7494031d7..0748addf6f2e71e61e6ae97e7da38fc82143e558:/src/simix/smx_action.c diff --git a/src/simix/smx_action.c b/src/simix/smx_action.c index ab885c7f47..b4a3b67921 100644 --- a/src/simix/smx_action.c +++ b/src/simix/smx_action.c @@ -50,7 +50,9 @@ smx_action_t SIMIX_action_communicate(smx_host_t sender, /* 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, @@ -90,6 +92,9 @@ smx_action_t SIMIX_action_execute(smx_host_t host, const char *name, /* initialize them */ act->source = host; act->name = xbt_strdup(name); +#ifdef HAVE_TRACING + act->category = NULL; +#endif /* set communication */ act->surf_action = @@ -98,6 +103,9 @@ smx_action_t SIMIX_action_execute(smx_host_t host, const char *name, 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; } @@ -131,6 +139,9 @@ smx_action_t SIMIX_action_sleep(smx_host_t host, double duration) /* 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); @@ -173,6 +184,36 @@ XBT_INLINE void SIMIX_action_set_priority(smx_action_t action, double priority) 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 * @@ -205,7 +246,9 @@ int SIMIX_action_destroy(smx_action_t 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; } @@ -350,6 +393,9 @@ smx_action_t SIMIX_action_parallel_execute(char *name, int host_nb, /* initialize them */ act->name = xbt_strdup(name); +#ifdef HAVE_TRACING + act->category = NULL; +#endif /* set action */