Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : init list of irrelevant differences in simix instead of msg
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Wed, 1 Aug 2012 13:48:04 +0000 (15:48 +0200)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Wed, 1 Aug 2012 13:54:42 +0000 (15:54 +0200)
src/include/mc/mc.h
src/msg/msg_global.c
src/simix/smx_context_raw.c

index 9892190..cbc7ce3 100644 (file)
@@ -14,6 +14,7 @@
 #include "simgrid/simix.h"
 #include "simgrid/modelchecker.h" /* our public interface (and definition of HAVE_MC) */
 #include "xbt/automaton.h"
+#include "xbt/dynar.h"
 
 #define STD_HEAP_SIZE   20480000        /* Maximum size of the system's heap */
 
@@ -21,6 +22,8 @@ SG_BEGIN_DECL()
 
 extern char*_surf_mc_property_file; /* fixme: better location? */
 
+extern xbt_dynar_t mmalloc_ignore;
+
 /********************************* Global *************************************/
 void _mc_cfg_cb_reduce(const char *name, int pos);
 void _mc_cfg_cb_checkpoint(const char *name, int pos);
index ca077e1..16f3507 100644 (file)
@@ -50,11 +50,8 @@ void MSG_init_nocheck(int *argc, char **argv) {
     msg_global->vms = xbt_swag_new(xbt_swag_offset(vm,all_vms_hookup));
 
     if(MC_IS_ENABLED){
-      /* Create list of elements to ignore for heap comparison algorithm */
-      MC_ignore_init();
       /* Ignore total amount of messages sent during the simulation for heap comparison */
       MC_ignore(&(msg_global->sent_msg), sizeof(msg_global->sent_msg));
-   
     }
 
     /* initialization of the action module */
index 6c6b435..a3b9473 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "smx_private.h"
 #include "xbt/parmap.h"
+#include "mc/mc.h"
 
 #ifdef HAVE_VALGRIND_VALGRIND_H
 #  include <valgrind/valgrind.h>
@@ -226,6 +227,12 @@ static void smx_ctx_raw_runall(void);
  */
 void SIMIX_ctx_raw_factory_init(smx_context_factory_t *factory)
 {
+
+  if(MC_IS_ENABLED && mmalloc_ignore == NULL){
+    /* Create list of elements to ignore for heap comparison algorithm */
+    MC_ignore_init();
+  }
+
   XBT_VERB("Using raw contexts. Because the glibc is just not good enough for us.");
   smx_ctx_base_factory_init(factory);