*
*
* 2.
- * Note that bound == 0 means no bound (i.e., unlimited).
+ * Note that bound == 0 means no bound (i.e., unlimited). But, if a host has
+ * multiple CPU cores, the CPU share of a computation task (or a VM) never
+ * exceeds the capacity of a CPU core.
*/
void MSG_vm_set_bound(msg_vm_t vm, double bound)
{
action->execution.surf_exec = ws_model->extension.workstation.execute(host, computation_amount);
ws_model->action_data_set(action->execution.surf_exec, action);
ws_model->set_priority(action->execution.surf_exec, priority);
- ws_model->set_bound(action->execution.surf_exec, bound);
+
+ /* Note (hypervisor): for multicore, the bound value being passed to the
+ * surf layer should not be zero (i.e., unlimited). It should be the
+ * capacity of a CPU core. */
+ if (bound == 0)
+ ws_model->set_bound(action->execution.surf_exec, SIMIX_host_get_speed(host));
+ else
+ ws_model->set_bound(action->execution.surf_exec, bound);
}
XBT_DEBUG("Create execute action %p", action);
GENERIC_LMM_ACTION(action).suspended = 0; /* Should be useless because of the
calloc but it seems to help valgrind... */
+ /* Note (hypervisor): here, the bound value of the variable is set to the
+ * capacity of a CPU core. But, after MSG_{task/vm}_set_bound() were added to
+ * the hypervisor branch, this bound value is overwritten in
+ * SIMIX_host_execute().
+ * TODO: cleanup this.
+ */
GENERIC_LMM_ACTION(action).variable =
lmm_variable_new(cpu_model->model_private->maxmin_system, action,
GENERIC_ACTION(action).priority,