* free other objects than lmm_constraint. */
surf_model_t cpu_model = cpu->generic_resource.model;
lmm_constraint_free(cpu_model->model_private->maxmin_system, cpu->constraint);
+ {
+ unsigned long i;
+ for (i = 0; i < cpu->core; i++) {
+ void *cnst_id = cpu->constraint_core[i]->id;
+ lmm_constraint_free(cpu_model->model_private->maxmin_system, cpu->constraint_core[i]);
+ xbt_free(cnst_id);
+ }
+
+ xbt_free(cpu->constraint_core);
+ }
+
surf_resource_free(cpu);
/* Free the network resource of the VM. */
vm_ws->current_state = SURF_VM_STATE_RUNNING;
}
-
static double get_solved_value(surf_action_t cpu_action)
{
- int found = 0;
- /* NOTE: Do not use surf_workstation_model's maxmin_system. It is not used. */
- lmm_system_t pm_system = surf_cpu_model_pm->model_private->maxmin_system;
- lmm_variable_t var = NULL;
-
- xbt_swag_foreach(var, &pm_system->variable_set) {
- XBT_DEBUG("var id %p id_int %d double %f", var->id, var->id_int, var->value);
- if (var->id == cpu_action) {
- found = 1;
- break;
- }
- }
-
- if (found)
- return var->value;
+ lmm_variable_t var = ((surf_action_lmm_t) cpu_action)->variable;
- XBT_CRITICAL("bug: cannot found the solved variable of the action %p", cpu_action);
- DIE_IMPOSSIBLE;
- return -1; /* NOT REACHED */
+ return var->value;
}
-
-
/* In the real world, processes on the guest operating system will be somewhat
* degraded due to virtualization overhead. The total CPU share that these
* processes get is smaller than that of the VM process gets on a host
/* FIXME: 3. do we have to re-initialize our cpu_action object? */
-#if 1
+#if 0
/* iterate for all hosts including virtual machines */
xbt_lib_foreach(host_lib, cursor, key, ind_host) {
workstation_CLM03_t ws_clm03 = ind_host[SURF_WKS_LEVEL];
xbt_assert(ws->model->type == SURF_MODEL_TYPE_VM_WORKSTATION);
workstation_VM2013_t vm_ws = (workstation_VM2013_t) ws;
- XBT_INFO("%p bound %f", vm_ws->cpu_action, bound);
surf_action_set_bound(vm_ws->cpu_action, bound);
- get_bound(vm_ws->cpu_action);
}
// model->set_max_duration = ws_action_set_max_duration;
model->set_priority = ws_action_set_priority;
model->set_bound = ws_action_set_bound;
+ model->set_affinity = ws_action_set_affinity;
// #ifdef HAVE_TRACING
// model->set_category = ws_action_set_category;
// #endif