Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics
authorNavarrop <Pierre.Navarro@imag.fr>
Mon, 12 Dec 2011 15:07:27 +0000 (16:07 +0100)
committerNavarrop <Pierre.Navarro@imag.fr>
Fri, 16 Dec 2011 15:58:02 +0000 (16:58 +0100)
src/surf/cpu_cas01.c
src/surf/network_im.c

index 8c18d28..dcc738c 100644 (file)
@@ -667,19 +667,14 @@ static void surf_cpu_model_init_internal(const char* name)
 
   surf_cpu_model->model_private->resource_used = cpu_resource_used;
 
 
   surf_cpu_model->model_private->resource_used = cpu_resource_used;
 
-  if(cpu_update_mechanism == UM_LAZY)
+  if(cpu_update_mechanism == UM_LAZY) {
     surf_cpu_model->model_private->share_resources = cpu_share_resources_lazy;
     surf_cpu_model->model_private->share_resources = cpu_share_resources_lazy;
-  else if (cpu_update_mechanism == UM_FULL)
-    surf_cpu_model->model_private->share_resources = cpu_share_resources_full;
-  else
-    xbt_die("Invalide update mechanism!");
-
-  if(cpu_update_mechanism == UM_LAZY)
     surf_cpu_model->model_private->update_actions_state = cpu_update_actions_state_lazy;
     surf_cpu_model->model_private->update_actions_state = cpu_update_actions_state_lazy;
-  else if(cpu_update_mechanism == UM_FULL)
+  } else if (cpu_update_mechanism == UM_FULL) {
+    surf_cpu_model->model_private->share_resources = cpu_share_resources_full;
     surf_cpu_model->model_private->update_actions_state = cpu_update_actions_state_full;
     surf_cpu_model->model_private->update_actions_state = cpu_update_actions_state_full;
-  else
-    xbt_die("Incompatible optimization mode");
+  else
+    xbt_die("Invalid update mechanism!");
 
   surf_cpu_model->model_private->update_resource_state =
       cpu_update_resource_state;
 
   surf_cpu_model->model_private->update_resource_state =
       cpu_update_resource_state;
index 06f07c1..83e5ad0 100644 (file)
@@ -1072,15 +1072,13 @@ static void im_surf_network_model_init_internal(void)
 #endif
 
   surf_network_model->model_private->resource_used = im_net_resource_used;
 #endif
 
   surf_network_model->model_private->resource_used = im_net_resource_used;
-  if(network_update_mechanism == UM_LAZY)
+  if(network_update_mechanism == UM_LAZY) {
     surf_network_model->model_private->share_resources = net_share_resources_lazy;
     surf_network_model->model_private->share_resources = net_share_resources_lazy;
-  else if(network_update_mechanism == UM_FULL)
+    surf_network_model->model_private->update_actions_state = net_update_actions_state_lazy;
+  } else if(network_update_mechanism == UM_FULL) {
     surf_network_model->model_private->share_resources = net_share_resources_full;
     surf_network_model->model_private->share_resources = net_share_resources_full;
-
-  if(network_update_mechanism == UM_LAZY)
-    surf_network_model->model_private->update_actions_state =net_update_actions_state_lazy;
-  else if(network_update_mechanism == UM_FULL)
-    surf_network_model->model_private->update_actions_state =net_update_actions_state_full;
+    surf_network_model->model_private->update_actions_state = net_update_actions_state_full;
+  }
 
   surf_network_model->model_private->update_resource_state =
                  net_update_resource_state;
 
   surf_network_model->model_private->update_resource_state =
                  net_update_resource_state;