XBT_PUBLIC(e_smx_state_t) simcall_host_execution_get_state(smx_action_t execution);
XBT_PUBLIC(void) simcall_host_execution_set_priority(smx_action_t execution, double priority);
XBT_PUBLIC(void) simcall_host_execution_set_bound(smx_action_t execution, double bound);
+XBT_PUBLIC(void) simcall_host_execution_set_affinity(smx_action_t execution, smx_host_t host, unsigned long mask);
XBT_PUBLIC(e_smx_state_t) simcall_host_execution_wait(smx_action_t execution);
XBT_PUBLIC(void) simcall_host_get_params(smx_host_t vm, ws_params_t param);
XBT_PUBLIC(void) simcall_host_set_params(smx_host_t vm, ws_params_t param);
ws_model->set_bound(action->execution.surf_exec, bound);
}
+void SIMIX_pre_host_execution_set_affinity(smx_simcall_t simcall,
+ smx_action_t action, smx_host_t host, unsigned long mask){
+ SIMIX_host_execution_set_affinity(action, host, mask);
+}
+void SIMIX_host_execution_set_affinity(smx_action_t action, smx_host_t host, unsigned long mask){
+ surf_model_t ws_model = get_ws_model_from_action(action);
+
+ if(action->execution.surf_exec)
+ ws_model->set_affinity(action->execution.surf_exec, host, mask);
+}
+
void SIMIX_pre_host_execution_wait(smx_simcall_t simcall, smx_action_t action){
XBT_DEBUG("Wait for execution of action %p, state %d", action, (int)action->state);
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);
void SIMIX_host_execution_set_bound(smx_action_t action, double bound);
+void SIMIX_host_execution_set_affinity(smx_action_t action, smx_host_t host, unsigned long mask);
void SIMIX_pre_host_execution_wait(smx_simcall_t simcall, smx_action_t action);
// pre prototypes
e_smx_state_t SIMIX_pre_host_execution_get_state(smx_simcall_t, smx_action_t);
void SIMIX_pre_host_execution_set_priority(smx_simcall_t, smx_action_t, double);
void SIMIX_pre_host_execution_set_bound(smx_simcall_t simcall, smx_action_t action, double bound);
+void SIMIX_pre_host_execution_set_affinity(smx_simcall_t simcall, smx_action_t action, smx_host_t host, unsigned long mask);
void SIMIX_host_execution_suspend(smx_action_t action);
void SIMIX_host_execution_resume(smx_action_t action);
ACTION(SIMCALL_HOST_EXECUTION_GET_STATE, host_execution_get_state, WITH_ANSWER, TINT(result), TSPEC(execution, smx_action_t)) sep \
ACTION(SIMCALL_HOST_EXECUTION_SET_PRIORITY, host_execution_set_priority, WITH_ANSWER, TVOID(result), TSPEC(execution, smx_action_t), TDOUBLE(priority)) sep \
ACTION(SIMCALL_HOST_EXECUTION_SET_BOUND, host_execution_set_bound, WITHOUT_ANSWER, TVOID(result), TSPEC(execution, smx_action_t), TDOUBLE(bound)) sep \
+ACTION(SIMCALL_HOST_EXECUTION_SET_AFFINITY, host_execution_set_affinity, WITH_ANSWER, TVOID(result), TSPEC(execution, smx_action_t), TSPEC(ws, smx_host_t), TULONG(mask)) sep \
ACTION(SIMCALL_HOST_EXECUTION_WAIT, host_execution_wait, WITHOUT_ANSWER, TINT(result), TSPEC(execution, smx_action_t)) sep \
ACTION(SIMCALL_HOST_GET_PARAMS, host_get_params, WITHOUT_ANSWER, TVOID(result), TSPEC(ind_vm, smx_host_t), TSPEC(params, ws_params_t)) sep \
ACTION(SIMCALL_HOST_SET_PARAMS, host_set_params, WITHOUT_ANSWER, TVOID(result), TSPEC(ind_vm, smx_host_t), TSPEC(params, ws_params_t)) sep \
simcall_BODY_host_execution_set_bound(execution, bound);
}
+/**
+ * \ingroup simix_host_management
+ * \brief Changes the CPU affinity of an execution action.
+ *
+ * This functions changes the CPU affinity of an execution action. See taskset(1) on Linux.
+ * \param execution The execution action
+ * \param host Host
+ * \param mask Affinity mask
+ */
+void simcall_host_execution_set_affinity(smx_action_t execution, smx_host_t host, unsigned long mask)
+{
+ simcall_BODY_host_execution_set_affinity(execution, host, mask);
+}
+
/**
* \ingroup simix_host_management
* \brief Waits for the completion of an execution action and destroy it.