Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename a global to make its purpose clear (hopefully)
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 22 Nov 2015 21:57:06 +0000 (22:57 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 22 Nov 2015 21:57:06 +0000 (22:57 +0100)
19 files changed:
src/bindings/java/surf_swig.cpp
src/include/surf/surf.h
src/simdag/sd_global.c
src/simix/smx_global.c
src/surf/cpu_cas01.cpp
src/surf/cpu_ti.cpp
src/surf/host_clm03.cpp
src/surf/host_ptask_L07.cpp
src/surf/network_cm02.cpp
src/surf/network_constant.cpp
src/surf/network_ib.cpp
src/surf/network_ns3.cpp
src/surf/network_smpi.cpp
src/surf/storage_n11.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp
src/surf/vm_hl13.cpp
teshsuite/surf/surf_usage/surf_usage2.c

index 69d0acf..878f249 100644 (file)
@@ -24,7 +24,7 @@ CpuModel *getCpuModel(){
 CpuModel *java_cpu_model;
 static void java_cpu_model_init_preparse() {
   surf_cpu_model_pm = java_cpu_model;
-  xbt_dynar_push(model_list, &java_cpu_model);
+  xbt_dynar_push(all_existing_models, &java_cpu_model);
   xbt_dynar_push(model_list_invoke, &java_cpu_model);
   sg_platf_host_add_cb(cpu_parse_init);
 }
index 939f8bc..182a93c 100644 (file)
@@ -1036,7 +1036,7 @@ XBT_PUBLIC_DATA(s_surf_model_description_t)
 /** \ingroup SURF_models
  *  \brief List of initialized models
  */
-XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
+XBT_PUBLIC_DATA(xbt_dynar_t) all_existing_models;
 XBT_PUBLIC_DATA(xbt_dynar_t) model_list_invoke;
 
 /** \ingroup SURF_simulation
index 836b0e9..e5f97a0 100644 (file)
@@ -297,9 +297,8 @@ xbt_swag_t SD_simulate_swag(double how_long) {
     if (elapsed_time > 0.0)
       total_time += elapsed_time;
 
-    /* FIXME: shoud look at model_list or model_list_invoke? */
     /* let's see which tasks are done */
-    xbt_dynar_foreach(model_list, iter, model) {
+    xbt_dynar_foreach(all_existing_models, iter, model) {
       while ((action = surf_model_extract_done_action_set(model))) {
         task = surf_action_get_data(action);
         task->start_time = surf_action_get_start_time(task->surf_action);
index 0404d17..677f9d5 100644 (file)
@@ -433,7 +433,7 @@ void SIMIX_run(void)
         }
       }
       /* Wake up all processes waiting for a Surf action to finish */
-      xbt_dynar_foreach(model_list, iter, model) {
+      xbt_dynar_foreach(all_existing_models, iter, model) {
         XBT_DEBUG("Handling process whose action failed");
         while ((action = surf_model_extract_failed_action_set(model))) {
           XBT_DEBUG("   Handling Action %p",action);
@@ -471,7 +471,7 @@ void SIMIX_run(void)
     }
 
     /* Wake up all processes waiting for a Surf action to finish */
-    xbt_dynar_foreach(model_list, iter, model) {
+    xbt_dynar_foreach(all_existing_models, iter, model) {
       XBT_DEBUG("Handling process whose action failed");
       while ((action = surf_model_extract_failed_action_set(model))) {
         XBT_DEBUG("   Handling Action %p",action);
index de2d9a5..fde93bc 100644 (file)
@@ -35,8 +35,8 @@ void surf_cpu_model_init_Cas01()
 
   Model *model_pm = surf_cpu_model_pm;
   Model *model_vm = surf_cpu_model_vm;
-  xbt_dynar_push(model_list, &model_pm);
-  xbt_dynar_push(model_list, &model_vm);
+  xbt_dynar_push(all_existing_models, &model_pm);
+  xbt_dynar_push(all_existing_models, &model_vm);
 }
 
 CpuCas01Model::CpuCas01Model() : CpuModel()
index 00346bf..fba3eac 100644 (file)
@@ -400,8 +400,8 @@ void surf_cpu_model_init_ti()
   cpu_ti_define_callbacks();
   Model *model_pm = static_cast<Model*>(surf_cpu_model_pm);
   Model *model_vm = static_cast<Model*>(surf_cpu_model_vm);
-  xbt_dynar_push(model_list, &model_pm);
-  xbt_dynar_push(model_list, &model_vm);
+  xbt_dynar_push(all_existing_models, &model_pm);
+  xbt_dynar_push(all_existing_models, &model_vm);
 }
 
 CpuTiModel::CpuTiModel() : CpuModel()
index e4d4957..e18f042 100644 (file)
@@ -28,7 +28,7 @@ void surf_host_model_init_current_default(void)
   surf_network_model_init_LegrandVelho();
 
   Model *model = surf_host_model;
-  xbt_dynar_push(model_list, &model);
+  xbt_dynar_push(all_existing_models, &model);
   xbt_dynar_push(model_list_invoke, &model);
   sg_platf_host_add_cb(host_parse_init);
 }
@@ -41,7 +41,7 @@ void surf_host_model_init_compound()
   surf_host_model = new HostCLM03Model();
 
   Model *model = surf_host_model;
-  xbt_dynar_push(model_list, &model);
+  xbt_dynar_push(all_existing_models, &model);
   xbt_dynar_push(model_list_invoke, &model);
   sg_platf_host_add_cb(host_parse_init);
 }
index 5dca166..390f3c3 100644 (file)
@@ -41,7 +41,7 @@ void surf_host_model_init_ptask_L07(void)
 
   surf_host_model = new HostL07Model();
   Model *model = surf_host_model;
-  xbt_dynar_push(model_list, &model);
+  xbt_dynar_push(all_existing_models, &model);
   xbt_dynar_push(model_list_invoke, &model);
 }
 
index 21f8106..c5c242b 100644 (file)
@@ -55,7 +55,7 @@ void surf_network_model_init_LegrandVelho(void)
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
   Model *model = surf_network_model;
-  xbt_dynar_push(model_list, &model);
+  xbt_dynar_push(all_existing_models, &model);
 
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor",
                             13.01);
@@ -84,7 +84,7 @@ void surf_network_model_init_CM02(void)
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
   Model *model = surf_network_model;
-  xbt_dynar_push(model_list, &model);
+  xbt_dynar_push(all_existing_models, &model);
 
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor",
@@ -110,7 +110,7 @@ void surf_network_model_init_Reno(void)
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
   Model *model = surf_network_model;
-  xbt_dynar_push(model_list, &model);
+  xbt_dynar_push(all_existing_models, &model);
   lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
                                     func_reno_fpi);
   surf_network_model->f_networkSolve = lagrange_solve;
@@ -130,7 +130,7 @@ void surf_network_model_init_Reno2(void)
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
   Model *model = surf_network_model;
-  xbt_dynar_push(model_list, &model);
+  xbt_dynar_push(all_existing_models, &model);
   lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
                                     func_reno2_fpi);
   surf_network_model->f_networkSolve = lagrange_solve;
@@ -150,7 +150,7 @@ void surf_network_model_init_Vegas(void)
   surf_network_model = new NetworkCm02Model();
   net_define_callbacks();
   Model *model = surf_network_model;
-  xbt_dynar_push(model_list, &model);
+  xbt_dynar_push(all_existing_models, &model);
   lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
                                     func_vegas_fpi);
   surf_network_model->f_networkSolve = lagrange_solve;
index 3421c67..609b2de 100644 (file)
@@ -32,7 +32,7 @@ void surf_network_model_init_Constant()
   sg_platf_link_add_cb(netcste_parse_nolink);
 
   Model *model = surf_network_model;
-  xbt_dynar_push(model_list, &model);
+  xbt_dynar_push(all_existing_models, &model);
 }
 
 double NetworkConstantModel::shareResources(double /*now*/)
index a2e52ff..65a501c 100644 (file)
@@ -82,7 +82,7 @@ void surf_network_model_init_IB(void)
     return;
   surf_network_model = new NetworkIBModel();
   net_define_callbacks();
-  xbt_dynar_push(model_list, &surf_network_model);
+  xbt_dynar_push(all_existing_models, &surf_network_model);
   surf_callback_connect(networkActionStateChangedCallbacks, IB_action_state_changed_callback);
   surf_callback_connect(networkCommunicateCallbacks, IB_action_init_callback);
 
index dd70811..8eab114 100644 (file)
@@ -270,7 +270,7 @@ void surf_network_model_init_NS3()
 
   surf_network_model = new NetworkNS3Model();
 
-  xbt_dynar_push(model_list, &surf_network_model);
+  xbt_dynar_push(all_existing_models, &surf_network_model);
 }
 
 NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
index 78e03e5..5d26431 100644 (file)
@@ -79,7 +79,7 @@ void surf_network_model_init_SMPI(void)
     return;
   surf_network_model = new NetworkSmpiModel();
   net_define_callbacks();
-  xbt_dynar_push(model_list, &surf_network_model);
+  xbt_dynar_push(all_existing_models, &surf_network_model);
 
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/sender_gap", 10e-6);
   xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
index 42fef37..a2614f8 100644 (file)
@@ -214,7 +214,7 @@ void surf_storage_model_init_default(void)
 {
   surf_storage_model = new StorageN11Model();
   storage_define_callbacks();
-  xbt_dynar_push(model_list, &surf_storage_model);
+  xbt_dynar_push(all_existing_models, &surf_storage_model);
 }
 
 StorageN11Model::StorageN11Model() : StorageModel() {
index 490ca6e..4c3a58d 100644 (file)
@@ -51,7 +51,7 @@ void surf_presolve(void)
       }
     }
   }
-  xbt_dynar_foreach(model_list, iter, model)
+  xbt_dynar_foreach(all_existing_models, iter, model)
       model->updateActionsState(NOW, 0.0);
 }
 
@@ -152,7 +152,7 @@ double surf_solve(double max_date)
   NOW = NOW + surf_min;
   /* FIXME: model_list or model_list_invoke? revisit here later */
   /* sequential version */
-  xbt_dynar_foreach(model_list, iter, model) {
+  xbt_dynar_foreach(all_existing_models, iter, model) {
          model->updateActionsState(NOW, surf_min);
   }
 
index 8a671c1..178b7b1 100644 (file)
@@ -26,7 +26,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
 /* model_list_invoke contains only surf_host and surf_vm.
  * The callback functions of cpu_model and network_model will be called from
  * those of these host models. */
-xbt_dynar_t model_list = NULL; /* for destroying all models correctly */
+xbt_dynar_t all_existing_models = NULL; /* to destroy models correctly */
 xbt_dynar_t model_list_invoke = NULL;  /* for invoking callbacks */
 
 tmgr_history_t history = NULL;
@@ -317,8 +317,8 @@ void surf_init(int *argc, char **argv)
   SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_free);
 
   xbt_init(argc, argv);
-  if (!model_list)
-    model_list = xbt_dynar_new(sizeof(Model*), NULL);
+  if (!all_existing_models)
+    all_existing_models = xbt_dynar_new(sizeof(Model*), NULL);
   if (!model_list_invoke)
     model_list_invoke = xbt_dynar_new(sizeof(Model*), NULL);
   if (!history)
@@ -354,9 +354,9 @@ void surf_exit(void)
   xbt_lib_free(&file_lib);
   xbt_dict_free(&watched_hosts_lib);
 
-  xbt_dynar_foreach(model_list, iter, model)
+  xbt_dynar_foreach(all_existing_models, iter, model)
     delete model;
-  xbt_dynar_free(&model_list);
+  xbt_dynar_free(&all_existing_models);
   xbt_dynar_free(&model_list_invoke);
   routing_exit();
 
index c9e52ac..3bd2394 100644 (file)
@@ -273,7 +273,7 @@ typedef ActionLmmList* ActionLmmListPtr;
 /*********
  * Model *
  *********/
-XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
+XBT_PUBLIC_DATA(xbt_dynar_t) all_existing_models;
 
 /** @ingroup SURF_interface
  * @brief SURF model interface class
index 82c3591..40b73a9 100644 (file)
@@ -14,7 +14,7 @@ void surf_vm_model_init_HL13(void){
     surf_vm_model = new VMHL13Model();
     Model *model = surf_vm_model;
 
-    xbt_dynar_push(model_list, &model);
+    xbt_dynar_push(all_existing_models, &model);
     xbt_dynar_push(model_list_invoke, &model);
   }
 }
index 811b692..7859613 100644 (file)
@@ -72,7 +72,7 @@ void test(char *platform)
     now = surf_get_clock();
     XBT_DEBUG("Next Event : %g", now);
 
-    xbt_dynar_foreach(model_list, iter, model) {
+    xbt_dynar_foreach(all_existing_models, iter, model) {
       XBT_DEBUG("\t Actions");
       while ((action = surf_model_extract_failed_action_set((surf_model_t)model))) {
         XBT_DEBUG("\t * Failed : %p", action);