* \param host the host having a multi-core CPU
* \param mask the value specifying the CPU affinity setting of the task
*
+ *
+ * Note:
+ * 1. The current code does not allow an affinity of a task to multiple cores.
+ * The mask value 0x03 (i.e., a given task will be executed on the first core
+ * or the second core) is not allowed. The mask value 0x01 or 0x02 works. See
+ * cpu_cas01.c for details.
+ *
+ * 2. It is recommended to first compare simulation results in both the Lazy
+ * and Full calculation modes (using --cfg=cpu/optim:Full or not). Fix
+ * cpu_cas01.c if you find wrong results in the Lazy mode.
+ *
*/
void MSG_task_set_affinity(msg_task_t task, msg_host_t host, unsigned long mask)
{
if (event_type == cpu->power_event) {
/* TODO (Hypervisor): do the same thing for constraint_core[i] */
- XBT_CRITICAL("FIXME: add power scaling code also for constraint_core[i]");
- xbt_abort();
+ xbt_assert(cpu->core == 1, "FIXME: add power scaling code also for constraint_core[i]");
cpu->power_scale = value;
lmm_update_constraint_bound(cpu_model->model_private->maxmin_system, cpu->constraint,
cpu->power_event = NULL;
} else if (event_type == cpu->state_event) {
/* TODO (Hypervisor): do the same thing for constraint_core[i] */
- XBT_CRITICAL("FIXME: add state change code also for constraint_core[i]");
- xbt_abort();
+ xbt_assert(cpu->core == 1, "FIXME: add state change code also for constraint_core[i]");
if (value > 0)
cpu->state_current = SURF_RESOURCE_ON;
unsigned long i;
for (i = 0; i < CPU->core; i++) {
- XBT_INFO("clear affinity %p to cpu-%lu@%s", action, i, CPU->generic_resource.name);
+ XBT_DEBUG("clear affinity %p to cpu-%lu@%s", action, i, CPU->generic_resource.name);
lmm_shrink(cpu_model->model_private->maxmin_system, CPU->constraint_core[i], var_obj);
unsigned long has_affinity = (1UL << i) & mask;
* accept affinity settings on a future host. We might be able to assign
* zero to elem->value to maintain such inactive affinity settings in the
* system. But, this will make the system complex. */
- XBT_INFO("set affinity %p to cpu-%lu@%s", action, i, CPU->generic_resource.name);
+ XBT_DEBUG("set affinity %p to cpu-%lu@%s", action, i, CPU->generic_resource.name);
lmm_expand(cpu_model->model_private->maxmin_system, CPU->constraint_core[i], var_obj, 1.0);
}
}
if (cpu_model->model_private->update_mechanism == UM_LAZY) {
- XBT_WARN("FIXME (hypervisor): Do we need to do something for the LAZY mode?");
+ /* FIXME (hypervisor): Do we need to do something for the LAZY mode? */
}
XBT_OUT();
}
if (!found) {
- // XBT_WARN("cnst %p is not found in var %p", cnst, var);
+ XBT_DEBUG("cnst %p is not found in var %p", cnst, var);
return;
}
sys->modified = 1;
- XBT_INFO("remove elem(value %lf, cnst %p, var %p) in var %p",
+ XBT_DEBUG("remove elem(value %lf, cnst %p, var %p) in var %p",
elem->value, elem->constraint, elem->variable, var);
if (xbt_swag_size(&(cnst->element_set)) == 0)
make_constraint_inactive(sys, cnst);
-
-
-
}
void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst,