Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Comment unused parameters.
[simgrid.git] / src / surf / cpu_cas01.cpp
index 0ea0217..dfbfd3e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2011. The SimGrid Team.
+/* Copyright (c) 2009-2011, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -43,8 +43,8 @@ void surf_cpu_model_init_Cas01()
 {
   char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");
 
-  if (surf_cpu_model_pm)
-    return;
+  xbt_assert(!surf_cpu_model_pm);
+  xbt_assert(!surf_cpu_model_vm);
 
   if (!strcmp(optim, "TI")) {
     surf_cpu_model_init_ti();
@@ -52,15 +52,19 @@ void surf_cpu_model_init_Cas01()
   }
 
   surf_cpu_model_pm = new CpuCas01Model();
+  surf_cpu_model_vm  = new CpuCas01Model();
+
   cpu_define_callbacks();
-  ModelPtr model = static_cast<ModelPtr>(surf_cpu_model_pm);
-  xbt_dynar_push(model_list, &model);
+  ModelPtr model_pm = static_cast<ModelPtr>(surf_cpu_model_pm);
+  ModelPtr model_vm = static_cast<ModelPtr>(surf_cpu_model_vm);
+  xbt_dynar_push(model_list, &model_pm);
+  xbt_dynar_push(model_list, &model_vm);
 }
 
 CpuCas01Model::CpuCas01Model() : CpuModel("cpu")
 {
-  ActionPtr action;
-  ActionLmmPtr actionlmm;
+  ActionPtr action = NULL;
+  ActionLmmPtr actionlmm = NULL;
 
   char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");
   int select = xbt_cfg_get_boolean(_sg_cfg_set, "cpu/maxmin_selective_update");
@@ -153,7 +157,7 @@ CpuCas01LmmPtr CpuCas01Model::createResource(const char *name, xbt_dynar_t power
   return (CpuCas01LmmPtr) xbt_lib_get_elm_or_null(host_lib, name);
 }
 
-double CpuCas01Model::shareResourcesFull(double now)
+double CpuCas01Model::shareResourcesFull(double /*now*/)
 {
   return Model::shareResourcesMaxMin(p_runningActionSet,
                              p_maxminSystem, lmm_solve);
@@ -459,7 +463,7 @@ double CpuCas01Lmm::getCurrentPowerPeak()
 double CpuCas01Lmm::getPowerPeakAt(int pstate_index)
 {
   xbt_dynar_t plist = p_powerPeakList;
-  xbt_assert((pstate_index <= xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
+  xbt_assert((pstate_index <= (int)xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
 
   return xbt_dynar_get_as(plist, pstate_index, double);
 }
@@ -472,7 +476,7 @@ int CpuCas01Lmm::getNbPstates()
 void CpuCas01Lmm::setPowerPeakAt(int pstate_index)
 {
   xbt_dynar_t plist = p_powerPeakList;
-  xbt_assert((pstate_index <= xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
+  xbt_assert((pstate_index <= (int)xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
 
   double new_power_peak = xbt_dynar_get_as(plist, pstate_index, double);
   m_pstate = pstate_index;