Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Improve comments on examples
[simgrid.git] / src / mc / mc_global.c
index c80540a..acbaabf 100644 (file)
@@ -55,7 +55,8 @@ void MC_init(int method)
   MC_UNSET_RAW_MEM;
 }
 
-void MC_modelcheck(int method){
+void MC_modelcheck(int method)
+{
 
   MC_init(method);
 
@@ -69,6 +70,35 @@ void MC_modelcheck(int method){
     default:
       break;
   }
+
+  MC_exit(method);
+}
+
+void MC_exit(int method)
+{
+  mc_state_t state;
+  
+  switch(method){
+    case 0:
+      //MC_dfs_exit();
+      break;
+    case 1:
+      //MC_dpor_exit();
+      break;
+    default:
+      break;
+  }
+   
+  /* Destroy MC data structures (in RAW memory) */
+  MC_SET_RAW_MEM;
+  xbt_free(mc_stats);
+
+  while( (state = (mc_state_t)xbt_fifo_pop(mc_stack)) != NULL )
+    MC_state_delete(state);
+  
+  xbt_fifo_free(mc_stack);
+  xbt_setset_destroy(mc_setset);
+  MC_UNSET_RAW_MEM;
 }
 
 int MC_random(int min, int max)
@@ -245,12 +275,7 @@ void MC_execute_surf_actions(void)
         DEBUG5("Resource [%s] (%d): Executing RUNNING action \"%s\" (%p) MaxDuration %lf", 
           model->name, xbt_swag_size(model->states.running_action_set),
           smx_action->name, smx_action, action->max_duration);
-
-        /* Copy the transfered data of the completed network actions */              
-        /* FIXME: be carefull it might not be an action of the network model */
-        if(smx_action && smx_action->data != NULL)
-          SIMIX_network_copy_data((smx_comm_t)smx_action->data);
-
+        
         if(smx_action)
           SIMIX_action_signal_all(smx_action);
       }