Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : fix SIMCALL_MUTEX_LOCK with MC
authorMarion Guthmuller <marion.guthmuller@inria.fr>
Wed, 25 Feb 2015 15:13:33 +0000 (16:13 +0100)
committerMarion Guthmuller <marion.guthmuller@inria.fr>
Wed, 25 Feb 2015 15:13:33 +0000 (16:13 +0100)
src/mc/mc_base.c
src/mc/mc_config.c
src/mc/mc_global.c

index 82ca8c6..69e7e02 100644 (file)
@@ -38,6 +38,7 @@ int MC_request_is_enabled(smx_simcall_t req)
 
   switch (req->call) {
   case SIMCALL_NONE:
+  case SIMCALL_MUTEX_LOCK: /* If MUTEX_LOCK is catched by the MC, it means that the mutex is locked by another process, thus the request shouldn't be enabled (loop until another process is executed) */ 
     return FALSE;
 
   case SIMCALL_COMM_WAIT:
index 5959b7f..d52c95a 100644 (file)
@@ -153,7 +153,6 @@ void _mc_cfg_cb_comms_determinism(const char *name, int pos)
         ("You are specifying a value to enable/disable the detection of determinism in the communications schemes after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_comms_determinism = xbt_cfg_get_boolean(_sg_cfg_set, name);
-  mc_reduce_kind = e_mc_reduce_none;
 }
 
 void _mc_cfg_cb_send_determinism(const char *name, int pos)
@@ -163,7 +162,6 @@ void _mc_cfg_cb_send_determinism(const char *name, int pos)
         ("You are specifying a value to enable/disable the detection of send-determinism in the communications schemes after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_send_determinism = xbt_cfg_get_boolean(_sg_cfg_set, name);
-  mc_reduce_kind = e_mc_reduce_none;
 }
 
 void _mc_cfg_cb_termination(const char *name, int pos)
@@ -173,7 +171,6 @@ void _mc_cfg_cb_termination(const char *name, int pos)
         ("You are specifying a value to enable/disable the detection of non progressive cycles after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_termination = xbt_cfg_get_boolean(_sg_cfg_set, name);
-  mc_reduce_kind = e_mc_reduce_none;
 }
 
 #endif
index ca66d7b..b700c10 100644 (file)
@@ -332,6 +332,7 @@ void MC_do_the_modelcheck_for_real()
 
   if (_sg_mc_comms_determinism || _sg_mc_send_determinism) {
     XBT_INFO("Check communication determinism");
+    mc_reduce_kind = e_mc_reduce_none;
     MC_modelcheck_comm_determinism_init();
   } else if (!_sg_mc_property_file || _sg_mc_property_file[0] == '\0') {
     if(_sg_mc_termination){
@@ -339,7 +340,6 @@ void MC_do_the_modelcheck_for_real()
       mc_reduce_kind = e_mc_reduce_none;
     }else{
       XBT_INFO("Check a safety property");
-      mc_reduce_kind = e_mc_reduce_dpor;
     }
     MC_modelcheck_safety_init();
   } else {