From 661875a3cf8631bf02abe783b948fb8c0230b67f Mon Sep 17 00:00:00 2001 From: Takahiro Hirofuchi Date: Tue, 29 Oct 2013 16:24:44 +0100 Subject: [PATCH] Add comments and disable verbose outputs --- src/msg/msg_task.c | 11 +++++++++++ src/surf/cpu_cas01.c | 12 +++++------- src/surf/maxmin.c | 7 ++----- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/msg/msg_task.c b/src/msg/msg_task.c index d751912436..7a177de304 100644 --- a/src/msg/msg_task.c +++ b/src/msg/msg_task.c @@ -477,6 +477,17 @@ void MSG_task_set_bound(msg_task_t task, double bound) * \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) { diff --git a/src/surf/cpu_cas01.c b/src/surf/cpu_cas01.c index 340fae2dfe..aa3379993a 100644 --- a/src/surf/cpu_cas01.c +++ b/src/surf/cpu_cas01.c @@ -200,8 +200,7 @@ static void cpu_update_resource_state(void *id, 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, @@ -223,8 +222,7 @@ static void cpu_update_resource_state(void *id, 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; @@ -308,7 +306,7 @@ static void cpu_action_set_affinity(surf_action_t action, void *cpu, unsigned lo 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; @@ -322,13 +320,13 @@ static void cpu_action_set_affinity(surf_action_t action, void *cpu, unsigned lo * 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(); diff --git a/src/surf/maxmin.c b/src/surf/maxmin.c index a8c1e0a096..052b38295a 100644 --- a/src/surf/maxmin.c +++ b/src/surf/maxmin.c @@ -301,13 +301,13 @@ void lmm_shrink(lmm_system_t sys, lmm_constraint_t cnst, } 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); @@ -340,9 +340,6 @@ void lmm_shrink(lmm_system_t sys, lmm_constraint_t cnst, if (xbt_swag_size(&(cnst->element_set)) == 0) make_constraint_inactive(sys, cnst); - - - } void lmm_expand(lmm_system_t sys, lmm_constraint_t cnst, -- 2.20.1