XBT_PUBLIC(double) SIMIX_req_host_execution_get_remains(smx_action_t execution);
XBT_PUBLIC(e_smx_state_t) SIMIX_req_host_execution_get_state(smx_action_t execution);
XBT_PUBLIC(void) SIMIX_req_host_execution_set_priority(smx_action_t execution, double priority);
+#ifdef HAVE_TRACING
+XBT_PUBLIC(void) SIMIX_req_host_execution_set_category(smx_action_t execution, const char *category);
+#endif
XBT_PUBLIC(void) SIMIX_req_host_execution_wait(smx_action_t execution);
int (*is_suspended) (surf_action_t action); /**< Return whether an action is suspended */
void (*set_max_duration) (surf_action_t action, double duration); /**< Set the max duration of an action*/
void (*set_priority) (surf_action_t action, double priority); /**< Set the priority of an action */
+#ifdef HAVE_TRACING
+ void (*set_category) (surf_action_t action, const char *category); /**< Set the category of an action */
+#endif
double (*get_remains) (surf_action_t action); /**< Get the remains of an action */
#ifdef HAVE_LATENCY_BOUND_TRACKING
int (*get_latency_limited) (surf_action_t action); /**< Return 1 if action is limited by latency, 0 otherwise */
TRACE_task_container(task, name, 200);
if (TRACE_msg_task_is_enabled())
pajePushState(MSG_get_clock(), "task-state", name, "execute");
-
- TRACE_category_set(SIMIX_process_self(), task->category);
}
void TRACE_msg_task_execute_end(m_task_t task)
if (TRACE_msg_task_is_enabled())
pajePopState(MSG_get_clock(), "task-state", name);
- TRACE_category_unset(SIMIX_process_self());
-
DEBUG3("EXEC,out %p, %lld, %s", task, task->counter, task->category);
}
SIMIX_req_host_execute(task->name, SIMIX_host_self(),
simdata->computation_amount);
SIMIX_req_host_execution_set_priority(simdata->compute, simdata->priority);
+#ifdef HAVE_TRACING
+ SIMIX_req_host_execution_set_category(simdata->compute, task->category);
+#endif
self->simdata->waiting_action = simdata->compute;
SIMIX_req_host_execution_wait(simdata->compute);
double SIMIX_host_execution_get_remains(smx_action_t action);
e_smx_state_t SIMIX_host_execution_get_state(smx_action_t action);
void SIMIX_host_execution_set_priority(smx_action_t action, double priority);
+#ifdef HAVE_TRACING
+void SIMIX_host_execution_set_category(smx_action_t action, const char *category);
+#endif
void SIMIX_pre_host_execution_wait(smx_req_t req);
void SIMIX_host_execution_suspend(smx_action_t action);
REQ_HOST_EXECUTION_GET_REMAINS,
REQ_HOST_EXECUTION_GET_STATE,
REQ_HOST_EXECUTION_SET_PRIORITY,
+#ifdef HAVE_TRACING
+ REQ_HOST_EXECUTION_SET_CATEGORY,
+#endif
REQ_HOST_EXECUTION_WAIT,
REQ_PROCESS_CREATE,
REQ_PROCESS_KILL,
double priority;
} host_execution_set_priority;
+#ifdef HAVE_TRACING
+ struct {
+ smx_action_t execution;
+ const char *category;
+ } host_execution_set_category;
+#endif
+
struct {
smx_action_t execution;
} host_execution_wait;
surf_workstation_model->set_priority(action->execution.surf_exec, priority);
}
+#ifdef HAVE_TRACING
+void SIMIX_host_execution_set_category(smx_action_t action, const char *category)
+{
+ surf_workstation_model->set_category(action->execution.surf_exec, category);
+}
+#endif
+
void SIMIX_pre_host_execution_wait(smx_req_t req)
{
smx_action_t action = req->host_execution_wait.execution;
SIMIX_request_answer(req);
break;
+#ifdef HAVE_TRACING
+ case REQ_HOST_EXECUTION_SET_CATEGORY:
+ SIMIX_host_execution_set_category(
+ req->host_execution_set_category.execution,
+ req->host_execution_set_category.category);
+ SIMIX_request_answer(req);
+ break;
+#endif
+
case REQ_HOST_EXECUTION_WAIT:
SIMIX_pre_host_execution_wait(req);
break;
SIMIX_request_push(&req);
}
+#ifdef HAVE_TRACING
+/**
+ * \brief Set the category of an execution action.
+ *
+ * This functions changes the priority only. It calls a surf function.
+ * \param execution The execution action
+ * \param priority The new priority
+ */
+void SIMIX_req_host_execution_set_category(smx_action_t execution, const char *category)
+{
+ s_smx_req_t req;
+
+ req.call = REQ_HOST_EXECUTION_SET_CATEGORY;
+ req.host_execution_set_category.execution = execution;
+ req.host_execution_set_category.category = xbt_strdup (category);
+ SIMIX_request_push(&req);
+}
+#endif
+
/**
* \brief Waits for the completion of an execution action.
*
XBT_OUT;
}
+#ifdef HAVE_TRACING
+static void cpu_action_set_category(surf_action_t action, const char *category)
+{
+ XBT_IN2("(%p,%s)", action, category);
+ action->category = xbt_strdup (category);
+ XBT_OUT;
+}
+#endif
+
static double cpu_action_get_remains(surf_action_t action)
{
XBT_IN1("(%p)", action);
surf_cpu_model->is_suspended = cpu_action_is_suspended;
surf_cpu_model->set_max_duration = cpu_action_set_max_duration;
surf_cpu_model->set_priority = cpu_action_set_priority;
+#ifdef HAVE_TRACING
+ surf_cpu_model->set_category = cpu_action_set_category;
+#endif
surf_cpu_model->get_remains = cpu_action_get_remains;
surf_cpu_model->extension.cpu.execute = cpu_execute;
XBT_OUT;
}
+#ifdef HAVE_TRACING
+static void cpu_im_action_set_category(surf_action_t action,
+ const char *category)
+{
+ XBT_IN2("(%p,%s)", action, category);
+ action->category = xbt_strdup (category);
+ XBT_OUT;
+}
+#endif
+
static double cpu_im_action_get_remains(surf_action_t action)
{
XBT_IN1("(%p)", action);
surf_cpu_model->is_suspended = cpu_im_action_is_suspended;
surf_cpu_model->set_max_duration = cpu_im_action_set_max_duration;
surf_cpu_model->set_priority = cpu_im_action_set_priority;
+#ifdef HAVE_TRACING
+ surf_cpu_model->set_category = cpu_im_action_set_category;
+#endif
surf_cpu_model->get_remains = cpu_im_action_get_remains;
surf_cpu_model->extension.cpu.execute = cpu_im_execute;
DIE_IMPOSSIBLE;
}
+#ifdef HAVE_TRACING
+static void ws_action_set_category(surf_action_t action, const char *category)
+{
+ if (action->model_type == surf_network_model)
+ surf_network_model->set_category(action, category);
+ else if (action->model_type == surf_cpu_model)
+ surf_cpu_model->set_category(action, category);
+ else
+ DIE_IMPOSSIBLE;
+}
+#endif
+
#ifdef HAVE_LATENCY_BOUND_TRACKING
static int ws_get_latency_limited(surf_action_t action)
{
surf_workstation_model->is_suspended = ws_action_is_suspended;
surf_workstation_model->set_max_duration = ws_action_set_max_duration;
surf_workstation_model->set_priority = ws_action_set_priority;
+#ifdef HAVE_TRACING
+ surf_workstation_model->set_category = ws_action_set_category;
+#endif
surf_workstation_model->get_remains = ws_action_get_remains;
#ifdef HAVE_LATENCY_BOUND_TRACKING
surf_workstation_model->get_latency_limited = ws_get_latency_limited;