Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add comments and disable verbose outputs
authorTakahiro Hirofuchi <t.hirofuchi+sg@aist.go.jp>
Tue, 29 Oct 2013 15:24:44 +0000 (16:24 +0100)
committerTakahiro Hirofuchi <t.hirofuchi+sg@aist.go.jp>
Tue, 29 Oct 2013 15:24:44 +0000 (16:24 +0100)
src/msg/msg_task.c
src/surf/cpu_cas01.c
src/surf/maxmin.c

index d751912..7a177de 100644 (file)
@@ -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)
 {
index 340fae2..aa33799 100644 (file)
@@ -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();
index a8c1e0a..052b382 100644 (file)
@@ -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,