Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Tue, 24 Sep 2013 08:45:30 +0000 (10:45 +0200)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Tue, 24 Sep 2013 08:45:30 +0000 (10:45 +0200)
85 files changed:
buildtools/Cmake/AddTests.cmake
buildtools/Cmake/Option.cmake
buildtools/Cmake/Pipol.cmake
buildtools/Cmake/PrintArgs.cmake
buildtools/pipol/Experimental_bindings.sh
buildtools/pipol/Nightly_simgrid.sh
doc/doxygen/introduction.doc
doc/doxygen/options.doc
examples/msg/mc/CMakeLists.txt
examples/msg/mc/bugged1_liveness.c
examples/msg/mc/bugged1_liveness.tesh
examples/msg/mc/bugged1_liveness_visited.tesh [new file with mode: 0644]
examples/msg/mc/deploy_bugged1_liveness_visited.xml [new file with mode: 0644]
include/msg/datatypes.h
include/xbt/mmalloc.h
include/xbt/parmap.h
src/bindings/java/org/simgrid/msg/MsgException.java
src/include/surf/surf.h
src/include/surf/surf_resource.h
src/include/surf/surf_resource_lmm.h
src/instr/instr_config.c
src/mc/mc_checkpoint.c
src/mc/mc_compare.c
src/mc/mc_global.c
src/mc/mc_liveness.c
src/mc/mc_private.h
src/msg/msg_host.c
src/msg/msg_io.c
src/msg/msg_process.c
src/simgrid/sg_config.c
src/simix/smx_context_raw.c
src/smpi/colls/smpi_automatic_selector.c
src/smpi/smpi_bench.c
src/smpi/smpi_global.c
src/surf/cpu_cas01.c
src/surf/cpu_ti.c
src/surf/storage.c
src/surf/surf.c
src/surf/surf_routing.c
src/surf/surf_routing_vivaldi.c
src/surf/surfxml_parse.c
src/surf/workstation.c
src/surf/workstation_ptask_L07.c
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm_diff.c
src/xbt/mmalloc/mm_module.c
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mmprivate.h
src/xbt/mmalloc/mrealloc.c
src/xbt/parmap.c
teshsuite/smpi/bcast_coll.c
teshsuite/smpi/mpich3-test/attr/CMakeLists.txt
teshsuite/smpi/mpich3-test/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/comm/CMakeLists.txt
teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/init/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f
teshsuite/smpi/mpich3-test/f77/util/mtestf.f
teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/coll/split_typef90.f90
teshsuite/smpi/mpich3-test/f90/coll/uallreducef90.f90
teshsuite/smpi/mpich3-test/f90/coll/vw_inplacef90.f90
teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/datatype/allctypesf90.f90
teshsuite/smpi/mpich3-test/f90/datatype/gaddressf90.f90
teshsuite/smpi/mpich3-test/f90/datatype/hindexed_blockf90.f90
teshsuite/smpi/mpich3-test/f90/datatype/typecntsf90.f90
teshsuite/smpi/mpich3-test/f90/init/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90
teshsuite/smpi/mpich3-test/f90/pt2pt/dummyf90.f90
teshsuite/smpi/mpich3-test/f90/pt2pt/greqf90.f90
teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90
teshsuite/smpi/mpich3-test/group/CMakeLists.txt
teshsuite/smpi/mpich3-test/init/CMakeLists.txt
teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt
teshsuite/xbt/mmalloc_32.tesh
teshsuite/xbt/mmalloc_64.tesh
tools/doxygen/index_create.pl

index 5eebdce..ac25355 100644 (file)
@@ -453,7 +453,7 @@ if(NOT enable_memcheck)
 
   # END TESH TESTS
 
-  if(enable_smpi)
+  if(enable_smpi_MPICH3_testsuite)
     ADD_TEST(smpi-mpich3-coll-thread            ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll  ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread)
     ADD_TEST(smpi-mpich3-coll-ompi-thread       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll  ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0)
     ADD_TEST(smpi-mpich3-coll-mpich-thread      ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll  ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:mpich)
@@ -469,7 +469,7 @@ if(NOT enable_memcheck)
     endif()
 
     if(SMPI_F2C)
-      ADD_TEST(smpi-mpich3-thread-f77           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/  ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/factory:thread)
+      ADD_TEST(smpi-mpich3-thread-f77           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/  ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=contexts/stack_size:8000)
       set_tests_properties(smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
       if(NOT HAVE_MC)
         ADD_TEST(smpi-mpich3-thread-f90         ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/  ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=contexts/factory:thread)
@@ -516,6 +516,7 @@ if(NOT enable_memcheck)
       ADD_TEST(mc-bugged2-ucontext              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
       if(PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...)
         ADD_TEST(mc-bugged1-liveness-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness.tesh)
+        ADD_TEST(mc-bugged1-liveness-visited-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness_visited.tesh)
       endif()
     endif()
     if(HAVE_RAWCTX)
index a9e2c8e..f9f4d28 100644 (file)
@@ -41,8 +41,10 @@ option(enable_msg_deprecated "This option enable the use of msg deprecated funct
 
 if(WIN32)
   option(enable_smpi "Whether SMPI in included in library." off)
+  option(enable_smpi_MPICH3_testsuite "Whether the test suite form MPICH 3 should be built" off)
 else()
   option(enable_smpi "Whether SMPI in included in library." on)
+  option(enable_smpi_MPICH3_testsuite "Whether the test suite form MPICH 3 should be built" off)
 endif()
 
 if(enable_scala AND NOT enable_java)
index 6f34b4e..f1108fb 100644 (file)
@@ -14,6 +14,7 @@ IF(pipol_user)
 
   if(enable_smpi)
     set(CMAKE_OPTIONS "${CMAKE_OPTIONS}        -Denable_smpi=on")
+    set(CMAKE_OPTIONS "${CMAKE_OPTIONS}        -Denable_smpi_MPICH3_testsuite=on")
   endif()
 
   if(enable_lua)
@@ -167,4 +168,4 @@ IF(pipol_user)
   COMMAND scp ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/pre-simgrid.sh ${pipol_user}@pipol.inria.fr:~/
   COMMAND ssh ${pipol_user}@pipol.inria.fr "chmod a=rwx ~/* ~/.pipol/rc.* ~/.pipol/nightly/*"
   )
-ENDIF()
\ No newline at end of file
+ENDIF()
index fa0fa1f..eb7d3c2 100644 (file)
@@ -109,6 +109,7 @@ message("        Compile Java ........: ${HAVE_Java}")
 message("        Compile Scala........: ${HAVE_Scala}")
 message("        Compile Lua .........: ${HAVE_LUA}")
 message("        Compile Smpi ........: ${HAVE_SMPI}")
+message("        Compile MPI testsuite: ${enable_smpi_MPICH3_testsuite}")
 message("        Compile Smpi f77 ....: ${SMPI_F2C}")
 message("        Compile Static ......: ${enable_lib_static}")
 message("")
index c88899f..7cb21a9 100755 (executable)
@@ -30,7 +30,8 @@ mkdir build-def
 cd build-def
 
 #DEFAULT CONF
-cmake ..
+cmake \
+-Denable_smpi_MPICH3_testsuite=on ..
 ctest -D ExperimentalStart
 ctest -D ExperimentalConfigure
 ctest -D ExperimentalBuild
index e99c3e3..a19e890 100755 (executable)
@@ -72,7 +72,8 @@ mkdir build-def
 cd build-def
 
 #DEFAULT CONF
-cmake ..
+cmake \
+-Denable_smpi_MPICH3_testsuite=on ..
 ctest -D NightlyStart
 ctest -D NightlyConfigure
 ctest -D NightlyBuild
index 6b2fa09..ea50d03 100644 (file)
@@ -163,7 +163,7 @@ sudo apt-get install vite
 ## Setting up and Compiling.
    
 The corresponding archive with all source files and platform files
-can be obtained [here](msg-tuto-src.tgz). 
+can be obtained [here](http://simgrid.gforge.inria.fr/tutorials/msg-tuto/msg-tuto.tgz).
 
 ~~~~{.sh}
 tar zxf msg-tuto.tgz
@@ -196,7 +196,7 @@ For a more "fancy" output, you can try:
 For a really fancy output, you should use [viva/triva][fn:1]:
 
 ~~~~{.sh}
-./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:1\
+./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:1 \
     --cfg=tracing/uncategorized:1 --cfg=viva/uncategorized:uncat.plist
 LANG=C ; viva simgrid.trace uncat.plist
 ~~~~
@@ -213,7 +213,7 @@ LANG=C ; Paje simgrid.trace
 Alternatively, you can use [vite][fn:6].
 
 ~~~~{.sh}
-./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:1\
+./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:1 \
     --cfg=tracing/msg/process:1 --cfg=tracing/basic:1
 vite simgrid.trace
 ~~~~
index fdeac4c..1461798 100644 (file)
@@ -253,6 +253,10 @@ manually set for MSG mailboxes, by setting the receiving mode of the mailbox
 with a call to \ref MSG_mailbox_set_async . For MSG, all messages sent to this 
 mailbox will have this behavior, so consider using two mailboxes if needed. 
 
+This value needs to be smaller than or equals to the threshold set at 
+\ref options_model_smpi_detached , because asynchronous messages are 
+meant to be detached as well.
+
 \subsubsection options_pls Configuring packet-level pseudo-models
 
 When using the packet-level pseudo-models, several specific
index 876cf71..1cba503 100644 (file)
@@ -26,12 +26,14 @@ set(tesh_files
   ${CMAKE_CURRENT_SOURCE_DIR}/bugged1.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/bugged2.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.tesh
+  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_visited.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/centralized.tesh
   PARENT_SCOPE
   )
 set(xml_files
   ${xml_files}
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1_liveness.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1_liveness_visited.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged2_liveness.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged2.xml
index 19f8d61..b020037 100644 (file)
@@ -56,6 +56,7 @@ int coordinator(int argc, char *argv[])
           MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
         }else{
           xbt_dynar_push(requests, &req);
+          CS_used = 0;
         }
       }else{
         XBT_INFO("CS release. resource now idle");
@@ -127,14 +128,19 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
 
+  char **options = &argv[1];
+
   MSG_config("model-check/property","promela_bugged1_liveness");
   MC_automaton_new_propositional_symbol("r", &predR);
   MC_automaton_new_propositional_symbol("cs", &predCS);
+
+  const char* platform_file = options[0];
+  const char* application_file = options[1];
   
-  MSG_create_environment("../msg_platform.xml");
+  MSG_create_environment(platform_file);
   MSG_function_register("coordinator", coordinator);
   MSG_function_register("client", client);
-  MSG_launch_application("deploy_bugged1_liveness.xml");
+  MSG_launch_application(application_file);
   MSG_main();
 
   return 0;
index 96fd359..d3a29d7 100644 (file)
@@ -2,7 +2,7 @@
 
 ! expect signal SIGABRT
 ! timeout 20
-$ ${bindir:=.}/bugged1_liveness --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext
+$ ${bindir:=.}/bugged1_liveness ${bindir:=.}/../msg_platform.xml ${bindir:=.}/deploy_bugged1_liveness.xml --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext
 > [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
 > [  0.000000] (0:@) Check the liveness property promela_bugged1_liveness
 > [  0.000000] (0:@) Get debug information ...
diff --git a/examples/msg/mc/bugged1_liveness_visited.tesh b/examples/msg/mc/bugged1_liveness_visited.tesh
new file mode 100644 (file)
index 0000000..0e115e7
--- /dev/null
@@ -0,0 +1,261 @@
+#! ./tesh
+
+! expect signal SIGABRT
+! timeout 20
+$ ${bindir:=.}/bugged1_liveness ${bindir:=.}/../msg_platform.xml ${bindir:=.}/deploy_bugged1_liveness_visited.xml --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100
+> [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
+> [  0.000000] (0:@) Configuration change: Set 'model-check/visited' to '100'
+> [  0.000000] (0:@) Check the liveness property promela_bugged1_liveness
+> [  0.000000] (0:@) Get debug information ...
+> [  0.000000] (0:@) Get debug information done !
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (3:client@Fafard) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (3:client@Fafard) Propositions changed : r=1, cs=0
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (0:@) Pair 91 already reached (equal to pair 79) !
+> [  0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+> [  0.000000] (0:@) |             ACCEPTANCE CYCLE            |
+> [  0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+> [  0.000000] (0:@) Counter-example that violates formula :
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(3)Fafard (client)] iSend(src=(3)Fafard (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(3)Fafard (client)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) Expanded pairs = 91
+> [  0.000000] (0:@) Visited pairs = 502
+> [  0.000000] (0:@) Executed transitions = 501
\ No newline at end of file
diff --git a/examples/msg/mc/deploy_bugged1_liveness_visited.xml b/examples/msg/mc/deploy_bugged1_liveness_visited.xml
new file mode 100644 (file)
index 0000000..ca6bc8e
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+
+<platform version="3">
+
+  <process host="Tremblay" function="coordinator" />
+
+   <process host="Boivin" function="client" >
+    <argument value="2"/>
+  </process>
+
+  <process host="Fafard" function="client" >
+    <argument value="1"/>
+  </process>
+
+</platform>
index 241d649..53905bf 100644 (file)
@@ -117,9 +117,9 @@ typedef struct msg_file {
 } s_msg_file_t;
 
 /** @brief File datatype.
-    @ingroup msg_file_management 
   You should consider this as an opaque object.
+ *  @ingroup msg_file_management
+ *
*  You should consider this as an opaque object.
  */
 
 typedef struct msg_file *msg_file_t;
@@ -129,12 +129,17 @@ typedef struct msg_file *msg_file_t;
 
 extern int MSG_STORAGE_LEVEL;
 
+/** @brief Storage datatype.
+ *  @ingroup msg_storage_management
+ *
+ *  You should consider this as an opaque object.
+ */
 typedef xbt_dictelm_t msg_storage_t;
 typedef s_xbt_dictelm_t s_msg_storage_t;
 
-typedef struct msg_storage_priv {
-/* TODO PV: fill it (or not) ! */
-} s_msg_storage_priv_t, *msg_storage_priv_t;
+typedef struct msg_storage_priv /* {
+   TODO PV: fill it (or not) !
+} */ s_msg_storage_priv_t, *msg_storage_priv_t;
 
 //typedef struct simdata_storage *simdata_storage_t;
 //
index df40f03..32fa620 100644 (file)
@@ -58,11 +58,12 @@ xbt_mheap_t mmalloc_get_current_heap(void);
 
 int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2);
 int mmalloc_linear_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2);
-void init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t to_ignore1, xbt_dynar_t to_ignore2);
+int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t to_ignore1, xbt_dynar_t to_ignore2);
 int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t all_types, xbt_dict_t other_types, char *type, int pointer_level);
 void reset_heap_information(void);
 int get_pointed_area_size(void *area, int heap);
 
 size_t mmalloc_get_bytes_used(xbt_mheap_t);
+ssize_t mmalloc_get_busy_size(xbt_mheap_t, void *ptr);
 
 #endif                          /* MMALLOC_H */
index 3b9f9ed..d26d914 100644 (file)
@@ -52,6 +52,16 @@ XBT_PUBLIC(void) xbt_parmap_apply(xbt_parmap_t parmap,
                                   xbt_dynar_t data);
 XBT_PUBLIC(void*) xbt_parmap_next(xbt_parmap_t parmap);
 
+#ifdef HAVE_MC
+XBT_PUBLIC(xbt_parmap_t) xbt_parmap_mc_new(unsigned int num_workers,
+    e_xbt_parmap_mode_t mode);
+
+XBT_PUBLIC(int) xbt_parmap_mc_apply(xbt_parmap_t parmap, 
+                         int_f_pvoid_pvoid_t fun, 
+                         void *data,
+                         unsigned int length,
+                         void* ref_snapshot);
+#endif
 /** \} */
 
 SG_END_DECL()
index b41bd30..d56b7ea 100644 (file)
@@ -12,14 +12,13 @@ package org.simgrid.msg;
 
 /**
  * This exception is an abstract class grouping all MSG-related exceptions
-  
-    \htmlonly <!-- 
-      DOXYGEN_NAVBAR_CHILD "HostNotFoundException"=classsimgrid_1_1msg_1_1HostNotFoundException.html
-      DOXYGEN_NAVBAR_CHILD "JniException"=classsimgrid_1_1msg_1_1JniException.html
-      DOXYGEN_NAVBAR_CHILD "NativeException"=classsimgrid_1_1msg_1_1NativeException.html
-      DOXYGEN_NAVBAR_CHILD "ProcessNotFoundException"=classsimgrid_1_1msg_1_1ProcessNotFoundException.html
-    --> \endhtmlonly 
-  
+ *
+ *  <!--
+ *    DOXYGEN_NAVBAR_CHILD "HostNotFoundException"=classsimgrid_1_1msg_1_1HostNotFoundException.html
+ *    DOXYGEN_NAVBAR_CHILD "JniException"=classsimgrid_1_1msg_1_1JniException.html
+ *    DOXYGEN_NAVBAR_CHILD "NativeException"=classsimgrid_1_1msg_1_1NativeException.html
+ *    DOXYGEN_NAVBAR_CHILD "ProcessNotFoundException"=classsimgrid_1_1msg_1_1ProcessNotFoundException.html
+ *  -->
  */
 public abstract class MsgException extends Exception {
   private static final long serialVersionUID = 1L;
index 5bce782..5e767d2 100644 (file)
@@ -378,6 +378,7 @@ typedef struct surf_resource {
   surf_model_t model;
   char *name;
   xbt_dict_t properties;
+  void_f_pvoid_t free_f;
 } s_surf_resource_t, *surf_resource_t;
 
 /**
index dc66869..1723e85 100644 (file)
 static XBT_INLINE
     surf_resource_t surf_resource_new(size_t childsize,
                                       surf_model_t model, const char *name,
-                                      xbt_dict_t props)
+                                      xbt_dict_t props, void_f_pvoid_t free_f)
 {
   surf_resource_t res = xbt_malloc0(childsize);
   res->model = model;
   res->name = xbt_strdup(name);
   res->properties = props;
+  res->free_f=free_f;
   return res;
 }
 
 static XBT_INLINE void surf_resource_free(void *r)
 {
   surf_resource_t resource = r;
+  if(resource->free_f)
+    resource->free_f(r);
   free(resource->name);
   xbt_dict_free(&resource->properties);
   free(resource);
index 992f70d..1f50786 100644 (file)
@@ -28,7 +28,7 @@ static XBT_INLINE
 
   surf_resource_lmm_t res =
       (surf_resource_lmm_t) surf_resource_new(childsize, model, name,
-                                              props);
+                                              props, NULL);
 
   res->constraint = lmm_constraint_new(system, res, constraint_value);
   res->state_current = state_init;
index 7081bc0..175b7f5 100644 (file)
@@ -319,166 +319,166 @@ char *TRACE_get_viva_cat_conf (void)
 void TRACE_global_init(int *argc, char **argv)
 {
   /* name of the tracefile */
-  char *default_tracing_filename = xbt_strdup("simgrid.trace");
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_FILENAME,
                    "Trace file created by the instrumented SimGrid.",
-                   xbt_cfgelm_string, &default_tracing_filename, 1, 1,
+                   xbt_cfgelm_string, NULL, 1, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_FILENAME, "simgrid.trace");
 
   /* tracing */
-  int default_tracing = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING,
                    "Enable Tracing.",
-                   xbt_cfgelm_int, &default_tracing, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING, 0);
 
   /* register platform in the trace */
-  int default_tracing_platform = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_PLATFORM,
                    "Register the platform in the trace as a hierarchy.",
-                   xbt_cfgelm_int, &default_tracing_platform, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_PLATFORM, 0);
 
   /* register platform in the trace */
-  int default_tracing_platform_topology = 1;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_TOPOLOGY,
                    "Register the platform topology in the trace as a graph.",
-                   xbt_cfgelm_int, &default_tracing_platform_topology, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_TOPOLOGY, 1);
 
   /* smpi */
-  int default_tracing_smpi = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI,
                    "Tracing of the SMPI interface.",
-                   xbt_cfgelm_int, &default_tracing_smpi, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_SMPI, 0);
 
   /* smpi grouped */
-  int default_tracing_smpi_grouped = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_GROUP,
                    "Group MPI processes by host.",
-                   xbt_cfgelm_int, &default_tracing_smpi_grouped, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_SMPI_GROUP, 0);
 
   /* smpi computing */
-  int default_tracing_smpi_computing = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_COMPUTING,
                    "Generate states for timing out of SMPI parts of the application",
-                   xbt_cfgelm_int, &default_tracing_smpi_computing, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_SMPI_COMPUTING, 0);
 
   /* smpi internals */
-  int default_tracing_smpi_internals = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_INTERNALS,
                    "View internal messages sent by Collective communications in SMPI",
-                   xbt_cfgelm_int, &default_tracing_smpi_internals, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_SMPI_INTERNALS, 0);
 
   /* tracing categorized resource utilization traces */
-  int default_tracing_categorized = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_CATEGORIZED,
                    "Tracing categorized resource utilization of hosts and links.",
-                   xbt_cfgelm_int, &default_tracing_categorized, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_CATEGORIZED, 0);
 
   /* tracing uncategorized resource utilization */
-  int default_tracing_uncategorized = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_UNCATEGORIZED,
                    "Tracing uncategorized resource utilization of hosts and links.",
-                   xbt_cfgelm_int, &default_tracing_uncategorized, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_UNCATEGORIZED, 0);
 
   /* msg process */
-  int default_tracing_msg_process = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_MSG_PROCESS,
                    "Tracing of MSG process behavior.",
-                   xbt_cfgelm_int, &default_tracing_msg_process, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_MSG_PROCESS, 0);
 
   /* msg process */
-  int default_tracing_msg_vm = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_MSG_VM,
                    "Tracing of MSG process behavior.",
-                   xbt_cfgelm_int, &default_tracing_msg_vm, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_MSG_VM, 0);
 
   /* disable tracing link */
-  int default_tracing_disable_link = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_LINK,
                    "Do not trace link bandwidth and latency.",
-                   xbt_cfgelm_int, &default_tracing_disable_link, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_DISABLE_LINK, 0);
 
   /* disable tracing link */
-  int default_tracing_disable_power = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_POWER,
                    "Do not trace host power.",
-                   xbt_cfgelm_int, &default_tracing_disable_power, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_DISABLE_POWER, 0);
 
 
   /* tracing buffer */
-  int default_buffer = 1;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_BUFFER,
                    "Buffer trace events to put them in temporal order.",
-                   xbt_cfgelm_int, &default_buffer, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_BUFFER, 1);
 
   /* tracing one link only */
-  int default_onelink_only = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_ONELINK_ONLY,
                    "Use only routes with one link to trace platform.",
-                   xbt_cfgelm_int, &default_onelink_only, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_ONELINK_ONLY, 0);
 
   /* disable destroy */
-  int default_disable_destroy = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_DESTROY,
                    "Disable platform containers destruction.",
-                   xbt_cfgelm_int, &default_disable_destroy, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_DISABLE_DESTROY, 0);
 
   /* basic -- Avoid extended events (impoverished trace file) */
-  int default_basic = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_BASIC,
                    "Avoid extended events (impoverished trace file).",
-                   xbt_cfgelm_int, &default_basic, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_BASIC, 0);
 
   /* display_sizes -- Extended events with message size information */
-  int default_display_sizes = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISPLAY_SIZES,
                    "(smpi only for now) Extended events with message size information",
-                   xbt_cfgelm_int, &default_display_sizes, 0, 1,
+                   xbt_cfgelm_int, NULL, 0, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_DISPLAY_SIZES, 0);
 
   /* comment */
-  char *default_tracing_comment = xbt_strdup ("");
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_COMMENT,
                    "Comment to be added on the top of the trace file.",
-                   xbt_cfgelm_string, &default_tracing_comment, 1, 1,
+                   xbt_cfgelm_string, NULL, 1, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_COMMENT, "");
 
   /* comment_file */
-  char *default_tracing_comment_file = xbt_strdup ("");
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_COMMENT_FILE,
                    "The contents of the file are added to the top of the trace file as comment.",
-                   xbt_cfgelm_string, &default_tracing_comment_file, 1, 1,
+                   xbt_cfgelm_string, NULL, 1, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_COMMENT_FILE, "");
 
   /* Viva graph configuration for uncategorized tracing */
-  char *default_viva_uncat_conf_file = xbt_strdup ("");
   xbt_cfg_register(&_sg_cfg_set, OPT_VIVA_UNCAT_CONF,
                    "Viva Graph configuration file for uncategorized resource utilization traces.",
-                   xbt_cfgelm_string, &default_viva_uncat_conf_file, 1, 1,
+                   xbt_cfgelm_string, NULL, 1, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_VIVA_UNCAT_CONF, "");
 
   /* Viva graph configuration for uncategorized tracing */
-  char *default_viva_cat_conf_file = xbt_strdup ("");
   xbt_cfg_register(&_sg_cfg_set, OPT_VIVA_CAT_CONF,
                    "Viva Graph configuration file for categorized resource utilization traces.",
-                   xbt_cfgelm_string, &default_viva_cat_conf_file, 1, 1,
+                   xbt_cfgelm_string, NULL, 1, 1,
                    NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_VIVA_CAT_CONF, "");
 
   /* instrumentation can be considered configured now */
   trace_configured = 1;
index 7b36469..f6612b7 100644 (file)
@@ -726,10 +726,6 @@ static void MC_dump_checkpoint_ignore(mc_snapshot_t snapshot){
 
 mc_snapshot_t MC_take_snapshot(){
 
-  int raw_mem = (mmalloc_get_current_heap() == raw_heap);
-  
-  MC_SET_RAW_MEM;
-
   mc_snapshot_t snapshot = xbt_new0(s_mc_snapshot_t, 1);
   snapshot->nb_processes = xbt_swag_size(simix_global->process_list);
 
@@ -746,11 +742,6 @@ mc_snapshot_t MC_take_snapshot(){
 
   MC_dump_checkpoint_ignore(snapshot);
 
-  MC_UNSET_RAW_MEM;
-
-  if(raw_mem)
-    MC_SET_RAW_MEM;
-
   return snapshot;
 
 }
index 2422ad6..85c2901 100644 (file)
@@ -15,7 +15,7 @@ typedef struct s_pointers_pair{
   void *p2;
 }s_pointers_pair_t, *pointers_pair_t;
 
-xbt_dynar_t compared_pointers;
+__thread xbt_dynar_t compared_pointers;
 
 /************************** Free functions ****************************/
 /********************************************************************/
@@ -271,17 +271,17 @@ static int compare_global_variables(int region_type, mc_mem_region_t r1, mc_mem_
       offset = (char *)current_var->address.address - (char *)start_data_libsimgrid;
 
     res = compare_areas_with_type((char *)r1->data + offset, (char *)r2->data + offset, types, other_types, current_var->type_origin, r1->size, region_type, start_data, 0);
-    if(res == -1){
-      xbt_dynar_cursor_rm(variables, &cursor);
-    }else if(res == 1){
-      XBT_VERB("Global variable %s (%p - %p) is different between snapshots", current_var->name, (char *)r1->data + offset, (char *)r2->data + offset);
+    if(res == 1){
+      XBT_VERB("Global variable %s is different between snapshots", current_var->name);
       xbt_dynar_free(&compared_pointers);
+      compared_pointers = NULL;
       return 1;
     }
 
   }
 
   xbt_dynar_free(&compared_pointers);
+  compared_pointers = NULL;
 
   return 0;
 
@@ -299,6 +299,7 @@ static int compare_local_variables(mc_snapshot_stack_t stack1, mc_snapshot_stack
   if(xbt_dynar_length(stack1->local_variables) != xbt_dynar_length(stack2->local_variables)){
     XBT_VERB("Different number of local variables");
     xbt_dynar_free(&compared_pointers);
+    compared_pointers = NULL;
     return 1;
   }else{
     unsigned int cursor = 0;
@@ -318,24 +319,26 @@ static int compare_local_variables(mc_snapshot_stack_t stack1, mc_snapshot_stack
       else
         res = compare_areas_with_type( (char *)heap1 + offset1, (char *)heap2 + offset2, mc_variables_type_binary, mc_variables_type_libsimgrid, current_var1->type, 0, 2, start_data_binary, 0l);
       if(res == 1){
-        XBT_VERB("Local variable %s (%p - %p)  in frame %s  is different between snapshots", current_var1->name, (char *)heap1 + offset1, (char *)heap2 + offset2, current_var1->frame);
+        XBT_VERB("Local variable %s in frame %s  is different between snapshots", current_var1->name, current_var1->frame);
         xbt_dynar_free(&compared_pointers);
+        compared_pointers = NULL;
         return res;
       }
       cursor++;
     }
     xbt_dynar_free(&compared_pointers);
+    compared_pointers = NULL;
     return 0;
   }
 }
 
-int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
+int snapshot_compare(void *p1, void *p2){
+
+  mc_snapshot_t s1 = ((mc_pair_t)p1)->graph_state->system_state;
+  mc_snapshot_t s2 = ((mc_pair_t)p2)->graph_state->system_state;
 
-  int raw_mem = (mmalloc_get_current_heap() == raw_heap);
-  
-  MC_SET_RAW_MEM;
-     
   int errors = 0;
+  int res_init;
 
   xbt_os_timer_t global_timer = xbt_os_timer_new();
   xbt_os_timer_t timer = xbt_os_timer_new();
@@ -359,12 +362,12 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
         xbt_os_walltimer_stop(timer);
         mc_comp_times->stacks_sizes_comparison_time = xbt_os_timer_elapsed(timer);
       }
-      XBT_DEBUG("Different size used in stacks : %zu - %zu", size_used1, size_used2);
+      XBT_DEBUG("(%d - %d) Different size used in stacks : %zu - %zu", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num, size_used1, size_used2);
       errors++;
       is_diff = 1;
     #else
       #ifdef MC_VERBOSE
-        XBT_VERB("Different size used in stacks : %zu - %zu", size_used1, size_used2);
+      XBT_VERB("(%d - %d) Different size used in stacks : %zu - %zu", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num, size_used1, size_used2);
       #endif
 
       xbt_os_walltimer_stop(timer);
@@ -373,9 +376,6 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
       xbt_os_timer_free(global_timer);
 
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
-
       return 1;
     #endif  
     }
@@ -407,9 +407,6 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
         mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
         xbt_os_timer_free(global_timer);
 
-        if(!raw_mem)
-          MC_UNSET_RAW_MEM;
-
         return 1;
       #endif
     }
@@ -438,9 +435,6 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
         mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
         xbt_os_timer_free(global_timer);
 
-        if(!raw_mem)
-          MC_UNSET_RAW_MEM;
-        
         return 1;
       #endif
     }
@@ -451,7 +445,27 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
   #endif
 
   /* Init heap information used in heap comparison algorithm */
-  init_heap_information((xbt_mheap_t)s1->regions[0]->data, (xbt_mheap_t)s2->regions[0]->data, s1->to_ignore, s2->to_ignore);
+  res_init = init_heap_information((xbt_mheap_t)s1->regions[0]->data, (xbt_mheap_t)s2->regions[0]->data, s1->to_ignore, s2->to_ignore);
+  if(res_init == -1){
+     #ifdef MC_DEBUG
+    XBT_DEBUG("(%d - %d) Different heap information", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num); 
+        errors++; 
+      #else
+        #ifdef MC_VERBOSE
+        XBT_VERB("(%d - %d) Different heap information", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num); 
+        #endif
+
+        xbt_os_walltimer_stop(global_timer);
+        mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
+        xbt_os_timer_free(global_timer);
+
+        return 1;
+      #endif
+  }
+
+  #ifdef MC_DEBUG
+    xbt_os_walltimer_start(timer);
+  #endif
 
   /* Stacks comparison */
   unsigned int  cursor = 0;
@@ -469,13 +483,13 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
           xbt_os_walltimer_stop(timer);
           mc_comp_times->stacks_comparison_time = xbt_os_timer_elapsed(timer);
         }
-        XBT_DEBUG("Different local variables between stacks %d", cursor + 1);
+        XBT_DEBUG("(%d - %d) Different local variables between stacks %d", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num, cursor + 1);
         errors++;
         is_diff = 1;
       #else
         
         #ifdef MC_VERBOSE
-          XBT_VERB("Different local variables between stacks %d", cursor + 1);
+        XBT_VERB("(%d - %d) Different local variables between stacks %d", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num, cursor + 1);
         #endif
           
         reset_heap_information();
@@ -484,10 +498,7 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
         xbt_os_walltimer_stop(global_timer);
         mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
         xbt_os_timer_free(global_timer);
-        
-        if(!raw_mem)
-          MC_UNSET_RAW_MEM;
-        
         return 1;
       #endif
     }
@@ -506,11 +517,11 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
     #ifdef MC_DEBUG
       xbt_os_walltimer_stop(timer);
       mc_comp_times->binary_global_variables_comparison_time = xbt_os_timer_elapsed(timer);
-      XBT_DEBUG("Different global variables in binary");
+      XBT_DEBUG("(%d - %d) Different global variables in binary", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num);
       errors++;
     #else
       #ifdef MC_VERBOSE
-        XBT_VERB("Different global variables in binary");
+      XBT_VERB("(%d - %d) Different global variables in binary", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num);
       #endif
 
       reset_heap_information();
@@ -519,9 +530,6 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
       xbt_os_walltimer_stop(global_timer);
       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
       xbt_os_timer_free(global_timer);
-    
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
 
       return 1;
     #endif
@@ -539,11 +547,11 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
     #ifdef MC_DEBUG
       xbt_os_walltimer_stop(timer);
       mc_comp_times->libsimgrid_global_variables_comparison_time = xbt_os_timer_elapsed(timer);
-      XBT_DEBUG("Different global variables in libsimgrid");
+      XBT_DEBUG("(%d - %d) Different global variables in libsimgrid", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num);
       errors++;
     #else
       #ifdef MC_VERBOSE
-        XBT_VERB("Different global variables in libsimgrid");
+      XBT_VERB("(%d - %d) Different global variables in libsimgrid", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num);
       #endif
         
       reset_heap_information();
@@ -552,14 +560,11 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
       xbt_os_walltimer_stop(global_timer);
       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
       xbt_os_timer_free(global_timer);
-    
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
 
       return 1;
     #endif
   }
-    
+
   #ifdef MC_DEBUG
     xbt_os_walltimer_start(timer);
   #endif
@@ -570,12 +575,12 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
     #ifdef MC_DEBUG
       xbt_os_walltimer_stop(timer);
       mc_comp_times->heap_comparison_time = xbt_os_timer_elapsed(timer); 
-      XBT_DEBUG("Different heap (mmalloc_compare)");
+      XBT_DEBUG("(%d - %d) Different heap (mmalloc_compare)", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num);
       errors++;
     #else
  
       #ifdef MC_VERBOSE
-        XBT_VERB("Different heap (mmalloc_compare)");
+      XBT_VERB("(%d - %d) Different heap (mmalloc_compare)", ((mc_pair_t)p1)->num, ((mc_pair_t)p2)->num);
       #endif
        
       reset_heap_information();
@@ -585,9 +590,6 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
       xbt_os_timer_free(global_timer);
 
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
-
       return 1;
     #endif
   }else{
@@ -612,9 +614,6 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
     print_comparison_times();
   #endif
 
-  if(!raw_mem)
-    MC_UNSET_RAW_MEM;
-
   return errors > 0;
   
 }
index cbd6cc8..d137272 100644 (file)
@@ -53,7 +53,7 @@ void _mc_cfg_cb_checkpoint(const char *name, int pos) {
   if (_sg_init_status && !_sg_do_model_check) {
     xbt_die("You are specifying a checkpointing value 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_checkpoint = xbt_cfg_get_boolean(_sg_cfg_set, name);
+  _sg_mc_checkpoint = xbt_cfg_get_int(_sg_cfg_set, name);
 }
 void _mc_cfg_cb_property(const char *name, int pos) {
   if (_sg_init_status && !_sg_do_model_check) {
@@ -94,8 +94,8 @@ void _mc_cfg_cb_dot_output(const char *name, int pos) {
 mc_state_t mc_current_state = NULL;
 char mc_replay_mode = FALSE;
 double *mc_time = NULL;
-mc_comparison_times_t mc_comp_times = NULL;
-double mc_snapshot_comparison_time;
+__thread mc_comparison_times_t mc_comp_times = NULL;
+__thread double mc_snapshot_comparison_time;
 mc_stats_t mc_stats = NULL;
 
 /* Safety */
@@ -1325,10 +1325,8 @@ void MC_ignore_heap(void *address, size_t size){
   else
     xbt_dynar_insert_at(mc_heap_comparison_ignore, cursor, &region);
 
-  MC_UNSET_RAW_MEM;
-
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 }
 
 void MC_remove_ignore_heap(void *address, size_t size){
@@ -1366,10 +1364,8 @@ void MC_remove_ignore_heap(void *address, size_t size){
     MC_remove_ignore_heap(address, size);
   }
 
-  MC_UNSET_RAW_MEM;
-  
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 
 }
 
@@ -1443,10 +1439,8 @@ void MC_ignore_global_variable(const char *name){
     }
   }
 
-  MC_UNSET_RAW_MEM;
-
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 }
 
 void MC_ignore_local_variable(const char *var_name, const char *frame_name){
@@ -1554,10 +1548,8 @@ void MC_ignore_local_variable(const char *var_name, const char *frame_name){
     }
   }
 
-  MC_UNSET_RAW_MEM;
-  
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 
 }
 
@@ -1566,6 +1558,7 @@ void MC_new_stack_area(void *stack, char *name, void* context, size_t size){
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
   MC_SET_RAW_MEM;
+
   if(stacks_areas == NULL)
     stacks_areas = xbt_dynar_new(sizeof(stack_region_t), NULL);
   
@@ -1577,11 +1570,9 @@ void MC_new_stack_area(void *stack, char *name, void* context, size_t size){
   region->size = size;
   region->block = ((char*)stack - (char*)((xbt_mheap_t)std_heap)->heapbase) / BLOCKSIZE + 1;
   xbt_dynar_push(stacks_areas, &region);
-  
-  MC_UNSET_RAW_MEM;
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 }
 
 void MC_ignore(void *addr, size_t size){
@@ -1604,7 +1595,7 @@ void MC_ignore(void *addr, size_t size){
     unsigned int cursor = 0;
     int start = 0;
     int end = xbt_dynar_length(mc_checkpoint_ignore) -1;
-    mc_checkpoint_ignore_region_t current_region;
+    mc_checkpoint_ignore_region_t current_region = NULL;
 
     while(start <= end){
       cursor = (start + end) / 2;
@@ -1724,6 +1715,9 @@ void MC_init(){
   MC_get_libsimgrid_plt_section();
   MC_get_binary_plt_section();
 
+   /* Init parmap */
+  parmap = xbt_parmap_mc_new(xbt_os_get_numcores(), XBT_PARMAP_DEFAULT);
+
   MC_UNSET_RAW_MEM;
 
    /* Ignore some variables from xbt/ex.h used by exception e for stacks comparison */
@@ -1750,6 +1744,7 @@ void MC_init(){
   MC_ignore_global_variable("smx_current_context_key");
   MC_ignore_global_variable("sysv_maestro_context");
   MC_ignore_global_variable("counter"); /* Static variable used for tracing */
 
   if(raw_mem_set)
     MC_SET_RAW_MEM;
index 27889ac..66f17c5 100644 (file)
@@ -15,7 +15,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc,
 xbt_dynar_t acceptance_pairs;
 xbt_dynar_t visited_pairs;
 xbt_dynar_t successors;
-
+xbt_parmap_t parmap;
 
 /********* Static functions *********/
 
@@ -35,133 +35,114 @@ static xbt_dynar_t get_atomic_propositions_values(){
   return values;
 }
 
+static int get_search_interval(xbt_dynar_t all_pairs, mc_pair_t pair, int *min, int *max){
+
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  MC_SET_RAW_MEM;
+
+  int cursor = 0, previous_cursor, next_cursor;
+  mc_pair_t pair_test;
+  int start = 0;
+  int end = xbt_dynar_length(all_pairs) - 1;
+  
+  while(start <= end){
+    cursor = (start + end) / 2;
+    pair_test = (mc_pair_t)xbt_dynar_get_as(all_pairs, cursor, mc_pair_t);
+    if(pair_test->nb_processes < pair->nb_processes){
+      start = cursor + 1;
+    }else if(pair_test->nb_processes > pair->nb_processes){
+      end = cursor - 1;
+    }else{
+      if(pair_test->heap_bytes_used < pair->heap_bytes_used){
+        start = cursor +1;
+      }else if(pair_test->heap_bytes_used > pair->heap_bytes_used){
+        end = cursor - 1;
+      }else{
+        *min = *max = cursor;
+        previous_cursor = cursor - 1;
+        while(previous_cursor >= 0){
+          pair_test = (mc_pair_t)xbt_dynar_get_as(all_pairs, previous_cursor, mc_pair_t);
+          if(pair_test->nb_processes != pair->nb_processes || pair_test->heap_bytes_used != pair->heap_bytes_used)
+            break;
+          *min = previous_cursor;
+          previous_cursor--;
+        }
+        next_cursor = cursor + 1;
+        while(next_cursor < xbt_dynar_length(all_pairs)){
+          pair_test = (mc_pair_t)xbt_dynar_get_as(all_pairs, next_cursor, mc_pair_t);
+          if(pair_test->nb_processes != pair->nb_processes || pair_test->heap_bytes_used != pair->heap_bytes_used)
+            break;
+          *max = next_cursor;
+          next_cursor++;
+        }
+        if(!raw_mem_set)
+          MC_UNSET_RAW_MEM;
+        return -1;
+      }
+     }
+  }
+
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
+
+  return cursor;
+}
+
 static int is_reached_acceptance_pair(mc_pair_t pair){
 
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  MC_SET_RAW_MEM;
  
   if(xbt_dynar_is_empty(acceptance_pairs)){
 
-    MC_SET_RAW_MEM;
     if(pair->graph_state->system_state == NULL){
       pair->graph_state->system_state = MC_take_snapshot();
       pair->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
     }
     xbt_dynar_push(acceptance_pairs, &pair); 
-    MC_UNSET_RAW_MEM;
 
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
+    if(!raw_mem_set)
+      MC_UNSET_RAW_MEM;
 
     return -1;
 
   }else{
 
-    MC_SET_RAW_MEM;
-
     if(pair->graph_state->system_state == NULL){
       pair->graph_state->system_state = MC_take_snapshot();
       pair->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
     }
 
-    size_t current_bytes_used = pair->heap_bytes_used;
-    int current_nb_processes = pair->nb_processes;
-
-    unsigned int cursor = 0;
-    int previous_cursor = 0, next_cursor = 0;
-    int start = 0;
-    int end = xbt_dynar_length(acceptance_pairs) - 1;
-
-    mc_pair_t pair_test = NULL;
-    size_t bytes_used_test;
-    int nb_processes_test;
-    int same_processes_and_bytes_not_found = 1;
+    int min = -1, max = -1, index;
+    int res;
+    mc_pair_t pair_test;
+    
+    index = get_search_interval(acceptance_pairs, pair, &min, &max);
 
-    while(start <= end && same_processes_and_bytes_not_found){
-      cursor = (start + end) / 2;
-      pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, cursor, mc_pair_t);
-      bytes_used_test = pair_test->heap_bytes_used;
-      nb_processes_test = pair_test->nb_processes;
-      if(nb_processes_test < current_nb_processes)
-        start = cursor + 1;
-      else if(nb_processes_test > current_nb_processes)
-        end = cursor - 1; 
-      else if(nb_processes_test == current_nb_processes){
-        if(bytes_used_test < current_bytes_used)
-          start = cursor + 1;
-        else if(bytes_used_test > current_bytes_used)
-          end = cursor - 1;
-        else if(bytes_used_test == current_bytes_used){
-          same_processes_and_bytes_not_found = 0;
-          if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-            if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){
-              XBT_DEBUG("Compare with state %d", pair_test->num);
-              if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                if(raw_mem_set)
-                  MC_SET_RAW_MEM;
-                else
-                  MC_UNSET_RAW_MEM;
-                return pair_test->num;
-              }
-            }
-          }
-          /* Search another pair with same number of bytes used in std_heap */
-          previous_cursor = cursor - 1;
-          while(previous_cursor >= 0){
-            pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, previous_cursor, mc_pair_t);
-            bytes_used_test = pair_test->heap_bytes_used;
-            if(bytes_used_test != current_bytes_used)
-              break;
-            if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-              if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){  
-                XBT_DEBUG("Compare with state %d", pair_test->num);
-                if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                  if(raw_mem_set)
-                    MC_SET_RAW_MEM;
-                  else
-                    MC_UNSET_RAW_MEM;
-                  return pair_test->num;
-                }
-              }
-            }
-            previous_cursor--;
-          }
-          next_cursor = cursor + 1;
-          while(next_cursor < xbt_dynar_length(acceptance_pairs)){
-            pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, next_cursor, mc_pair_t);
-            bytes_used_test = pair_test->heap_bytes_used;
-            if(bytes_used_test != current_bytes_used)
-              break;
-            if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-              if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){
-                XBT_DEBUG("Compare with state %d", pair_test->num);
-                if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                  if(raw_mem_set)
-                    MC_SET_RAW_MEM;
-                  else
-                    MC_UNSET_RAW_MEM;
-                  return pair_test->num;
-                }
-              }
-            }
-            next_cursor++;
-          }
-        }
+    if(min != -1 && max != -1){ /* Acceptance pair with same number of processes and same heap bytes used exists */
+      res = xbt_parmap_mc_apply(parmap, snapshot_compare, xbt_dynar_get_ptr(acceptance_pairs, min), (max-min)+1, pair);
+      if(res != -1){
+        if(!raw_mem_set)
+          MC_UNSET_RAW_MEM;
+        return ((mc_pair_t)xbt_dynar_get_as(acceptance_pairs, (min+res)-1, mc_pair_t))->num;
+      }
+      xbt_dynar_insert_at(acceptance_pairs, min, &pair);
+    }else{
+      pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, index, mc_pair_t);
+      if(pair_test->nb_processes < pair->nb_processes){
+        xbt_dynar_insert_at(acceptance_pairs, index+1, &pair);
+      }else{
+        if(pair_test->heap_bytes_used < pair->heap_bytes_used)
+          xbt_dynar_insert_at(acceptance_pairs, index + 1, &pair);
+        else
+          xbt_dynar_insert_at(acceptance_pairs, index, &pair);
       }
     }
 
-    pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, cursor, mc_pair_t);
-    bytes_used_test = pair_test->heap_bytes_used;
-
-    if(bytes_used_test < current_bytes_used)
-      xbt_dynar_insert_at(acceptance_pairs, cursor + 1, &pair);
-    else
-      xbt_dynar_insert_at(acceptance_pairs, cursor, &pair);
-       
-    
-    MC_UNSET_RAW_MEM;
-
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
+    if(!raw_mem_set)
+      MC_UNSET_RAW_MEM;
     
     return -1;
     
@@ -174,20 +155,18 @@ static void set_acceptance_pair_reached(mc_pair_t pair){
 
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
+  MC_SET_RAW_MEM;
+
   if(xbt_dynar_is_empty(acceptance_pairs)){
 
-     MC_SET_RAW_MEM;
      if(pair->graph_state->system_state == NULL){
        pair->graph_state->system_state = MC_take_snapshot();
        pair->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
      }
      xbt_dynar_push(acceptance_pairs, &pair); 
-     MC_UNSET_RAW_MEM;
 
   }else{
 
-    MC_SET_RAW_MEM;
-
     if(pair->graph_state->system_state == NULL){
       pair->graph_state->system_state = MC_take_snapshot();
       pair->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
@@ -196,7 +175,7 @@ static void set_acceptance_pair_reached(mc_pair_t pair){
     size_t current_bytes_used = pair->heap_bytes_used;
     int current_nb_processes = pair->nb_processes;
 
-    unsigned int cursor = 0;
+    int cursor = 0;
     int start = 0;
     int end = xbt_dynar_length(acceptance_pairs) - 1;
 
@@ -226,19 +205,20 @@ static void set_acceptance_pair_reached(mc_pair_t pair){
     if(bytes_used_test < current_bytes_used)
       xbt_dynar_insert_at(acceptance_pairs, cursor + 1, &pair);
     else
-      xbt_dynar_insert_at(acceptance_pairs, cursor, &pair);
-    
-    MC_UNSET_RAW_MEM;
-    
+      xbt_dynar_insert_at(acceptance_pairs, cursor, &pair);    
   }
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
     
 }
 
 static void remove_acceptance_pair(mc_pair_t pair){
 
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  MC_SET_RAW_MEM;
+
   unsigned int cursor = 0;
   mc_pair_t pair_test;
   int pair_found = 0;
@@ -263,6 +243,8 @@ static void remove_acceptance_pair(mc_pair_t pair){
     }
   }
 
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 }
 
 static int is_visited_pair(mc_pair_t pair){
@@ -272,203 +254,94 @@ static int is_visited_pair(mc_pair_t pair){
 
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
+  MC_SET_RAW_MEM;
+
   if(xbt_dynar_is_empty(visited_pairs)){
 
-    MC_SET_RAW_MEM;
     if(pair->graph_state->system_state == NULL)
       pair->graph_state->system_state = MC_take_snapshot();
     xbt_dynar_push(visited_pairs, &pair); 
-    MC_UNSET_RAW_MEM;
 
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
+    if(!raw_mem_set)
+      MC_UNSET_RAW_MEM;
 
     return -1;
 
   }else{
 
-    MC_SET_RAW_MEM;
-
     if(pair->graph_state->system_state == NULL)
       pair->graph_state->system_state = MC_take_snapshot();
-    
-    size_t current_bytes_used = pair->heap_bytes_used;
-    int current_nb_processes = pair->nb_processes;
-
-    unsigned int cursor = 0;
-    int previous_cursor = 0, next_cursor = 0;
-    int start = 0;
-    int end = xbt_dynar_length(visited_pairs) - 1;
 
-    mc_pair_t pair_test = NULL;
-    size_t bytes_used_test;
-    int nb_processes_test;
-    int same_processes_and_bytes_not_found = 1;
-
-    while(start <= end && same_processes_and_bytes_not_found){
-      cursor = (start + end) / 2;
-      pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, cursor, mc_pair_t);
-      bytes_used_test = pair_test->heap_bytes_used;
-      nb_processes_test = pair_test->nb_processes;
-      if(nb_processes_test < current_nb_processes)
-        start = cursor + 1;
-      else if(nb_processes_test > current_nb_processes)
-        end = cursor - 1; 
-      else if(nb_processes_test == current_nb_processes){
-        if(bytes_used_test < current_bytes_used)
-          start = cursor + 1;
-        else if(bytes_used_test > current_bytes_used)
-          end = cursor - 1;
-        else if(bytes_used_test == current_bytes_used){
-          same_processes_and_bytes_not_found = 0;
-          if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-            if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){
-              if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                if(pair_test->other_num == -1)
-                  pair->other_num = pair_test->num;
-                else
-                  pair->other_num = pair_test->other_num;
-                if(dot_output == NULL)
-                  XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", pair->num, pair_test->num);
-                else
-                  XBT_DEBUG("Pair %d already visited ! (equal to pair %d (pair %d in dot_output))", pair->num, pair_test->num, pair->other_num);
-                xbt_dynar_remove_at(visited_pairs, cursor, NULL);
-                xbt_dynar_insert_at(visited_pairs, cursor, &pair);
-                pair_test->visited_removed = 1;
-                if(pair_test->stack_removed && pair_test->visited_removed){
-                  if((pair_test->automaton_state->type == 1) || (pair_test->automaton_state->type == 2)){
-                    if(pair_test->acceptance_removed){ 
-                      MC_pair_delete(pair_test);
-                    }
-                  }else{
-                    MC_pair_delete(pair_test);
-                  }     
-                }
-                if(raw_mem_set)
-                  MC_SET_RAW_MEM;
-                else
-                  MC_UNSET_RAW_MEM;
-                return pair->other_num;
-              }
-            }
-          }
-          /* Search another pair with same number of bytes used in std_heap */
-          previous_cursor = cursor - 1;
-          while(previous_cursor >= 0){
-            pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, previous_cursor, mc_pair_t);
-            bytes_used_test = pair_test->heap_bytes_used;
-            if(bytes_used_test != current_bytes_used)
-              break;
-            if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-              if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){  
-                if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                  if(pair_test->other_num == -1)
-                    pair->other_num = pair_test->num;
-                  else
-                    pair->other_num = pair_test->other_num;
-                  if(dot_output == NULL)
-                    XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", pair->num, pair_test->num);
-                  else
-                    XBT_DEBUG("Pair %d already visited ! (equal to pair %d (pair %d in dot_output))", pair->num, pair_test->num, pair->other_num);
-                  xbt_dynar_remove_at(visited_pairs, previous_cursor, NULL);
-                  xbt_dynar_insert_at(visited_pairs, previous_cursor, &pair);
-                  pair_test->visited_removed = 1;
-                  if(pair_test->stack_removed && pair_test->visited_removed){
-                    if((pair_test->automaton_state->type == 1) || (pair_test->automaton_state->type == 2)){
-                      if(pair_test->acceptance_removed){ 
-                        MC_pair_delete(pair_test);
-                      }
-                    }else{
-                      MC_pair_delete(pair_test);
-                    }     
-                  }
-                  if(raw_mem_set)
-                    MC_SET_RAW_MEM;
-                  else
-                    MC_UNSET_RAW_MEM;
-                  return pair->other_num;
-                }
-              }
+    int min = -1, max = -1, index;
+    int res;
+    mc_pair_t pair_test;
+
+    index = get_search_interval(visited_pairs, pair, &min, &max);
+
+    if(min != -1 && max != -1){ /* Visited pair with same number of processes and same heap bytes used exists */
+      res = xbt_parmap_mc_apply(parmap, snapshot_compare, xbt_dynar_get_ptr(visited_pairs, min), (max-min)+1, pair);
+      if(res != -1){
+        pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, (min+res)-1, mc_pair_t);
+        if(pair_test->other_num == -1)
+          pair->other_num = pair_test->num;
+        else
+          pair->other_num = pair_test->other_num;
+        if(dot_output == NULL)
+          XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", pair->num, pair_test->num);
+        else
+          XBT_DEBUG("Pair %d already visited ! (equal to pair %d (pair %d in dot_output))", pair->num, pair_test->num, pair->other_num);
+        xbt_dynar_remove_at(visited_pairs, (min + res) - 1, NULL);
+        xbt_dynar_insert_at(visited_pairs, (min+res) - 1, &pair);
+        pair_test->visited_removed = 1;
+        if(pair_test->stack_removed && pair_test->visited_removed){
+          if((pair_test->automaton_state->type == 1) || (pair_test->automaton_state->type == 2)){
+            if(pair_test->acceptance_removed){
+              MC_pair_delete(pair_test);
             }
-            previous_cursor--;
-          }
-          next_cursor = cursor + 1;
-          while(next_cursor < xbt_dynar_length(visited_pairs)){
-            pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, next_cursor, mc_pair_t);
-            bytes_used_test = pair_test->heap_bytes_used;
-            if(bytes_used_test != current_bytes_used)
-              break;
-            if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-              if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){
-                if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                  if(pair_test->other_num == -1)
-                    pair->other_num = pair_test->num;
-                  else
-                    pair->other_num = pair_test->other_num;
-                  if(dot_output == NULL)
-                    XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", pair->num, pair_test->num);
-                  else
-                    XBT_DEBUG("Pair %d already visited ! (equal to pair %d (pair %d in dot_output))", pair->num, pair_test->num, pair->other_num);
-                  xbt_dynar_remove_at(visited_pairs, next_cursor, NULL);
-                  xbt_dynar_insert_at(visited_pairs, next_cursor, &pair);
-                  pair_test->visited_removed = 1;
-                  if(pair_test->stack_removed && pair_test->visited_removed){
-                    if((pair_test->automaton_state->type == 1) || (pair_test->automaton_state->type == 2)){
-                      if(pair_test->acceptance_removed){ 
-                        MC_pair_delete(pair_test);
-                      }
-                    }else{
-                      MC_pair_delete(pair_test);
-                    }     
-                  }
-                  if(raw_mem_set)
-                    MC_SET_RAW_MEM;
-                  else
-                    MC_UNSET_RAW_MEM;
-                  return pair->other_num;
-                }
-              }
-            }
-            next_cursor++;
+          }else{
+            MC_pair_delete(pair_test);
           }
         }
+        if(!raw_mem_set)
+          MC_UNSET_RAW_MEM;
+        return pair->other_num;
+      }
+      xbt_dynar_insert_at(visited_pairs, min, &pair);
+    }else{
+      pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, index, mc_pair_t);
+      if(pair_test->nb_processes < pair->nb_processes){
+        xbt_dynar_insert_at(visited_pairs, index+1, &pair);
+      }else{
+        if(pair_test->heap_bytes_used < pair->heap_bytes_used)
+          xbt_dynar_insert_at(visited_pairs, index + 1, &pair);
+        else
+          xbt_dynar_insert_at(visited_pairs, index, &pair);
       }
     }
 
-    pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, cursor, mc_pair_t);
-    bytes_used_test = pair_test->heap_bytes_used;
-
-    if(bytes_used_test < current_bytes_used)
-      xbt_dynar_insert_at(visited_pairs, cursor + 1, &pair);
-    else
-      xbt_dynar_insert_at(visited_pairs, cursor, &pair);
-
     if(xbt_dynar_length(visited_pairs) > _sg_mc_visited){
       int min = mc_stats->expanded_states;
       unsigned int cursor2 = 0;
-      unsigned int index = 0;
+      unsigned int index2 = 0;
       xbt_dynar_foreach(visited_pairs, cursor2, pair_test){
         if(pair_test->num < min){
           index = cursor2;
           min = pair_test->num;
         }
       }
-      xbt_dynar_remove_at(visited_pairs, index, &pair_test);
+      xbt_dynar_remove_at(visited_pairs, index2, &pair_test);
       pair_test->visited_removed = 1;
       if(pair_test->stack_removed && pair_test->acceptance_removed && pair_test->visited_removed)
         MC_pair_delete(pair_test);
       
     }
 
-    MC_UNSET_RAW_MEM;
-
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
+    if(!raw_mem_set)
+      MC_UNSET_RAW_MEM;
     
     return -1;
-    
+
   }
 }
 
 static int MC_automaton_evaluate_label(xbt_automaton_exp_label_t l, xbt_dynar_t atomic_propositions_values){
@@ -625,7 +498,7 @@ void MC_ddfs(){
   /* Update current state in buchi automaton */
   _mc_property_automaton->current_state = current_pair->automaton_state;
 
-  XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness), current_pair->search_cycle);
+  XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d, interleave size %d)", xbt_fifo_size(mc_stack_liveness), current_pair->search_cycle, MC_state_interleave_size(current_pair->graph_state));
  
   mc_stats->visited_pairs++;
 
@@ -637,7 +510,6 @@ void MC_ddfs(){
   unsigned int cursor = 0;
   int res;
   int reached_num, visited_num;
-  int new_pair = 0;
 
   mc_pair_t next_pair = NULL;
   xbt_dynar_t prop_values = NULL;
@@ -731,9 +603,6 @@ void MC_ddfs(){
 
             if(res == 1){ // enabled transition in automaton
 
-              if(new_pair)
-               MC_replay_liveness(mc_stack_liveness, 1); 
-
               MC_SET_RAW_MEM;
 
               next_pair = MC_pair_new();
@@ -760,8 +629,6 @@ void MC_ddfs(){
 
               MC_UNSET_RAW_MEM;
 
-              new_pair = 1;
-
               MC_ddfs();
 
             }
@@ -775,9 +642,6 @@ void MC_ddfs(){
             res = MC_automaton_evaluate_label(transition_succ->label, prop_values);
   
             if(res == 2){ // true transition in automaton
-
-              if(new_pair)
-                MC_replay_liveness(mc_stack_liveness, 1); 
             
               MC_SET_RAW_MEM;
             
@@ -805,8 +669,6 @@ void MC_ddfs(){
             
               MC_UNSET_RAW_MEM;
 
-              new_pair = 1;
-
               MC_ddfs();
 
             }
@@ -871,9 +733,6 @@ void MC_ddfs(){
 
           if(res == 1){ // enabled transition in automaton
 
-            if(new_pair)
-              MC_replay_liveness(mc_stack_liveness, 1);
-
             MC_SET_RAW_MEM;
 
             next_pair = MC_pair_new();
@@ -895,8 +754,6 @@ void MC_ddfs(){
 
             MC_UNSET_RAW_MEM;
 
-            new_pair = 1;
-
             MC_ddfs();
 
           }
@@ -911,9 +768,6 @@ void MC_ddfs(){
   
           if(res == 2){ // true transition in automaton
 
-            if(new_pair)
-              MC_replay_liveness(mc_stack_liveness, 1);
-
             MC_SET_RAW_MEM;
             
             next_pair = MC_pair_new();
@@ -935,8 +789,6 @@ void MC_ddfs(){
 
             MC_UNSET_RAW_MEM;
 
-            new_pair = 1;
-
             MC_ddfs();
 
           }
@@ -975,6 +827,7 @@ void MC_ddfs(){
     else if(current_pair->visited_removed)
       MC_pair_delete(current_pair);
   }
+
   MC_UNSET_RAW_MEM;
 
 }
index 596e5eb..c417ede 100644 (file)
@@ -23,6 +23,7 @@
 #include "msg/msg.h"
 #include "msg/datatypes.h"
 #include "xbt/strbuff.h"
+#include "xbt/parmap.h"
 
 /****************************** Snapshots ***********************************/
 
@@ -75,6 +76,7 @@ extern xbt_dynar_t mc_checkpoint_ignore;
 extern double *mc_time;
 extern FILE *dot_output;
 extern const char* colors[13];
+extern xbt_parmap_t parmap;
 
 extern int user_max_depth_reached;
 
@@ -249,10 +251,10 @@ typedef struct s_mc_comparison_times{
   double hash_local_variables_comparison_time;
 }s_mc_comparison_times_t, *mc_comparison_times_t;
 
-extern mc_comparison_times_t mc_comp_times;
-extern double mc_snapshot_comparison_time;
+extern __thread mc_comparison_times_t mc_comp_times;
+extern __thread double mc_snapshot_comparison_time;
 
-int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2);
+int snapshot_compare(void *p1, void *p2);
 int SIMIX_pre_mc_compare_snapshots(smx_simcall_t simcall, mc_snapshot_t s1, mc_snapshot_t s2);
 void print_comparison_times(void);
 
index f6ee22b..7b49fe7 100644 (file)
@@ -13,7 +13,7 @@
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg);
 
 /** @addtogroup m_host_management
- *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Hosts" --> \endhtmlonly
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Hosts" --> \endhtmlonly
  * (#msg_host_t) and the functions for managing it.
  *  
  *  A <em>location</em> (or <em>host</em>) is any possible place where
index 4cde27c..ed88e74 100644 (file)
@@ -11,7 +11,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg,
                                 "Logging specific to MSG (io)");
 
 /** @addtogroup msg_file_management
- *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Files" --> \endhtmlonly
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Files" --> \endhtmlonly
  * (#msg_file_t) and the functions for managing it.
  *
  *  \see #msg_file_t
@@ -181,7 +181,7 @@ xbt_dict_t MSG_file_ls(const char *mount, const char *path)
 /********************************* Storage **************************************/
 
 /** @addtogroup msg_storage_management
- *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Storages" --> \endhtmlonly
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Storages" --> \endhtmlonly
  * (#msg_storage_t) and the functions for managing it.
  *
  */
@@ -215,7 +215,7 @@ const char *MSG_storage_get_name(msg_storage_t storage) {
 
 /** \ingroup msg_storage_management
  * \brief Returns the free space size of a storage element
- * \param the storage name (#char*)
+ * \param name the name of a storage
  * \return the free space size of the storage element (as a size_t)
  */
 size_t MSG_storage_get_free_size(const char* name){
@@ -224,7 +224,7 @@ size_t MSG_storage_get_free_size(const char* name){
 
 /** \ingroup msg_storage_management
  * \brief Returns the used space size of a storage element
- * \param the storage name (#char*)
+ * \param name the name of a storage
  * \return the used space size of the storage element (as a size_t)
  */
 size_t MSG_storage_get_used_size(const char* name){
@@ -244,7 +244,7 @@ xbt_dict_t MSG_storage_get_properties(msg_storage_t storage)
 
 /** \ingroup msg_storage_management
  * \brief Finds a msg_storage_t using its name.
- * \param name the name of a storage.
+ * \param name the name of a storage
  * \return the corresponding storage
  */
 msg_storage_t MSG_storage_get_by_name(const char *name)
index be51825..449c5ae 100644 (file)
@@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg,
                                 "Logging specific to MSG (process)");
 
 /** @addtogroup m_process_management
- *    \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Processes" --> \endhtmlonly
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Processes" --> \endhtmlonly
  *
  *  We need to simulate many independent scheduling decisions, so
  *  the concept of <em>process</em> is at the heart of the
index fe33f2b..1a59ae0 100644 (file)
@@ -11,7 +11,7 @@
 #include "xbt/log.h"
 #include "xbt/mallocator.h"
 #include "xbt/str.h"
-#include "xbt/lib.h" 
+#include "xbt/lib.h"
 #include "xbt/sysdep.h"
 #include "surf/surf.h"
 #include "surf/maxmin.h"
@@ -94,7 +94,7 @@ static void sg_config_cmd_line(int *argc, char **argv)
     *argc = j;
   }
   if (shall_exit) {
-    _sg_init_status=1; // get everything cleanly cleaned on exit
+    _sg_init_status = 1;        // get everything cleanly cleaned on exit
     exit(0);
   }
 }
@@ -104,7 +104,7 @@ static void _sg_cfg_cb__workstation_model(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
@@ -123,7 +123,7 @@ static void _sg_cfg_cb__cpu_model(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
@@ -142,7 +142,7 @@ static void _sg_cfg_cb__optimization_mode(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
@@ -161,7 +161,7 @@ static void _sg_cfg_cb__storage_mode(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
@@ -180,7 +180,7 @@ static void _sg_cfg_cb__network_model(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
@@ -194,7 +194,6 @@ static void _sg_cfg_cb__network_model(const char *name, int pos)
   find_model_description(surf_network_model_description, val);
 }
 
-
 /* callbacks of the network models values */
 static void _sg_cfg_cb__tcp_gamma(const char *name, int pos)
 {
@@ -229,12 +228,12 @@ static void _sg_cfg_cb__weight_S(const char *name, int pos)
 #ifdef HAVE_SMPI
 /* callback of the mpi collectives */
 static void _sg_cfg_cb__coll(const char *category,
-                            s_mpi_coll_description_t * table,
-                            const char *name, int pos)
+                             s_mpi_coll_description_t * table,
+                             const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
@@ -262,19 +261,19 @@ static void _sg_cfg_cb__coll_allreduce(const char *name, int pos)
 }
 static void _sg_cfg_cb__coll_alltoall(const char *name, int pos)
 {
-  _sg_cfg_cb__coll("alltoall", mpi_coll_alltoall_description, name, pos);  
+  _sg_cfg_cb__coll("alltoall", mpi_coll_alltoall_description, name, pos);
 }
 static void _sg_cfg_cb__coll_alltoallv(const char *name, int pos)
 {
-  _sg_cfg_cb__coll("alltoallv", mpi_coll_alltoallv_description, name, pos);  
+  _sg_cfg_cb__coll("alltoallv", mpi_coll_alltoallv_description, name, pos);
 }
 static void _sg_cfg_cb__coll_bcast(const char *name, int pos)
 {
-  _sg_cfg_cb__coll("bcast", mpi_coll_bcast_description, name, pos);  
+  _sg_cfg_cb__coll("bcast", mpi_coll_bcast_description, name, pos);
 }
 static void _sg_cfg_cb__coll_reduce(const char *name, int pos)
 {
-  _sg_cfg_cb__coll("reduce", mpi_coll_reduce_description, name, pos);  
+  _sg_cfg_cb__coll("reduce", mpi_coll_reduce_description, name, pos);
 }
 static void _sg_cfg_cb__coll_reduce_scatter(const char *name, int pos){
   _sg_cfg_cb__coll("reduce_scatter", mpi_coll_reduce_scatter_description, name, pos);
@@ -325,8 +324,8 @@ static void _sg_cfg_cb_clean_atexit(const char *name, int pos)
   _sg_do_clean_atexit = xbt_cfg_get_boolean(_sg_cfg_set, name);
 }
 
-
-static void _sg_cfg_cb_context_factory(const char *name, int pos) {
+static void _sg_cfg_cb_context_factory(const char *name, int pos)
+{
   smx_context_factory_name = xbt_cfg_get_string(_sg_cfg_set, name);
 }
 
@@ -360,12 +359,12 @@ static void _sg_cfg_cb_contexts_parallel_mode(const char *name, int pos)
   }
   else {
     xbt_die("Command line setting of the parallel synchronization mode should "
-        "be one of \"posix\", \"futex\" or \"busy_wait\"");
+            "be one of \"posix\", \"futex\" or \"busy_wait\"");
   }
 }
 
 static void _sg_cfg_cb__surf_network_coordinates(const char *name,
-                                                   int pos)
+                                                 int pos)
 {
   int val = xbt_cfg_get_boolean(_sg_cfg_set, name);
   if (val) {
@@ -400,9 +399,6 @@ static void _sg_cfg_cb__gtnets_jitter_seed(const char *name, int pos)
 void sg_config_init(int *argc, char **argv)
 {
   char *description = xbt_malloc(1024), *p = description;
-  char *default_value;
-  double double_default_value;
-  int default_value_int;
   int i;
 
   /* Create the configuration support */
@@ -416,9 +412,9 @@ void sg_config_init(int *argc, char **argv)
                    surf_cpu_model_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("Cas01");
     xbt_cfg_register(&_sg_cfg_set, "cpu/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__cpu_model, NULL);
+                     NULL, 1, 1, &_sg_cfg_cb__cpu_model, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "cpu/model", "Cas01");
 
     sprintf(description,
             "The optimization modes to use for the CPU. Possible values: ");
@@ -429,9 +425,9 @@ void sg_config_init(int *argc, char **argv)
                    surf_optimization_mode_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each optimization mode)");
-    default_value = xbt_strdup("Lazy");
     xbt_cfg_register(&_sg_cfg_set, "cpu/optim", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+                     NULL, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "cpu/optim", "Lazy");
 
     sprintf(description,
             "The model to use for the storage. Possible values: ");
@@ -442,10 +438,10 @@ void sg_config_init(int *argc, char **argv)
                    surf_storage_model_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("default");
     xbt_cfg_register(&_sg_cfg_set, "storage/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__storage_mode,
+                     NULL, 1, 1, &_sg_cfg_cb__storage_mode,
                      NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "storage/model", "default");
 
     /* ********************************************************************* */
     /* TUTORIAL: New model                                                   */
@@ -458,10 +454,10 @@ void sg_config_init(int *argc, char **argv)
                    surf_new_model_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("default");
     xbt_cfg_register(&_sg_cfg_set, "new_model/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__storage_mode,
+                     NULL, 1, 1, &_sg_cfg_cb__storage_mode,
                      NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "new_model/model", "default");
     /* ********************************************************************* */
 
     sprintf(description,
@@ -473,10 +469,10 @@ void sg_config_init(int *argc, char **argv)
                    surf_network_model_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("LV08");
     xbt_cfg_register(&_sg_cfg_set, "network/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__network_model,
+                     NULL, 1, 1, &_sg_cfg_cb__network_model,
                      NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "network/model", "LV08");
 
     sprintf(description,
             "The optimization modes to use for the network. Possible values: ");
@@ -487,9 +483,9 @@ void sg_config_init(int *argc, char **argv)
                    surf_optimization_mode_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each optimization mode)");
-    default_value = xbt_strdup("Lazy");
     xbt_cfg_register(&_sg_cfg_set, "network/optim", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+                     NULL, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "network/optim", "Lazy");
 
     sprintf(description,
             "The model to use for the workstation. Possible values: ");
@@ -500,10 +496,10 @@ void sg_config_init(int *argc, char **argv)
                    surf_workstation_model_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("default");
     xbt_cfg_register(&_sg_cfg_set, "workstation/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1,
+                     NULL, 1, 1,
                      &_sg_cfg_cb__workstation_model, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "workstation/model", "default");
 
     xbt_free(description);
 
@@ -516,7 +512,7 @@ void sg_config_init(int *argc, char **argv)
     xbt_cfg_register(&_sg_cfg_set, "maxmin/precision",
                      "Numerical precision used when updating simulation models (epsilon in double comparisons)",
                      xbt_cfgelm_double, NULL, 1, 1, _sg_cfg_cb__maxmin_precision, NULL);
-    xbt_cfg_setdefault_double(_sg_cfg_set, "maxmin/precision", 0.00001); 
+    xbt_cfg_setdefault_double(_sg_cfg_set, "maxmin/precision", 0.00001);
 
     /* The parameters of network models */
 
@@ -525,16 +521,16 @@ void sg_config_init(int *argc, char **argv)
                      xbt_cfgelm_double, NULL, 1, 1, /* default is set in network.c */
                      _sg_cfg_cb__sender_gap, NULL);
 
-    double_default_value = 1.0; // FIXME use setdefault everywhere here!
     xbt_cfg_register(&_sg_cfg_set, "network/latency_factor",
                      "Correction factor to apply to the provided latency (default value set by network model)",
-                     xbt_cfgelm_double, &double_default_value, 1, 1,
+                     xbt_cfgelm_double, NULL, 1, 1,
                      _sg_cfg_cb__latency_factor, NULL);
-    double_default_value = 1.0;
+    xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
     xbt_cfg_register(&_sg_cfg_set, "network/bandwidth_factor",
                      "Correction factor to apply to the provided bandwidth (default value set by network model)",
-                     xbt_cfgelm_double, &double_default_value, 1, 1,
+                     xbt_cfgelm_double, NULL, 1, 1,
                      _sg_cfg_cb__bandwidth_factor, NULL);
+    xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor", 1.0);
 
     xbt_cfg_register(&_sg_cfg_set, "network/weight_S",
                      "Correction factor to apply to the weight of competing streams (default value set by network model)",
@@ -547,34 +543,33 @@ void sg_config_init(int *argc, char **argv)
                      xbt_cfgelm_string, NULL, 0, 0,
                      _sg_cfg_cb__surf_path, NULL);
 
-    default_value = xbt_strdup("off");
     xbt_cfg_register(&_sg_cfg_set, "cpu/maxmin_selective_update",
                      "Update the constraint set propagating recursively to others constraints (off by default when optim is set to lazy)",
-                     xbt_cfgelm_boolean, &default_value, 0, 1,
+                     xbt_cfgelm_boolean, NULL, 0, 1,
                      NULL, NULL);
-    default_value = xbt_strdup("off");
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "cpu/maxmin_selective_update", "no");
+
     xbt_cfg_register(&_sg_cfg_set, "network/maxmin_selective_update",
                      "Update the constraint set propagating recursively to others constraints (off by default when optim is set to lazy)",
-                     xbt_cfgelm_boolean, &default_value, 0, 1,
+                     xbt_cfgelm_boolean, NULL, 0, 1,
                      NULL, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/maxmin_selective_update", "no");
 
 #ifdef HAVE_MC
     /* do model-checking */
-    default_value = xbt_strdup("off");
     xbt_cfg_register(&_sg_cfg_set, "model-check",
                      "Verify the system through model-checking instead of simulating it (EXPERIMENTAL)",
                      xbt_cfgelm_boolean, NULL, 0, 1,
                      _sg_cfg_cb_model_check, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check", default_value);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check", "no");
 
     /* do stateful model-checking */
-    default_value = xbt_strdup("off");
     xbt_cfg_register(&_sg_cfg_set, "model-check/checkpoint",
-                     "Specify the amount of steps between checkpoints during stateful model-checking (default: off => stateless verification). "
+                     "Specify the amount of steps between checkpoints during stateful model-checking (default: 0 => stateless verification). "
                      "If value=on, one checkpoint is saved for each step => faster verification, but huge memory consumption; higher values are good compromises between speed and memory consumption.",
-                     xbt_cfgelm_boolean, NULL, 0, 1,
+                     xbt_cfgelm_int, NULL, 0, 1,
                      _mc_cfg_cb_checkpoint, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/checkpoint", default_value);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "model-check/checkpoint", 0);
     
     /* do liveness model-checking */
     xbt_cfg_register(&_sg_cfg_set, "model-check/property",
@@ -591,12 +586,11 @@ void sg_config_init(int *argc, char **argv)
     xbt_cfg_setdefault_string(_sg_cfg_set, "model-check/reduction", "dpor");
 
     /* Enable/disable timeout for wait requests with model-checking */
-    default_value = xbt_strdup("off");
     xbt_cfg_register(&_sg_cfg_set, "model-check/timeout",
                      "Enable/Disable timeout for wait requests",
                      xbt_cfgelm_boolean, NULL, 0, 1,
                      _mc_cfg_cb_timeout, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/timeout", default_value);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/timeout", "no");
 
     /* Set max depth exploration */
     xbt_cfg_register(&_sg_cfg_set, "model-check/max_depth",
@@ -621,64 +615,61 @@ void sg_config_init(int *argc, char **argv)
 #endif
 
     /* do verbose-exit */
-    default_value = xbt_strdup("on");
     xbt_cfg_register(&_sg_cfg_set, "verbose-exit",
                      "Activate the \"do nothing\" mode in Ctrl-C",
-                     xbt_cfgelm_boolean, &default_value, 0, 1,
+                     xbt_cfgelm_boolean, NULL, 0, 1,
                      _sg_cfg_cb_verbose_exit, NULL);
-    
-    
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "verbose-exit", "yes");
+
     /* context factory */
-    default_value = xbt_strdup("ucontext");
     xbt_cfg_register(&_sg_cfg_set, "contexts/factory",
                      "Context factory to use in SIMIX (ucontext, thread or raw)",
-                     xbt_cfgelm_string, &default_value, 1, 1, _sg_cfg_cb_context_factory, NULL);
+                     xbt_cfgelm_string, NULL, 1, 1, _sg_cfg_cb_context_factory, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/factory", "ucontext");
 
     /* stack size of contexts in Ko */
-    default_value_int = 128;
     xbt_cfg_register(&_sg_cfg_set, "contexts/stack_size",
                      "Stack size of contexts in Kib (ucontext or raw only)",
-                     xbt_cfgelm_int, &default_value_int, 1, 1,
+                     xbt_cfgelm_int, NULL, 1, 1,
                      _sg_cfg_cb_context_stack_size, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/stack_size", 128);
 
     /* number of parallel threads for user processes */
-    default_value_int = 1;
     xbt_cfg_register(&_sg_cfg_set, "contexts/nthreads",
                      "Number of parallel threads used to execute user contexts",
-                     xbt_cfgelm_int, &default_value_int, 1, 1,
+                     xbt_cfgelm_int, NULL, 1, 1,
                      _sg_cfg_cb_contexts_nthreads, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/nthreads", 1);
 
     /* minimal number of user contexts to be run in parallel */
-    default_value_int = 2;
     xbt_cfg_register(&_sg_cfg_set, "contexts/parallel_threshold",
         "Minimal number of user contexts to be run in parallel (raw contexts only)",
-        xbt_cfgelm_int, &default_value_int, 1, 1,
+        xbt_cfgelm_int, NULL, 1, 1,
         _sg_cfg_cb_contexts_parallel_threshold, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/parallel_threshold", 2);
 
     /* synchronization mode for parallel user contexts */
-#ifdef HAVE_FUTEX_H
-    default_value = xbt_strdup("futex");
-#else //No futex on mac and posix is unimplememted yet
-    default_value = xbt_strdup("busy_wait");
-#endif
     xbt_cfg_register(&_sg_cfg_set, "contexts/synchro",
         "Synchronization mode to use when running contexts in parallel (either futex, posix or busy_wait)",
-        xbt_cfgelm_string, &default_value, 1, 1,
+        xbt_cfgelm_string, NULL, 1, 1,
         _sg_cfg_cb_contexts_parallel_mode, NULL);
+#ifdef HAVE_FUTEX_H
+    xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/synchro", "futex");
+#else //No futex on mac and posix is unimplememted yet
+    xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/synchro", "busy_wait");
+#endif
 
-    default_value = xbt_strdup("no");
     xbt_cfg_register(&_sg_cfg_set, "network/coordinates",
                      "\"yes\" or \"no\", specifying whether we use a coordinate-based routing (as Vivaldi)",
-                     xbt_cfgelm_boolean, &default_value, 1, 1,
+                     xbt_cfgelm_boolean, NULL, 1, 1,
                      _sg_cfg_cb__surf_network_coordinates, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/coordinates", default_value);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/coordinates", "no");
 
-    default_value = xbt_strdup("no");
     xbt_cfg_register(&_sg_cfg_set, "network/crosstraffic",
                      "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM02)",
-                     xbt_cfgelm_boolean, &default_value, 0, 1,
+                     xbt_cfgelm_boolean, NULL, 0, 1,
                      _sg_cfg_cb__surf_network_crosstraffic, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", default_value);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", "no");
 
 #ifdef HAVE_GTNETS
     xbt_cfg_register(&_sg_cfg_set, "gtnets/jitter",
@@ -687,11 +678,11 @@ void sg_config_init(int *argc, char **argv)
                      _sg_cfg_cb__gtnets_jitter, NULL);
     xbt_cfg_setdefault_double(_sg_cfg_set, "gtnets/jitter", 0.0);
 
-    default_value_int = 10;
     xbt_cfg_register(&_sg_cfg_set, "gtnets/jitter_seed",
                      "Use a positive seed to reproduce jitted results, value must be in [1,1e8], default is 10",
-                     xbt_cfgelm_int, &default_value_int, 0, 1,
+                     xbt_cfgelm_int, NULL, 0, 1,
                      _sg_cfg_cb__gtnets_jitter_seed, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "gtnets/jitter_seed", 10);
 #endif
 #ifdef HAVE_NS3
     xbt_cfg_register(&_sg_cfg_set, "ns3/TcpModel",
@@ -702,43 +693,41 @@ void sg_config_init(int *argc, char **argv)
 #endif
 
 #ifdef HAVE_SMPI
-    double default_reference_speed = 20000.0;
     xbt_cfg_register(&_sg_cfg_set, "smpi/running_power",
                      "Power of the host running the simulation (in flop/s). Used to bench the operations.",
-                     xbt_cfgelm_double, &default_reference_speed, 1, 1, NULL,
+                     xbt_cfgelm_double, NULL, 1, 1, NULL,
                      NULL);
+    xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/running_power", 20000.0);
 
-    default_value = xbt_strdup("no");
     xbt_cfg_register(&_sg_cfg_set, "smpi/display_timing",
                      "Boolean indicating whether we should display the timing after simulation.",
-                     xbt_cfgelm_boolean, &default_value, 1, 1, NULL,
+                     xbt_cfgelm_boolean, NULL, 1, 1, NULL,
                      NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/display_timing", default_value);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/display_timing", "no");
 
-    default_value = xbt_strdup("yes");
     xbt_cfg_register(&_sg_cfg_set, "smpi/use_shared_malloc",
                      "Boolean indicating whether we should use shared memory when using SMPI_SHARED_MALLOC. Allows user to disable it for debug purposes.",
-                     xbt_cfgelm_boolean, &default_value, 1, 1, NULL,
+                     xbt_cfgelm_boolean, NULL, 1, 1, NULL,
                      NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/use_shared_malloc", default_value);
-    
-    double default_threshold = 1e-6;
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/use_shared_malloc", "yes");
+
     xbt_cfg_register(&_sg_cfg_set, "smpi/cpu_threshold",
                      "Minimal computation time (in seconds) not discarded.",
-                     xbt_cfgelm_double, &default_threshold, 1, 1, NULL,
+                     xbt_cfgelm_double, NULL, 1, 1, NULL,
                      NULL);
+    xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/cpu_threshold", 1e-6);
 
-    int default_small_messages_threshold = 0;
     xbt_cfg_register(&_sg_cfg_set, "smpi/async_small_thres",
                      "Maximal size of messages that are to be sent asynchronously, without waiting for the receiver",
-                     xbt_cfgelm_int, &default_small_messages_threshold, 1, 1, NULL,
+                     xbt_cfgelm_int, NULL, 1, 1, NULL,
                      NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/async_small_thres", 0);
 
-    int default_send_is_detached_threshold = 65536;
     xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thres",
                      "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend",
-                     xbt_cfgelm_int, &default_send_is_detached_threshold, 1, 1, NULL,
+                     xbt_cfgelm_int, NULL, 1, 1, NULL,
                      NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/send_is_detached_thres", 65536);
 
     //For smpi/bw_factor and smpi/lat_factor
     //Default value have to be "threshold0:value0;threshold1:value1;...;thresholdN:valueN"
@@ -774,82 +763,81 @@ void sg_config_init(int *argc, char **argv)
                      xbt_cfgelm_string, NULL, 1, 1, NULL,
                      NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/or", "1:0:0:0:0");
-    double default_iprobe_time = 1e-4;
     xbt_cfg_register(&_sg_cfg_set, "smpi/iprobe",
                      "Minimum time to inject inside a call to MPI_Iprobe",
-                     xbt_cfgelm_double, &default_iprobe_time, 1, 1, NULL,
+                     xbt_cfgelm_double, NULL, 1, 1, NULL,
                      NULL);
-    default_value = xbt_strdup("default");
+    xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/iprobe", 1e-4);
     xbt_cfg_register(&_sg_cfg_set, "smpi/coll_selector",
-                    "Which collective selector to use",
-                    xbt_cfgelm_string, &default_value, 1, 1, NULL,
-                    NULL);
-                    
-               xbt_cfg_register(&_sg_cfg_set, "smpi/gather",
-                    "Which collective to use for gather",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_gather,
-                    NULL);
-                    
+                     "Which collective selector to use",
+                     xbt_cfgelm_string, NULL, 1, 1, NULL,
+                     NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/coll_selector", "default");
+
+    xbt_cfg_register(&_sg_cfg_set, "smpi/gather",
+                     "Which collective to use for gather",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_gather,
+                     NULL);
+
     xbt_cfg_register(&_sg_cfg_set, "smpi/allgather",
-                    "Which collective to use for allgather",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allgather,
-                    NULL);
+                     "Which collective to use for allgather",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allgather,
+                     NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/barrier",
-                    "Which collective to use for barrier",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_barrier,
-                    NULL);
+                     "Which collective to use for barrier",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_barrier,
+                     NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/reduce_scatter",
-                    "Which collective to use for reduce_scatter",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_reduce_scatter,
-                    NULL);
+                     "Which collective to use for reduce_scatter",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_reduce_scatter,
+                     NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/scatter",
-                    "Which collective to use for scatter",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_scatter,
-                    NULL);
+                     "Which collective to use for scatter",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_scatter,
+                     NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/allgatherv",
-                    "Which collective to use for allgatherv",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allgatherv,
-                    NULL);
+                     "Which collective to use for allgatherv",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allgatherv,
+                     NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/allreduce",
-                    "Which collective to use for allreduce",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allreduce,
-                    NULL);
+                     "Which collective to use for allreduce",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allreduce,
+                     NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/alltoall",
-                    "Which collective to use for alltoall",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_alltoall,
-                    NULL);
+                     "Which collective to use for alltoall",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_alltoall,
+                     NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/alltoallv",
-                    "Which collective to use for alltoallv",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_alltoallv,
-                    NULL);
+                     "Which collective to use for alltoallv",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_alltoallv,
+                     NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/bcast",
-                    "Which collective to use for bcast",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_bcast,
-                    NULL);
+                     "Which collective to use for bcast",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_bcast,
+                     NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/reduce",
-                    "Which collective to use for reduce",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_reduce,
-                    NULL);
+                     "Which collective to use for reduce",
+                     xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_reduce,
+                     NULL);
 #endif // HAVE_SMPI
 
-    default_value = xbt_strdup("yes");
     xbt_cfg_register(&_sg_cfg_set, "clean_atexit",
                      "\"yes\" or \"no\". \"yes\" enables all the cleanups of SimGrid (XBT,SIMIX,MSG) to be registered with atexit. \"no\" may be useful if your code segfaults when calling the exit function.",
-                     xbt_cfgelm_boolean, &default_value, 1, 1,
+                     xbt_cfgelm_boolean, NULL, 1, 1,
                      _sg_cfg_cb_clean_atexit, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "clean_atexit", default_value);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "clean_atexit", "yes");
 
     if (!surf_path) {
-      /* retrieves the current directory of the        current process */
+      /* retrieves the current directory of the current process */
       const char *initial_path = __surf_get_initial_path();
       xbt_assert((initial_path),
                   "__surf_get_initial_path() failed! Can't resolves current Windows directory");
@@ -881,7 +869,7 @@ void sg_config_finalize(void)
 /* Pick the right models for CPU, net and workstation, and call their model_init_preparse */
 void surf_config_models_setup()
 {
-  char *workstation_model_name;
+  const char *workstation_model_name;
   int workstation_id = -1;
   char *network_model_name = NULL;
   char *cpu_model_name = NULL;
@@ -899,15 +887,12 @@ void surf_config_models_setup()
    * the right net/cpu models.
    */
 
-  if((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") ||
-    !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) &&
-    xbt_cfg_is_default_value(_sg_cfg_set, "workstation/model"))
-  {
-      const char *val = "compound";
-      XBT_INFO
-          ("Switching workstation model to compound since you changed the network and/or cpu model(s)");
-      xbt_cfg_set_string(_sg_cfg_set, "workstation/model", val);
-      workstation_model_name = (char *) "compound";
+  if ((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") ||
+       !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) &&
+      xbt_cfg_is_default_value(_sg_cfg_set, "workstation/model")) {
+    XBT_INFO("Switching workstation model to compound since you changed the network and/or cpu model(s)");
+    workstation_model_name = "compound";
+    xbt_cfg_set_string(_sg_cfg_set, "workstation/model", workstation_model_name);
   }
 
   XBT_DEBUG("Workstation model: %s", workstation_model_name);
@@ -954,25 +939,30 @@ void surf_config_models_setup()
 
 int sg_cfg_get_int(const char* name)
 {
-       return xbt_cfg_get_int(_sg_cfg_set,name);
+  return xbt_cfg_get_int(_sg_cfg_set,name);
 }
+
 double sg_cfg_get_double(const char* name)
 {
-       return xbt_cfg_get_double(_sg_cfg_set,name);
+  return xbt_cfg_get_double(_sg_cfg_set,name);
 }
+
 char* sg_cfg_get_string(const char* name)
 {
-       return xbt_cfg_get_string(_sg_cfg_set,name);
+  return xbt_cfg_get_string(_sg_cfg_set,name);
 }
+
 int sg_cfg_get_boolean(const char* name)
 {
-       return xbt_cfg_get_boolean(_sg_cfg_set,name);
+  return xbt_cfg_get_boolean(_sg_cfg_set,name);
 }
+
 void sg_cfg_get_peer(const char *name, char **peer, int *port)
 {
-       xbt_cfg_get_peer(_sg_cfg_set,name, peer, port);
+  xbt_cfg_get_peer(_sg_cfg_set,name, peer, port);
 }
+
 xbt_dynar_t sg_cfg_get_dynar(const char* name)
 {
-       return xbt_cfg_get_dynar(_sg_cfg_set,name);
+  return xbt_cfg_get_dynar(_sg_cfg_set,name);
 }
index 59533e9..687171b 100644 (file)
@@ -44,7 +44,86 @@ extern raw_stack_t raw_makecontext(char* malloced_stack, int stack_size,
                                    rawctx_entry_point_t entry_point, void* arg);
 extern void raw_swapcontext(raw_stack_t* old, raw_stack_t new);
 
-#ifdef PROCESSOR_i686
+#ifdef PROCESSOR_x86_64
+__asm__ (
+#if defined(APPLE)
+   ".text\n"
+   ".globl _raw_makecontext\n"
+   "_raw_makecontext:\n"
+#elif defined(_WIN32)
+   ".text\n"
+   ".globl raw_makecontext\n"
+   "raw_makecontext:\n"
+#else
+   ".text\n"
+   ".globl raw_makecontext\n"
+   ".type raw_makecontext,@function\n"
+   "raw_makecontext:\n"/* Calling convention sets the arguments in rdi, rsi, rdx and rcx, respectively */
+#endif
+   "   mov %rdi,%rax\n"      /* stack */
+   "   add %rsi,%rax\n"      /* size  */
+   "   movq $0,   -8(%rax)\n" /* @return for func */
+   "   mov %rdx,-16(%rax)\n" /* func */
+   "   mov %rcx,-24(%rax)\n" /* arg/rdi */
+   "   movq $0,  -32(%rax)\n" /* rsi */
+   "   movq $0,  -40(%rax)\n" /* rdx */
+   "   movq $0,  -48(%rax)\n" /* rcx */
+   "   movq $0,  -56(%rax)\n" /* r8  */
+   "   movq $0,  -64(%rax)\n" /* r9  */
+   "   movq $0,  -72(%rax)\n" /* rbp */
+   "   movq $0,  -80(%rax)\n" /* rbx */
+   "   movq $0,  -88(%rax)\n" /* r12 */
+   "   movq $0,  -96(%rax)\n" /* r13 */
+   "   movq $0, -104(%rax)\n" /* r14 */
+   "   movq $0, -112(%rax)\n" /* r15 */
+   "   sub $112,%rax\n"
+   "   ret\n"
+);
+
+__asm__ (
+#if defined(APPLE)
+   ".text\n"
+   ".globl _raw_swapcontext\n"
+   "_raw_swapcontext:\n"
+#elif defined(_WIN32)
+   ".text\n"
+   ".globl raw_swapcontext\n"
+   "raw_swapcontext:\n"
+#else
+   ".text\n"
+   ".globl raw_swapcontext\n"
+   ".type raw_swapcontext,@function\n"
+   "raw_swapcontext:\n" /* Calling convention sets the arguments in rdi and rsi, respectively */
+#endif
+   "   push %rdi\n"
+   "   push %rsi\n"
+   "   push %rdx\n"
+   "   push %rcx\n"
+   "   push %r8\n"
+   "   push %r9\n"
+   "   push %rbp\n"
+   "   push %rbx\n"
+   "   push %r12\n"
+   "   push %r13\n"
+   "   push %r14\n"
+   "   push %r15\n"
+   "   mov %rsp,(%rdi)\n" /* old */
+   "   mov %rsi,%rsp\n" /* new */
+   "   pop %r15\n"
+   "   pop %r14\n"
+   "   pop %r13\n"
+   "   pop %r12\n"
+   "   pop %rbx\n"
+   "   pop %rbp\n"
+   "   pop %r9\n"
+   "   pop %r8\n"
+   "   pop %rcx\n"
+   "   pop %rdx\n"
+   "   pop %rsi\n"
+   "   pop %rdi\n"
+   "   ret\n"
+);
+#elif PROCESSOR_i686
 __asm__ (
 #if defined(APPLE) || defined(_WIN32)
    ".text\n"
@@ -96,86 +175,8 @@ __asm__ (
    "   popl %ebp\n"
    "   retl\n"
 );
-#elif PROCESSOR_x86_64
-__asm__ (
-#if defined(APPLE)
-   ".text\n"
-   ".globl _raw_makecontext\n"
-   "_raw_makecontext:\n"
-#elif defined(_WIN32)
-   ".text\n"
-   ".globl raw_makecontext\n"
-   "raw_makecontext:\n"
 #else
-   ".text\n"
-   ".globl raw_makecontext\n"
-   ".type raw_makecontext,@function\n"
-   "raw_makecontext:\n"/* Calling convention sets the arguments in rdi, rsi, rdx and rcx, respectively */
-#endif
-   "   movq %rdi,%rax\n"      /* stack */
-   "   addq %rsi,%rax\n"      /* size  */
-   "   movq $0,   -8(%rax)\n" /* @return for func */
-   "   movq %rdx,-16(%rax)\n" /* func */
-   "   movq %rcx,-24(%rax)\n" /* arg/rdi */
-   "   movq $0,  -32(%rax)\n" /* rsi */
-   "   movq $0,  -40(%rax)\n" /* rdx */
-   "   movq $0,  -48(%rax)\n" /* rcx */
-   "   movq $0,  -56(%rax)\n" /* r8  */
-   "   movq $0,  -64(%rax)\n" /* r9  */
-   "   movq $0,  -72(%rax)\n" /* rbp */
-   "   movq $0,  -80(%rax)\n" /* rbx */
-   "   movq $0,  -88(%rax)\n" /* r12 */
-   "   movq $0,  -96(%rax)\n" /* r13 */
-   "   movq $0, -104(%rax)\n" /* r14 */
-   "   movq $0, -112(%rax)\n" /* r15 */
-   "   subq $112,%rax\n"
-   "   retq\n"
-);
 
-__asm__ (
-#if defined(APPLE)
-   ".text\n"
-   ".globl _raw_swapcontext\n"
-   "_raw_swapcontext:\n"
-#elif defined(_WIN32)
-   ".text\n"
-   ".globl raw_swapcontext\n"
-   "raw_swapcontext:\n"
-#else
-   ".text\n"
-   ".globl raw_swapcontext\n"
-   ".type raw_swapcontext,@function\n"
-   "raw_swapcontext:\n" /* Calling convention sets the arguments in rdi and rsi, respectively */
-#endif
-   "   pushq %rdi\n"
-   "   pushq %rsi\n"
-   "   pushq %rdx\n"
-   "   pushq %rcx\n"
-   "   pushq %r8\n"
-   "   pushq %r9\n"
-   "   pushq %rbp\n"
-   "   pushq %rbx\n"
-   "   pushq %r12\n"
-   "   pushq %r13\n"
-   "   pushq %r14\n"
-   "   pushq %r15\n"
-   "   movq %rsp,(%rdi)\n" /* old */
-   "   movq %rsi,%rsp\n" /* new */
-   "   popq %r15\n"
-   "   popq %r14\n"
-   "   popq %r13\n"
-   "   popq %r12\n"
-   "   popq %rbx\n"
-   "   popq %rbp\n"
-   "   popq %r9\n"
-   "   popq %r8\n"
-   "   popq %rcx\n"
-   "   popq %rdx\n"
-   "   popq %rsi\n"
-   "   popq %rdi\n"
-   "   retq\n"
-);
-#else
 
 /* If you implement raw contexts for other processors, don't forget to
    update the definition of HAVE_RAWCTX in buildtools/Cmake/CompleteInFiles.cmake */
index 083096c..7c42c92 100644 (file)
@@ -4,6 +4,22 @@
 
 //attempt to do a quick autotuning version of the collective,
 
+#ifdef HAVE_TRACING
+#define TRACE_AUTO_COLL(cat) if (TRACE_is_enabled()){\
+        type_t type = PJ_type_get_or_null (#cat, PJ_type_get_root());\
+         if (!type){\
+             type=PJ_type_event_new(#cat, PJ_type_get_root());\
+         }\
+         char* cont_name=malloc(25*sizeof(char*));\
+         sprintf(cont_name, "rank-%d", smpi_process_index());\
+         val_t value = PJ_value_get_or_new(mpi_coll_##cat##_description[i].name,"1.0 1.0 1.0", type);\
+         new_pajeNewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\
+      }
+#else
+#define TRACE_AUTO_COLL(cat)
+#endif
+
+
 #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)\
     ret smpi_coll_tuned_ ## cat ## _ ## automatic(COLL_UNPAREN args)\
 {\
       if(!strcmp(mpi_coll_##cat##_description[i].name, "automatic"))continue;\
       if(!strcmp(mpi_coll_##cat##_description[i].name, "default"))continue;\
       smpi_mpi_barrier(comm);\
-      if (TRACE_is_enabled()){\
-        type_t type = PJ_type_get_or_null (#cat, PJ_type_get_root());\
-         if (!type){\
-             type=PJ_type_event_new(#cat, PJ_type_get_root());\
-         }\
-         char* cont_name=malloc(25*sizeof(char*));\
-         sprintf(cont_name, "rank-%d", smpi_process_index());\
-         val_t value = PJ_value_get_or_new(mpi_coll_##cat##_description[i].name,"1.0 1.0 1.0", type);\
-         new_pajeNewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\
-      }\
+      TRACE_AUTO_COLL(cat)\
       time1 = SIMIX_get_clock();\
       ((int (*) args)\
           mpi_coll_##cat##_description[i].coll) args2 ;\
index 84a0bac..8a74288 100644 (file)
@@ -117,6 +117,7 @@ static void* shm_map(int fd, size_t size, shared_data_t* data) {
 void smpi_bench_destroy(void)
 {
   xbt_dict_free(&allocs);
+  xbt_dict_free(&allocs_metadata);
   xbt_dict_free(&samples);
   xbt_dict_free(&calls);
 }
@@ -342,6 +343,13 @@ void smpi_sample_3(int global, const char *file, int line)
 }
 
 #ifndef WIN32
+static void smpi_shared_alloc_free(void *p)
+{
+  shared_data_t *data = p;
+  xbt_free(data->loc);
+  xbt_free(data);
+}
+
 void *smpi_shared_malloc(size_t size, const char *file, int line)
 {
   char *loc = bprintf("%zu_%s_%d", (size_t)getpid(), file, line);
@@ -358,7 +366,7 @@ void *smpi_shared_malloc(size_t size, const char *file, int line)
       }
     }
     if (!allocs) {
-      allocs = xbt_dict_new_homogeneous(free);
+      allocs = xbt_dict_new_homogeneous(smpi_shared_alloc_free);
     }
     data = xbt_dict_get_or_null(allocs, loc);
     if(!data) {
@@ -382,6 +390,7 @@ void *smpi_shared_malloc(size_t size, const char *file, int line)
       xbt_dict_set(allocs, loc, data, NULL);
       XBT_DEBUG("Mapping %s at %p through %d", loc, mem, fd);
     } else {
+      xbt_free(loc);
       mem = shm_map(data->fd, size, data);
       data->count++;
     }
@@ -426,7 +435,6 @@ void smpi_shared_free(void *ptr)
     if (data->count <= 0) {
       close(data->fd);
       xbt_dict_remove(allocs, data->loc);
-      free(data->loc);
       XBT_DEBUG("Shared free - with removal - of %p", ptr);
     }
   }else{
index 1c50396..f6e7c32 100644 (file)
@@ -295,6 +295,10 @@ void smpi_global_init(void)
   for (i = 0; i < process_count; i++) {
     smpi_group_set_mapping(group, i, i);
   }
+
+  //check correctness of MPI parameters
+
+  xbt_assert(sg_cfg_get_int("smpi/async_small_thres")<=sg_cfg_get_int("smpi/send_is_detached_thres"));
 }
 
 void smpi_global_destroy(void)
@@ -303,8 +307,8 @@ void smpi_global_destroy(void)
   int i;
 
   smpi_bench_destroy();
-  smpi_group_unuse(smpi_comm_group(MPI_COMM_WORLD));
-  smpi_comm_destroy(MPI_COMM_WORLD);
+  while(smpi_group_unuse(smpi_comm_group(MPI_COMM_WORLD))>0);
+  xbt_free(MPI_COMM_WORLD);
   MPI_COMM_WORLD = MPI_COMM_NULL;
   for (i = 0; i < count; i++) {
     smpi_group_unuse(smpi_comm_group(process_data[i]->comm_self));
index b3aeec0..9090cb4 100644 (file)
@@ -22,6 +22,19 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
 static xbt_swag_t
     cpu_running_action_set_that_does_not_need_being_checked = NULL;
 
+/* Additionnal callback function to cleanup some data, called from surf_resource_free */
+
+static void cpu_cas1_cleanup(void* r){
+  cpu_Cas01_t cpu = (cpu_Cas01_t)r;
+  unsigned int iter;
+  xbt_dynar_t power_tuple = NULL;
+  xbt_dynar_foreach(cpu->energy->power_range_watts_list, iter, power_tuple)
+    xbt_dynar_free(&power_tuple);
+  xbt_dynar_free(&cpu->energy->power_range_watts_list);
+  xbt_dynar_free(&cpu->power_peak_list);
+  xbt_free(cpu->energy);
+  return;
+}
 
 /* This function is registered as a callback to sg_platf_new_host() and never called directly */
 static void *cpu_create_resource(const char *name, xbt_dynar_t power_peak,
@@ -40,7 +53,7 @@ static void *cpu_create_resource(const char *name, xbt_dynar_t power_peak,
              name);
   cpu = (cpu_Cas01_t) surf_resource_new(sizeof(s_cpu_Cas01_t),
                                         surf_cpu_model, name,
-                                        cpu_properties);
+                                        cpu_properties,  &cpu_cas1_cleanup);
   cpu->power_peak = xbt_dynar_get_as(power_peak, pstate, double);
   cpu->power_peak_list = power_peak;
   cpu->pstate = pstate;
@@ -161,7 +174,7 @@ static void cpu_update_actions_state_full(double now, double delta)
 
 xbt_dynar_t cpu_get_watts_range_list(cpu_Cas01_t cpu_model)
 {
-       xbt_dynar_t power_range_list = xbt_dynar_new(sizeof(xbt_dynar_t), NULL);
+       xbt_dynar_t power_range_list;
        xbt_dynar_t power_tuple;
        int i = 0, pstate_nb=0;
        xbt_dynar_t current_power_values;
@@ -176,6 +189,8 @@ xbt_dynar_t cpu_get_watts_range_list(cpu_Cas01_t cpu_model)
        if (all_power_values_str == NULL)
                return NULL;
 
+
+       power_range_list = xbt_dynar_new(sizeof(xbt_dynar_t), NULL);
        xbt_dynar_t all_power_values = xbt_str_split(all_power_values_str, ",");
 
        pstate_nb = xbt_dynar_length(all_power_values);
@@ -197,8 +212,9 @@ xbt_dynar_t cpu_get_watts_range_list(cpu_Cas01_t cpu_model)
                xbt_dynar_push_as(power_tuple, double, max_power);
 
                xbt_dynar_push_as(power_range_list, xbt_dynar_t, power_tuple);
+               xbt_dynar_free(&current_power_values);
        }
-
+       xbt_dynar_free(&all_power_values);
        return power_range_list;
 
 }
index 127d1ea..eb298cb 100644 (file)
@@ -161,12 +161,12 @@ static void* cpu_ti_create_resource(const char *name, xbt_dynar_t power_peak,
               name);
   xbt_assert(core==1,"Multi-core not handled with this model yet");
   cpu = (cpu_ti_t) surf_resource_new(sizeof(s_cpu_ti_t),
-          surf_cpu_model, name,cpu_properties);
+          surf_cpu_model, name,cpu_properties, NULL);
   cpu->action_set =
       xbt_swag_new(xbt_swag_offset(ti_action, cpu_list_hookup));
 
-
   xbt_dynar_get_cpy(power_peak, 0, &cpu->power_peak);
+  xbt_dynar_free(&power_peak);  /* kill memory leak */
   //cpu->power_peak = power_peak;
   cpu->pstate = pstate;
   XBT_DEBUG("CPU create: peak=%lf, pstate=%d",cpu->power_peak, cpu->pstate);
index 2efa0b6..21a9c63 100644 (file)
@@ -221,7 +221,7 @@ static void* storage_create_resource(const char* id, const char* model,
               "Storage '%s' declared several times in the platform file",
               id);
   storage = (storage_t) surf_resource_new(sizeof(s_storage_t),
-          surf_storage_model, id, properties);
+          surf_storage_model, id, properties, NULL);
 
   storage->generic_resource.name = xbt_strdup(id);
   storage->state_current = SURF_RESOURCE_ON;
index a53a97f..8d001f7 100644 (file)
@@ -488,7 +488,7 @@ void surf_exit(void)
   xbt_free(surf_mins);
   surf_mins = NULL;
 #endif
-
+  xbt_dynar_free(&host_that_restart);
   xbt_dynar_free(&surf_path);
 
   xbt_lib_free(&host_lib);
index 683f037..53a519b 100644 (file)
@@ -1079,6 +1079,7 @@ static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
   XBT_DEBUG(" ");
 
   //xbt_dynar_free(&tab_elements_num);
+  free(router_id);
   free(host_id);
   free(link_id);
   free(link_up);
index a7e0cce..936a847 100644 (file)
@@ -27,8 +27,14 @@ static void vivaldi_get_route_and_latency(
   char *dst = (char*)dst_p->name;
 
   if(src_p->rc_type == SURF_NETWORK_ELEMENT_AS) {
-    route->gw_src = xbt_lib_get_or_null(as_router_lib,ROUTER_PEER(src),ROUTING_ASR_LEVEL);
-    route->gw_dst = xbt_lib_get_or_null(as_router_lib,ROUTER_PEER(dst),ROUTING_ASR_LEVEL);
+    char *rp_src = ROUTER_PEER(src);
+    char *rp_dst = ROUTER_PEER(dst);
+    route->gw_src = xbt_lib_get_or_null(as_router_lib, rp_src,
+                                        ROUTING_ASR_LEVEL);
+    route->gw_dst = xbt_lib_get_or_null(as_router_lib, rp_dst,
+                                        ROUTING_ASR_LEVEL);
+    xbt_free(rp_src);
+    xbt_free(rp_dst);
   }
 
   double euclidean_dist;
index e496ca4..ee3c95f 100644 (file)
@@ -449,6 +449,7 @@ void ETag_surfxml_host(void)    {
                  xbt_dynar_push_as(host.power_peak, double, power_value);
                  XBT_DEBUG("Power value: %lf", power_value);
          }
+         xbt_dynar_free(&pstate_list);
   }
 
   XBT_DEBUG("pstate: %s", A_surfxml_host_pstate);
index ba36aba..187b5a0 100644 (file)
@@ -558,7 +558,7 @@ static void surf_workstation_model_init_internal(void)
 void surf_workstation_model_init_current_default(void)
 {
   surf_workstation_model_init_internal();
-  xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", xbt_strdup("yes"));
+  xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", "yes");
   surf_cpu_model_init_Cas01();
   surf_network_model_init_LegrandVelho();
 
index 9d46e74..f77530b 100644 (file)
@@ -668,7 +668,7 @@ static void* ptask_cpu_create_resource(const char *name, double power_scale,
               name);
 
   cpu = (cpu_L07_t) surf_resource_new(sizeof(s_cpu_L07_t),
-          surf_workstation_model, name,cpu_properties);
+          surf_workstation_model, name,cpu_properties, NULL);
 
   cpu->type = SURF_WORKSTATION_RESOURCE_CPU;
   cpu->info = xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL);
@@ -700,7 +700,7 @@ static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host)
 {
   double power_peak = xbt_dynar_get_as(host->power_peak, host->pstate, double);
  //cpu->power_peak = power_peak;
-
+  xbt_dynar_free(&(host->power_peak));  /* kill memory leak */
   ptask_cpu_create_resource(
       host->id,
       power_peak,
index 2472c91..e522919 100644 (file)
@@ -169,7 +169,6 @@ void mfree(struct mdesc *mdp, void *ptr)
     /* Set size used in the fragment to -1 */
     mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = -1;
     mdp->heapinfo[block].busy_frag.ignore[frag_nb] = 0;
-    mdp->heapinfo[block].busy_frag.equal_to[frag_nb] = NULL;
 
 //    fprintf(stderr,"nfree:%zu capa:%d\n", mdp->heapinfo[block].busy_frag.nfree,(BLOCKSIZE >> type));
     if (mdp->heapinfo[block].busy_frag.nfree ==
@@ -181,7 +180,6 @@ void mfree(struct mdesc *mdp, void *ptr)
       mdp->heapinfo[block].type = 0;
       mdp->heapinfo[block].busy_block.size = 1;
       mdp->heapinfo[block].busy_block.busy_size = 0;
-      mdp->heapinfo[block].busy_block.equal_to = NULL;
             
       /* Keep the statistics accurate.  */
       mdp -> heapstats.chunks_used++;
index c501bcc..34f15e6 100644 (file)
@@ -129,10 +129,11 @@ static int compare_backtrace(int b1, int f1, int b2, int f2){
 /*********************************** Heap comparison ***********************************/
 /***************************************************************************************/
 
-void *s_heap = NULL, *heapbase1 = NULL, *heapbase2 = NULL;
-malloc_info *heapinfo1 = NULL, *heapinfo2 = NULL;
-size_t heaplimit = 0, heapsize1 = 0, heapsize2 = 0;
-xbt_dynar_t to_ignore1 = NULL, to_ignore2 = NULL;
+__thread void *s_heap = NULL, *heapbase1 = NULL, *heapbase2 = NULL;
+__thread malloc_info *heapinfo1 = NULL, *heapinfo2 = NULL;
+__thread size_t heaplimit = 0, heapsize1 = 0, heapsize2 = 0;
+__thread xbt_dynar_t to_ignore1 = NULL, to_ignore2 = NULL;
+__thread heap_area_t **equals_to1, **equals_to2;
 
 /*********************************** Free functions ************************************/
 
@@ -246,40 +247,40 @@ static void match_equals(xbt_dynar_t list){
   xbt_dynar_foreach(list, cursor, current_pair){
 
     if(current_pair->fragment1 != -1){
-      
-      if(heapinfo1[current_pair->block1].busy_frag.equal_to[current_pair->fragment1] != NULL){    
-        previous_area = heapinfo1[current_pair->block1].busy_frag.equal_to[current_pair->fragment1];
-        heap_area_free(heapinfo2[previous_area->block].busy_frag.equal_to[previous_area->fragment]);
-        heapinfo2[previous_area->block].busy_frag.equal_to[previous_area->fragment] = NULL;
-        heap_area_free(previous_area); 
+
+      if(equals_to1[current_pair->block1][current_pair->fragment1] != NULL){
+        previous_area = equals_to1[current_pair->block1][current_pair->fragment1];
+        heap_area_free(equals_to2[previous_area->block][previous_area->fragment]);
+        equals_to2[previous_area->block][previous_area->fragment] = NULL;
+        heap_area_free(previous_area);
       }
-      if(heapinfo2[current_pair->block2].busy_frag.equal_to[current_pair->fragment2] != NULL){        
-        previous_area = heapinfo2[current_pair->block2].busy_frag.equal_to[current_pair->fragment2];
-        heap_area_free(heapinfo1[previous_area->block].busy_frag.equal_to[previous_area->fragment]);
-        heapinfo1[previous_area->block].busy_frag.equal_to[previous_area->fragment] = NULL;
+      if(equals_to2[current_pair->block2][current_pair->fragment2] != NULL){
+        previous_area = equals_to2[current_pair->block2][current_pair->fragment2];
+        heap_area_free(equals_to1[previous_area->block][previous_area->fragment]);
+        equals_to1[previous_area->block][previous_area->fragment] = NULL;
         heap_area_free(previous_area);
       }
 
-      heapinfo1[current_pair->block1].busy_frag.equal_to[current_pair->fragment1] = new_heap_area(current_pair->block2, current_pair->fragment2);
-      heapinfo2[current_pair->block2].busy_frag.equal_to[current_pair->fragment2] = new_heap_area(current_pair->block1, current_pair->fragment1);
+      equals_to1[current_pair->block1][current_pair->fragment1] = new_heap_area(current_pair->block2, current_pair->fragment2);
+      equals_to2[current_pair->block2][current_pair->fragment2] = new_heap_area(current_pair->block1, current_pair->fragment1);
       
     }else{
 
-      if(heapinfo1[current_pair->block1].busy_block.equal_to != NULL){
-        previous_area = heapinfo1[current_pair->block1].busy_block.equal_to;
-        heap_area_free(heapinfo2[previous_area->block].busy_block.equal_to);
-        heapinfo2[previous_area->block].busy_block.equal_to = NULL;
+      if(equals_to1[current_pair->block1][0] != NULL){
+        previous_area = equals_to1[current_pair->block1][0];
+        heap_area_free(equals_to2[previous_area->block][0]);
+        equals_to2[previous_area->block][0] = NULL;
         heap_area_free(previous_area);
       }
-      if(heapinfo2[current_pair->block2].busy_block.equal_to != NULL){
-        previous_area = heapinfo2[current_pair->block2].busy_block.equal_to;
-        heap_area_free(heapinfo1[previous_area->block].busy_block.equal_to);
-        heapinfo1[previous_area->block].busy_block.equal_to = NULL;
+      if(equals_to2[current_pair->block2][0] != NULL){
+        previous_area = equals_to2[current_pair->block2][0];
+        heap_area_free(equals_to1[previous_area->block][0]);
+        equals_to1[previous_area->block][0] = NULL;
         heap_area_free(previous_area);
       }
 
-      heapinfo1[current_pair->block1].busy_block.equal_to = new_heap_area(current_pair->block2, current_pair->fragment2);
-      heapinfo2[current_pair->block2].busy_block.equal_to = new_heap_area(current_pair->block1, current_pair->fragment1);
+      equals_to1[current_pair->block1][0] = new_heap_area(current_pair->block2, current_pair->fragment2);
+      equals_to2[current_pair->block2][0] = new_heap_area(current_pair->block1, current_pair->fragment1);
 
     }
 
@@ -287,26 +288,27 @@ static void match_equals(xbt_dynar_t list){
 }
 
 static int equal_blocks(int b1, int b2){
-  if(heapinfo1[b1].busy_block.equal_to != NULL){
-    if(heapinfo2[b2].busy_block.equal_to != NULL){
-      if(((heap_area_t)(heapinfo1[b1].busy_block.equal_to))->block == b2 && ((heap_area_t)(heapinfo2[b2].busy_block.equal_to))->block == b1)
-        return 1;
-    }
-  }
+  
+  if(equals_to1[b1][0]->block == b2 && equals_to2[b2][0]->block == b1)
+    return 1;
+
   return 0;
 }
 
 static int equal_fragments(int b1, int f1, int b2, int f2){
-  if(heapinfo1[b1].busy_frag.equal_to[f1] != NULL){
-    if(heapinfo2[b2].busy_frag.equal_to[f2] != NULL){
-      if(((heap_area_t)(heapinfo1[b1].busy_frag.equal_to[f1]))->block == b2 && ((heap_area_t)(heapinfo2[b2].busy_frag.equal_to[f2]))->block == b1 && ((heap_area_t)(heapinfo1[b1].busy_frag.equal_to[f1]))->fragment == f2 && ((heap_area_t)(heapinfo2[b2].busy_frag.equal_to[f2]))->fragment == f1)
-        return 1;
-    }
-  }
+  
+  if(equals_to1[b1][f1]->block == b2 && equals_to1[b1][f1]->fragment == f2 && equals_to2[b2][f2]->block == b1 && equals_to2[b2][f2]->fragment == f1)
+    return 1;
+
   return 0;
 }
 
-void init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1, xbt_dynar_t i2){
+int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1, xbt_dynar_t i2){
+
+  if((((struct mdesc *)heap1)->heaplimit != ((struct mdesc *)heap2)->heaplimit) || ((((struct mdesc *)heap1)->heapsize != ((struct mdesc *)heap2)->heapsize) ))
+    return -1;
+
+  int i, j;
 
   heaplimit = ((struct mdesc *)heap1)->heaplimit;
 
@@ -324,6 +326,21 @@ void init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1,
   to_ignore1 = i1;
   to_ignore2 = i2;
 
+  equals_to1 = malloc(heaplimit * sizeof(heap_area_t *));
+  for(i=0; i<=heaplimit; i++){
+    equals_to1[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(heap_area_t));
+    for(j=0; j<MAX_FRAGMENT_PER_BLOCK; j++)
+      equals_to1[i][j] = NULL;
+  }
+
+
+  equals_to2 = malloc(heaplimit * sizeof(heap_area_t *));
+  for(i=0; i<=heaplimit; i++){
+    equals_to2[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(heap_area_t));
+    for(j=0; j<MAX_FRAGMENT_PER_BLOCK; j++)
+      equals_to2[i][j] = NULL;
+  }
+
   if(MC_is_active()){
     MC_ignore_global_variable("heaplimit");
     MC_ignore_global_variable("s_heap");
@@ -335,65 +352,47 @@ void init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1,
     MC_ignore_global_variable("heapsize2");
     MC_ignore_global_variable("to_ignore1");
     MC_ignore_global_variable("to_ignore2");
+    MC_ignore_global_variable("equals_to1");
+    MC_ignore_global_variable("equals_to2");
   }
 
+  return 0;
+
 }
 
 void reset_heap_information(){
 
   size_t i = 0, j;
 
-  while(i<=heaplimit){
-    if(heapinfo1[i].type == 0){
-      heap_area_free(heapinfo1[i].busy_block.equal_to);
-      heapinfo1[i].busy_block.equal_to = NULL;
-    }else if(heapinfo1[i].type > 0){
-      for(j=0; j < (size_t) (BLOCKSIZE >> heapinfo1[i].type); j++){
-        heap_area_free(heapinfo1[i].busy_frag.equal_to[j]);
-        heapinfo1[i].busy_frag.equal_to[j] = NULL;
-      }
-    }
-    i++; 
+  for(i=0; i<heaplimit; i++){
+    for(j=0; j<MAX_FRAGMENT_PER_BLOCK;j++){
+      heap_area_free(equals_to1[i][j]);
+      equals_to1[i][j] = NULL;
+      heap_area_free(equals_to2[i][j]);
+      equals_to2[i][j] = NULL;
+    }    
   }
 
-  i = 0;
-
-  while(i<=heaplimit){
-    if(heapinfo2[i].type == 0){
-      heap_area_free(heapinfo2[i].busy_block.equal_to);
-      heapinfo2[i].busy_block.equal_to = NULL;
-    }else if(heapinfo2[i].type > 0){
-      for(j=0; j < (size_t) (BLOCKSIZE >> heapinfo2[i].type); j++){
-        heap_area_free(heapinfo2[i].busy_frag.equal_to[j]);
-        heapinfo2[i].busy_frag.equal_to[j] = NULL;
-      }
-    }
-    i++; 
-  }
+  free(equals_to1);
+  free(equals_to2);
 
   s_heap = NULL, heapbase1 = NULL, heapbase2 = NULL;
   heapinfo1 = NULL, heapinfo2 = NULL;
   heaplimit = 0, heapsize1 = 0, heapsize2 = 0;
   to_ignore1 = NULL, to_ignore2 = NULL;
+  equals_to1 = NULL, equals_to2 = NULL;
 
 }
 
 int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
-  if(heap1 == NULL && heap1 == NULL){
+  if(heap1 == NULL && heap2 == NULL){
     XBT_DEBUG("Malloc descriptors null");
     return 0;
   }
 
-  if(heap1->heaplimit != heap2->heaplimit){
-    XBT_DEBUG("Different limit of valid info table indices");
-    return 1;
-  }
-
   /* Start comparison */
   size_t i1, i2, j1, j2, k;
-  size_t current_block = -1;    /* avoid "maybe uninitialized" warning */
-  size_t current_fragment;
   void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2;
   int nb_diff1 = 0, nb_diff2 = 0;
 
@@ -407,8 +406,6 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
   while(i1 <= heaplimit){
 
-    current_block = i1;
-
     if(heapinfo1[i1].type == -1){ /* Free block */
       i1++;
       continue;
@@ -420,14 +417,14 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
       
       if(is_stack(addr_block1)){
         for(k=0; k < heapinfo1[i1].busy_block.size; k++)
-          heapinfo1[i1+k].busy_block.equal_to = new_heap_area(i1, -1);
+          equals_to1[i1+k][0] = new_heap_area(i1, -1);
         for(k=0; k < heapinfo2[i1].busy_block.size; k++)
-          heapinfo2[i1+k].busy_block.equal_to = new_heap_area(i1, -1);
-        i1 = i1 + heapinfo1[current_block].busy_block.size;
+          equals_to2[i1+k][0] = new_heap_area(i1, -1);
+        i1 += heapinfo1[i1].busy_block.size;
         continue;
       }
 
-      if(heapinfo1[i1].busy_block.equal_to != NULL){
+      if(equals_to1[i1][0] != NULL){
         i1++;
         continue;
       }
@@ -437,21 +434,21 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
       res_compare = 0;
   
       /* Try first to associate to same block in the other heap */
-      if(heapinfo2[current_block].type == heapinfo1[current_block].type){
+      if(heapinfo2[i1].type == heapinfo1[i1].type){
 
-        if(heapinfo2[current_block].busy_block.equal_to == NULL){  
-        
-          addr_block2 = ((void*) (((ADDR2UINT(current_block)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
+        if(equals_to2[i1][0] == NULL){
+
+          addr_block2 = ((void*) (((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
         
-          res_compare = compare_heap_area(addr_block1, addr_block2, NULL, NULL, NULL, NULL, 0); /*FIXME*/
+          res_compare = compare_heap_area(addr_block1, addr_block2, NULL, NULL, NULL, NULL, 0);
         
           if(res_compare == 0){
-            for(k=1; k < heapinfo2[current_block].busy_block.size; k++)
-              heapinfo2[current_block+k].busy_block.equal_to = new_heap_area(i1, -1);
-            for(k=1; k < heapinfo1[current_block].busy_block.size; k++)
-              heapinfo1[current_block+k].busy_block.equal_to = new_heap_area(i1, -1);
+            for(k=1; k < heapinfo2[i1].busy_block.size; k++)
+              equals_to2[i1+k][0] = new_heap_area(i1, -1);
+            for(k=1; k < heapinfo1[i1].busy_block.size; k++)
+              equals_to1[i1+k][0] = new_heap_area(i1, -1);
             equal = 1;
-            i1 = i1 + heapinfo1[current_block].busy_block.size;
+            i1 += heapinfo1[i1].busy_block.size;
           }
         
           xbt_dynar_reset(previous);
@@ -464,7 +461,7 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
         addr_block2 = ((void*) (((ADDR2UINT(i2)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));        
            
-        if(i2 == current_block){
+        if(i2 == i1){
           i2++;
           continue;
         }
@@ -473,21 +470,21 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
           i2++;
           continue;
         }
-
-        if(heapinfo2[i2].busy_block.equal_to != NULL){         
+    
+        if(equals_to2[i2][0] != NULL){  
           i2++;
           continue;
         }
           
-        res_compare = compare_heap_area(addr_block1, addr_block2, NULL, NULL, NULL, NULL, 0); /*FIXME */
+        res_compare = compare_heap_area(addr_block1, addr_block2, NULL, NULL, NULL, NULL, 0);
         
         if(res_compare == 0){
           for(k=1; k < heapinfo2[i2].busy_block.size; k++)
-            heapinfo2[i2+k].busy_block.equal_to = new_heap_area(i1, -1);
+            equals_to2[i2+k][0] = new_heap_area(i1, -1);
           for(k=1; k < heapinfo1[i1].busy_block.size; k++)
-            heapinfo1[i1+k].busy_block.equal_to = new_heap_area(i2, -1);
+            equals_to1[i1+k][0] = new_heap_area(i2, -1);
           equal = 1;
-          i1 = i1 + heapinfo1[i1].busy_block.size;
+          i1 += heapinfo1[i1].busy_block.size;
         }
 
         xbt_dynar_reset(previous);
@@ -507,12 +504,10 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
       for(j1=0; j1 < (size_t) (BLOCKSIZE >> heapinfo1[i1].type); j1++){
 
-        current_fragment = j1;
-
         if(heapinfo1[i1].busy_frag.frag_size[j1] == -1) /* Free fragment */
           continue;
 
-        if(heapinfo1[i1].busy_frag.equal_to[j1] != NULL)
+        if(equals_to1[i1][j1] != NULL)
           continue;
 
         addr_frag1 = (void*) ((char *)addr_block1 + (j1 << heapinfo1[i1].type));
@@ -521,14 +516,14 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
         equal = 0;
         
         /* Try first to associate to same fragment in the other heap */
-        if(heapinfo2[current_block].type == heapinfo1[current_block].type){
+        if(heapinfo2[i1].type == heapinfo1[i1].type){
 
-          if(heapinfo2[current_block].busy_frag.equal_to[current_fragment] == NULL){  
-          
-            addr_block2 = ((void*) (((ADDR2UINT(current_block)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
-            addr_frag2 = (void*) ((char *)addr_block2 + (current_fragment << ((xbt_mheap_t)s_heap)->heapinfo[current_block].type));
+          if(equals_to2[i1][j1] == NULL){
 
-            res_compare = compare_heap_area(addr_frag1, addr_frag2, NULL, NULL, NULL, NULL, 0); /*FIXME*/
+            addr_block2 = ((void*) (((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
+            addr_frag2 = (void*) ((char *)addr_block2 + (j1 << ((xbt_mheap_t)s_heap)->heapinfo[i1].type));
+
+            res_compare = compare_heap_area(addr_frag1, addr_frag2, NULL, NULL, NULL, NULL, 0);
 
             if(res_compare == 0)
               equal = 1;
@@ -541,7 +536,6 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
         while(i2 <= heaplimit && !equal){
 
-          
           if(heapinfo2[i2].type <= 0){
             i2++;
             continue;
@@ -549,16 +543,16 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
           for(j2=0; j2 < (size_t) (BLOCKSIZE >> heapinfo2[i2].type); j2++){
 
-            if(i2 == current_block && j2 == current_fragment)
+            if(i2 == i1 && j2 == j1)
+              continue;
+           
+            if(equals_to2[i2][j2] != NULL)
               continue;
-
-            if(heapinfo2[i2].busy_frag.equal_to[j2] != NULL)                
-              continue;            
                           
             addr_block2 = ((void*) (((ADDR2UINT(i2)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
-            addr_frag2 = (void*) ((char *)addr_block2 + (j2 << ((xbt_mheap_t)s_heap)->heapinfo[i2].type));
+            addr_frag2 = (void*) ((char *)addr_block2 + (j2 <<((xbt_mheap_t)s_heap)->heapinfo[i2].type));
 
-            res_compare = compare_heap_area(addr_frag1, addr_frag2, NULL, NULL, NULL, NULL, 0); /*FIXME*/
+            res_compare = compare_heap_area(addr_frag1, addr_frag2, NULL, NULL, NULL, NULL, 0);
             
             if(res_compare == 0){
               equal = 1;
@@ -574,8 +568,8 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
         }
 
-        if(heapinfo1[i1].busy_frag.equal_to[j1] == NULL){
-          XBT_DEBUG("Block %zu, fragment %zu not found (size_used = %zd, address = %p, ignore %d)\n", i1, j1, heapinfo1[i1].busy_frag.frag_size[j1], addr_frag1, heapinfo1[i1].busy_frag.ignore[j1]);
+        if(!equal){
+          XBT_DEBUG("Block %zu, fragment %zu not found (size_used = %zd, address = %p)\n", i1, j1, heapinfo1[i1].busy_frag.frag_size[j1], addr_frag1);
           i2 = heaplimit + 1;
           i1 = heaplimit + 1;
           nb_diff1++;
@@ -596,9 +590,9 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
  
   while(i<=heaplimit){
     if(heapinfo1[i].type == 0){
-      if(current_block == heaplimit){
+      if(i1 == heaplimit){
         if(heapinfo1[i].busy_block.busy_size > 0){
-          if(heapinfo1[i].busy_block.equal_to == NULL){
+          if(equals_to1[i][0] == NULL){            
             if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){
               addr_block1 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase1));
               XBT_DEBUG("Block %zu (%p) not found (size used = %zu)", i, addr_block1, heapinfo1[i].busy_block.busy_size);
@@ -613,9 +607,9 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
       addr_block1 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase1));
       real_addr_block1 =  ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)((struct mdesc *)s_heap)->heapbase));
       for(j=0; j < (size_t) (BLOCKSIZE >> heapinfo1[i].type); j++){
-        if(current_block == heaplimit){
+        if(i1== heaplimit){
           if(heapinfo1[i].busy_frag.frag_size[j] > 0){
-            if(heapinfo1[i].busy_frag.equal_to[j] == NULL){
+            if(equals_to1[i][j] == NULL){
               if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){
                 addr_frag1 = (void*) ((char *)addr_block1 + (j << heapinfo1[i].type));
                 real_addr_frag1 = (void*) ((char *)real_addr_block1 + (j << ((struct mdesc *)s_heap)->heapinfo[i].type));
@@ -631,16 +625,16 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
     i++; 
   }
 
-  if(current_block == heaplimit)
+  if(i1 == heaplimit)
     XBT_DEBUG("Number of blocks/fragments not found in heap1 : %d", nb_diff1);
 
   i = 1;
 
   while(i<=heaplimit){
     if(heapinfo2[i].type == 0){
-      if(current_block == heaplimit){
+      if(i1 == heaplimit){
         if(heapinfo2[i].busy_block.busy_size > 0){
-          if(heapinfo2[i].busy_block.equal_to == NULL){
+          if(equals_to2[i][0] == NULL){
             if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){
               addr_block2 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase2));
               XBT_DEBUG("Block %zu (%p) not found (size used = %zu)", i, addr_block2, heapinfo2[i].busy_block.busy_size);
@@ -655,9 +649,9 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
       addr_block2 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase2));
       real_addr_block2 =  ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)((struct mdesc *)s_heap)->heapbase));
       for(j=0; j < (size_t) (BLOCKSIZE >> heapinfo2[i].type); j++){
-        if(current_block == heaplimit){
+        if(i1 == heaplimit){
           if(heapinfo2[i].busy_frag.frag_size[j] > 0){
-            if(heapinfo2[i].busy_frag.equal_to[j] == NULL){
+            if(equals_to2[i][j] == NULL){
               if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){
                 addr_frag2 = (void*) ((char *)addr_block2 + (j << heapinfo2[i].type));
                 real_addr_frag2 = (void*) ((char *)real_addr_block2 + (j << ((struct mdesc *)s_heap)->heapinfo[i].type));
@@ -673,7 +667,7 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
     i++; 
   }
 
-  if(current_block == heaplimit)
+  if(i1 == heaplimit)
     XBT_DEBUG("Number of blocks/fragments not found in heap2 : %d", nb_diff2);
 
   xbt_dynar_free(&previous);
@@ -757,7 +751,7 @@ static int compare_heap_area_with_type(void *real_area1, void *real_area2, void
     if((check_ignore > 0) && ((ignore1 = heap_comparison_ignore_size(to_ignore1, real_area1)) > 0) && ((ignore2 = heap_comparison_ignore_size(to_ignore2, real_area2))  == ignore1))
       return 0;
     if(strcmp(type->name, "char") == 0){ /* String, hence random (arbitrary ?) size */
-      return (memcmp(area1, area2, area_size) != 0);
+      return  (memcmp(area1, area2, area_size) != 0);
     }else{
       if(area_size != -1 && type->size != area_size)
         return -1;
@@ -821,7 +815,7 @@ static int compare_heap_area_with_type(void *real_area1, void *real_area2, void
         res = compare_heap_area_with_type((char *)real_area1 + (i*elm_size), (char *)real_area2 + (i*elm_size), (char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), previous, other_types, all_types, type->dw_type_id, type->size, check_ignore, pointer_level);
       else
         res = compare_heap_area_with_type((char *)real_area1 + (i*elm_size), (char *)real_area2 + (i*elm_size), (char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), previous, all_types, other_types, type->dw_type_id, type->size, check_ignore, pointer_level);
-      if(res != 0)
+      if(res == 1)
         return res;
     }
     break;
@@ -840,7 +834,7 @@ static int compare_heap_area_with_type(void *real_area1, void *real_area2, void
             res =  compare_heap_area(addr_pointed1, addr_pointed2, previous, all_types, other_types, type->dw_type_id, pointer_level); 
           else
             res =  (addr_pointed1 != addr_pointed2);
-          if(res != 0)
+          if(res == 1)
             return res;
         }
       }else{
@@ -870,7 +864,7 @@ static int compare_heap_area_with_type(void *real_area1, void *real_area2, void
             res = compare_heap_area_with_type((char *)real_area1 + (i*type->size), (char *)real_area2 + (i*type->size), (char *)area1 + (i*type->size), (char *)area2 + (i*type->size), previous, other_types, all_types, type_id, -1, check_ignore, 0); 
           else
             res = compare_heap_area_with_type((char *)real_area1 + (i*type->size), (char *)real_area2 + (i*type->size), (char *)area1 + (i*type->size), (char *)area2 + (i*type->size), previous, all_types, other_types, type_id, -1, check_ignore, 0); 
-          if(res != 0)
+          if(res == 1)
             return res;
         }
       }else{
@@ -883,7 +877,7 @@ static int compare_heap_area_with_type(void *real_area1, void *real_area2, void
           res = compare_heap_area_with_type((char *)real_area1 + member->offset, (char *)real_area2 + member->offset, (char *)area1 + member->offset, (char *)area2 + member->offset, previous, other_types, all_types, member->dw_type_id, -1, check_ignore, 0);
         else
           res = compare_heap_area_with_type((char *)real_area1 + member->offset, (char *)real_area2 + member->offset, (char *)area1 + member->offset, (char *)area2 + member->offset, previous, all_types, other_types, member->dw_type_id, -1, check_ignore, 0);  
-        if(res != 0)
+        if(res == 1)
           return res;        
       }
     }
@@ -913,6 +907,8 @@ int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t
 
   void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2;
   void *area1_to_compare, *area2_to_compare;
+  dw_type_t type = NULL;
+  char *type_desc;
 
   int match_pairs = 0;
 
@@ -943,125 +939,123 @@ int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t
   addr_block1 = ((void*) (((ADDR2UINT(block1)) - 1) * BLOCKSIZE + (char*)heapbase1));
   addr_block2 = ((void*) (((ADDR2UINT(block2)) - 1) * BLOCKSIZE + (char*)heapbase2));
   
-  if(heapinfo1[block1].type == heapinfo2[block2].type){
-    
-    if(heapinfo1[block1].type == -1){ /* Free block */
-      if(match_pairs){
-        match_equals(previous);
-        xbt_dynar_free(&previous);
-      }
-      return 0;
+  if((heapinfo1[block1].type == -1) && (heapinfo2[block2].type == -1)){  /* Free block */
 
-    }else if(heapinfo1[block1].type == 0){ /* Complete block */
+    if(match_pairs){
+      match_equals(previous);
+      xbt_dynar_free(&previous);
+    }
+    return 0;
 
-      if(heapinfo1[block1].busy_block.equal_to != NULL && heapinfo2[block2].busy_block.equal_to != NULL){
-        if(equal_blocks(block1, block2)){
-          if(match_pairs){
-            match_equals(previous);
-            xbt_dynar_free(&previous);
-          }
-          return 0;
-        }
-      }
+  }else if((heapinfo1[block1].type == 0) && (heapinfo2[block2].type == 0)){ /* Complete block */
 
-      if(heapinfo1[block1].busy_block.size != heapinfo2[block2].busy_block.size){
+    if(equals_to1[block1][0] != NULL && equals_to2[block2][0] != NULL){
+      if(equal_blocks(block1, block2)){
         if(match_pairs){
+          match_equals(previous);
           xbt_dynar_free(&previous);
         }
-        return 1;
+        return 0;
       }
+    }
 
-      if(heapinfo1[block1].busy_block.busy_size != heapinfo2[block2].busy_block.busy_size){
-        if(match_pairs){
-          xbt_dynar_free(&previous);
+    if(type_id){
+      type = xbt_dict_get_or_null(all_types, type_id);
+      if(strcmp(type->name, "char") ==0){
+        if(area1 == area2)
+          return -1;
+      }
+      if(type->size == 0){
+        type_desc = get_type_description(all_types, type->name);
+        if(type_desc)
+          type = xbt_dict_get_or_null(all_types, type_desc);
+        else
+          type = xbt_dict_get_or_null(other_types, get_type_description(other_types, type->name));
+      }
+      if(strcmp(type->name, "s_smx_context") != 0){
+        if(type->size > 1){
+          if(heapinfo1[block1].busy_block.busy_size != type->size && heapinfo2[block2].busy_block.busy_size  != type->size)
+            return -1;
         }
-        return 1;
       }
+    }
 
-      if(!add_heap_area_pair(previous, block1, -1, block2, -1)){
-        if(match_pairs){
-          match_equals(previous);
-          xbt_dynar_free(&previous);
-        }
-        return 0;
+    if(heapinfo1[block1].busy_block.size != heapinfo2[block2].busy_block.size){
+      if(match_pairs){
+        xbt_dynar_free(&previous);
+      }
+      return 1;
+    }
+
+    if(heapinfo1[block1].busy_block.busy_size != heapinfo2[block2].busy_block.busy_size){
+      if(match_pairs){
+        xbt_dynar_free(&previous);
       }
+      return 1;
+    }
+
+    if(!add_heap_area_pair(previous, block1, -1, block2, -1)){
+      if(match_pairs){
+        match_equals(previous);
+        xbt_dynar_free(&previous);
+      }
+      return 0;
+    }
  
-      size = heapinfo1[block1].busy_block.busy_size;
+    size = heapinfo1[block1].busy_block.busy_size;
 
-      if(size <= 0){
-        if(match_pairs){
-          match_equals(previous);
-          xbt_dynar_free(&previous);
-        }
-        return 0;
+    if(size <= 0){
+      if(match_pairs){
+        match_equals(previous);
+        xbt_dynar_free(&previous);
       }
+      return 0;
+    }
 
-      frag1 = -1;
-      frag2 = -1;
+    frag1 = -1;
+    frag2 = -1;
 
-      area1_to_compare = addr_block1;
-      area2_to_compare = addr_block2;
+    area1_to_compare = addr_block1;
+    area2_to_compare = addr_block2;
 
-      if((heapinfo1[block1].busy_block.ignore > 0) && (heapinfo2[block2].busy_block.ignore == heapinfo1[block1].busy_block.ignore))
-        check_ignore = heapinfo1[block1].busy_block.ignore;
+    if((heapinfo1[block1].busy_block.ignore > 0) && (heapinfo2[block2].busy_block.ignore == heapinfo1[block1].busy_block.ignore))
+      check_ignore = heapinfo1[block1].busy_block.ignore;
       
-    }else{ /* Frgamented block */
+  }else if((heapinfo1[block1].type > 0) && (heapinfo2[block2].type > 0)){ /* Fragmented block */
 
-      frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> heapinfo1[block1].type;
-      frag2 = ((uintptr_t) (ADDR2UINT (area2) % (BLOCKSIZE))) >> heapinfo2[block2].type;
+    frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> heapinfo1[block1].type;
+    frag2 = ((uintptr_t) (ADDR2UINT (area2) % (BLOCKSIZE))) >> heapinfo2[block2].type;
       
-      addr_frag1 = (void*) ((char *)addr_block1 + (frag1 << heapinfo1[block1].type));
-      addr_frag2 = (void*) ((char *)addr_block2 + (frag2 << heapinfo2[block2].type));
+    addr_frag1 = (void*) ((char *)addr_block1 + (frag1 << heapinfo1[block1].type));
+    addr_frag2 = (void*) ((char *)addr_block2 + (frag2 << heapinfo2[block2].type));
       
-      area1_to_compare = addr_frag1;
-      area2_to_compare = addr_frag2;
-
-      if(heapinfo1[block1].busy_frag.equal_to[frag1] != NULL && heapinfo2[block2].busy_frag.equal_to[frag2] != NULL){
-        if(equal_fragments(block1, frag1, block2, frag2)){
-          if(match_pairs){
-            match_equals(previous);
-            xbt_dynar_free(&previous);
-          }
-          return 0;
-        }
-      }
+    area1_to_compare = addr_frag1;
+    area2_to_compare = addr_frag2;
 
-      if(heapinfo1[block1].busy_frag.frag_size[frag1] != heapinfo2[block2].busy_frag.frag_size[frag2]){
-        if(match_pairs){
-          xbt_dynar_free(&previous);
-        }
-        return 1;  
+    if(type_id){
+      type = xbt_dict_get_or_null(all_types, type_id);
+      if(strcmp(type->name, "char") ==0){
+        if(area1 == area2)
+          return -1;
       }
-      
-      if(!add_heap_area_pair(previous, block1, frag1, block2, frag2)){
-        if(match_pairs){
-          match_equals(previous);
-          xbt_dynar_free(&previous);
+      if(type->size == 0 || type->type == e_dw_pointer_type){
+        if(!type->dw_type_id){
+          type_desc = get_type_description(all_types, type->name);
+          if(type_desc)
+            type = xbt_dict_get_or_null(all_types, type_desc);
+          else
+            type = xbt_dict_get_or_null(other_types, get_type_description(other_types, type->name));
+        }else{
+          type = xbt_dict_get_or_null(all_types, type->dw_type_id);
         }
-        return 0;
       }
-
-      size = heapinfo1[block1].busy_frag.frag_size[frag1];
-
-      if(size <= 0){
-        if(match_pairs){
-          match_equals(previous);
-          xbt_dynar_free(&previous);
-        }
-        return 0;
+      if(type->size > 1){
+        if(heapinfo1[block1].busy_frag.frag_size[frag1] != type->size || heapinfo2[block2].busy_frag.frag_size[frag2]  != type->size)
+          return -1;
       }
-      
-      if((heapinfo1[block1].busy_frag.ignore[frag1] > 0) && ( heapinfo2[block2].busy_frag.ignore[frag2] == heapinfo1[block1].busy_frag.ignore[frag1]))
-        check_ignore = heapinfo1[block1].busy_frag.ignore[frag1];
-      
     }
 
-  }else if((heapinfo1[block1].type > 0) && (heapinfo2[block2].type > 0)){
-
-    frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> heapinfo1[block1].type;
-    frag2 = ((uintptr_t) (ADDR2UINT (area2) % (BLOCKSIZE))) >> heapinfo2[block2].type;
-
-    if(heapinfo1[block1].busy_frag.equal_to[frag1] != NULL || heapinfo2[block2].busy_frag.equal_to[frag2] != NULL){
+    if(equals_to1[block1][frag1] != NULL && equals_to2[block2][frag2] != NULL){
       if(equal_fragments(block1, frag1, block2, frag2)){
         if(match_pairs){
           match_equals(previous);
@@ -1075,9 +1069,9 @@ int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t
       if(match_pairs){
         xbt_dynar_free(&previous);
       }
-      return 1;
+      return 1;  
     }
-    
+      
     if(!add_heap_area_pair(previous, block1, frag1, block2, frag2)){
       if(match_pairs){
         match_equals(previous);
@@ -1086,12 +1080,6 @@ int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t
       return 0;
     }
 
-    addr_frag1 = (void*) ((char *)addr_block1 + (frag1 << heapinfo1[block1].type));
-    addr_frag2 = (void*) ((char *)addr_block2 + (frag2 << heapinfo2[block2].type));
-
-    area1_to_compare = addr_frag1;
-    area2_to_compare = addr_frag2;
-      
     size = heapinfo1[block1].busy_frag.frag_size[frag1];
 
     if(size <= 0){
@@ -1101,17 +1089,19 @@ int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t
       }
       return 0;
     }
-
-    if((heapinfo1[block1].busy_frag.ignore[frag1] > 0) && (heapinfo2[block2].busy_frag.ignore[frag2] == heapinfo1[block1].busy_frag.ignore[frag1]))
-      check_ignore = heapinfo1[block1].busy_frag.ignore[frag1];   
+      
+    if((heapinfo1[block1].busy_frag.ignore[frag1] > 0) && ( heapinfo2[block2].busy_frag.ignore[frag2] == heapinfo1[block1].busy_frag.ignore[frag1]))
+      check_ignore = heapinfo1[block1].busy_frag.ignore[frag1];
     
   }else{
+
     if(match_pairs){
       xbt_dynar_free(&previous);
     }
     return 1;
-  }
 
+  }
+  
 
   /* Start comparison*/
   if(type_id != NULL){
@@ -1123,11 +1113,11 @@ int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t
     }
   }else{
     res_compare = compare_heap_area_without_type(area1, area2, area1_to_compare, area2_to_compare, previous, all_types, other_types, size, check_ignore);
-      if(res_compare != 0){
-        if(match_pairs)
-          xbt_dynar_free(&previous);
-        return res_compare;
-      }
+    if(res_compare != 0){
+      if(match_pairs)
+        xbt_dynar_free(&previous);
+      return res_compare;
+    }
   }
 
   if(match_pairs){
index 0dfd027..01c0bce 100644 (file)
@@ -365,3 +365,16 @@ size_t mmalloc_get_bytes_used(xbt_mheap_t heap){
   return bytes;
 }
 
+ssize_t mmalloc_get_busy_size(xbt_mheap_t heap, void *ptr){
+
+  ssize_t block = ((char*)ptr - (char*)(heap->heapbase)) / BLOCKSIZE + 1;
+  if(heap->heapinfo[block].type == -1)
+    return -1;
+  else if(heap->heapinfo[block].type == 0)
+    return heap->heapinfo[block].busy_block.busy_size;
+  else{
+    ssize_t frag = ((uintptr_t) (ADDR2UINT (ptr) % (BLOCKSIZE))) >> heap->heapinfo[block].type;
+    return heap->heapinfo[block].busy_frag.frag_size[frag];
+  }
+    
+}
index 9e94017..71ddd56 100644 (file)
@@ -120,12 +120,10 @@ static void *register_morecore(struct mdesc *mdp, size_t size)
     for (it=0; it<BLOCKIFY(mdp->heapsize * sizeof(malloc_info)); it++){
       newinfo[BLOCK(oldinfo)+it].type = 0;
       newinfo[BLOCK(oldinfo)+it].busy_block.ignore = 0;
-      newinfo[BLOCK(oldinfo+it)].busy_block.equal_to = NULL;
     }
 
     newinfo[BLOCK(oldinfo)].busy_block.size = BLOCKIFY(mdp->heapsize * sizeof(malloc_info));
     newinfo[BLOCK(oldinfo)].busy_block.busy_size = size;
-    //newinfo[BLOCK(oldinfo)].busy_block.bt_size = 0;// FIXME setup the backtrace
     mfree(mdp, (void *) oldinfo);
     mdp->heapsize = newsize;
   }
@@ -205,7 +203,6 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
       /* Update our metadata about this fragment */
       candidate_info->busy_frag.frag_size[candidate_frag] = requested_size;
       candidate_info->busy_frag.ignore[candidate_frag] = 0;
-      candidate_info->busy_frag.equal_to[candidate_frag] = NULL;
       //xbt_backtrace_no_malloc(candidate_info->busy_frag.bt[candidate_frag],XBT_BACKTRACE_SIZE);
       //xbt_libunwind_backtrace(candidate_info->busy_frag.bt[candidate_frag],XBT_BACKTRACE_SIZE);
 
@@ -227,7 +224,6 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
       for (i = 1; i < (size_t) (BLOCKSIZE >> log); ++i) {
         mdp->heapinfo[block].busy_frag.frag_size[i] = -1;
         mdp->heapinfo[block].busy_frag.ignore[i] = 0;
-        mdp->heapinfo[block].busy_frag.equal_to[i] = NULL;
       }
       mdp->heapinfo[block].busy_frag.nfree = i - 1;
       mdp->heapinfo[block].freehook.prev = NULL;
@@ -238,7 +234,6 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
       /* mark the fragment returned as busy */
       mdp->heapinfo[block].busy_frag.frag_size[0] = requested_size;
       mdp->heapinfo[block].busy_frag.ignore[0] = 0;
-      mdp->heapinfo[block].busy_frag.equal_to[0] = NULL;
       //xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_frag.bt[0],XBT_BACKTRACE_SIZE);
       //xbt_libunwind_backtrace(mdp->heapinfo[block].busy_frag.bt[0],XBT_BACKTRACE_SIZE);
       
@@ -286,7 +281,6 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
           mdp->heapinfo[block+it].type = 0;
           mdp->heapinfo[block+it].busy_block.busy_size = 0;
           mdp->heapinfo[block+it].busy_block.ignore = 0;
-          mdp->heapinfo[block+it].busy_block.equal_to = NULL;
         }
         mdp->heapinfo[block].busy_block.size = blocks;
         mdp->heapinfo[block].busy_block.busy_size = requested_size;
@@ -328,7 +322,6 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
       mdp->heapinfo[block+it].type = 0;
       mdp->heapinfo[block+it].busy_block.busy_size = 0;
       mdp->heapinfo[block+it].busy_block.ignore = 0;
-      mdp->heapinfo[block+it].busy_block.equal_to = NULL;
     }
     mdp->heapinfo[block].busy_block.size = blocks;
     mdp->heapinfo[block].busy_block.busy_size = requested_size; 
index 0623bff..f3e4d20 100644 (file)
@@ -157,7 +157,6 @@ typedef struct {
       ssize_t frag_size[MAX_FRAGMENT_PER_BLOCK];
       //void *bt[MAX_FRAGMENT_PER_BLOCK][XBT_BACKTRACE_SIZE]; /* Where it was malloced (or realloced lastly) */
       int ignore[MAX_FRAGMENT_PER_BLOCK];
-      heap_area_t equal_to[MAX_FRAGMENT_PER_BLOCK];
     } busy_frag;
     struct {
       size_t size; /* Size (in blocks) of a large cluster.  */
@@ -165,7 +164,6 @@ typedef struct {
       //void *bt[XBT_BACKTRACE_SIZE]; /* Where it was malloced (or realloced lastly) */
       //int bt_size;
       int ignore;
-      heap_area_t equal_to;
     } busy_block;
     /* Heap information for a free block (that may be the first of a free cluster).  */
     struct {
index 7cbe32c..8af2bcb 100644 (file)
@@ -85,7 +85,6 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
       for (it= block+blocks; it< mdp->heapinfo[block].busy_block.size ; it++){
         mdp->heapinfo[it].type = 0; // FIXME that should be useless, type should already be 0 here
         mdp->heapinfo[it].busy_block.ignore = 0;
-        mdp->heapinfo[it].busy_block.equal_to = NULL;
       }
 
       mdp->heapinfo[block + blocks].busy_block.size
@@ -95,7 +94,6 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
       mdp->heapinfo[block].busy_block.size = blocks;
       mdp->heapinfo[block].busy_block.busy_size = requested_size;
       mdp->heapinfo[block].busy_block.ignore = 0;
-      mdp->heapinfo[block].busy_block.equal_to = NULL;
 
       result = ptr;
     } else if (blocks == mdp->heapinfo[block].busy_block.size) {
@@ -104,7 +102,6 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
       result = ptr;
       mdp->heapinfo[block].busy_block.busy_size = requested_size;
       mdp->heapinfo[block].busy_block.ignore = 0;
-      mdp->heapinfo[block].busy_block.equal_to = NULL;
 
     } else {
       /* Won't fit, so allocate a new region that will.
@@ -137,7 +134,6 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
       int frag_nb = RESIDUAL(result, BLOCKSIZE) >> type;
       mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = requested_size;
       mdp->heapinfo[block].busy_frag.ignore[frag_nb] = 0;
-      mdp->heapinfo[block].busy_frag.equal_to[frag_nb] = NULL;
 
     } else { /* fragment -> Either other fragment, or block */
       /* The new size is different; allocate a new space,
index c7592a0..90a0b81 100644 (file)
@@ -53,6 +53,10 @@ static void xbt_parmap_busy_worker_signal(xbt_parmap_t parmap);
 static void xbt_parmap_busy_master_signal(xbt_parmap_t parmap);
 static void xbt_parmap_busy_worker_wait(xbt_parmap_t parmap, unsigned round);
 
+#ifdef HAVE_MC
+static void xbt_parmap_mc_work(xbt_parmap_t parmap, int worker_id);
+static void *xbt_parmap_mc_worker_main(void *arg);
+#endif
 
 /**
  * \brief Parallel map structure
@@ -67,6 +71,14 @@ typedef struct s_xbt_parmap {
   xbt_dynar_t data;                /**< parameters to pass to fun in parallel */
   unsigned int index;              /**< index of the next element of data to pick */
 
+#ifdef HAVE_MC
+  int finish;
+  void* ref_snapshot;
+  int_f_pvoid_pvoid_t snapshot_compare;
+  unsigned int length;
+  void* mc_data;
+#endif
+
   /* posix only */
   xbt_os_cond_t ready_cond;
   xbt_os_mutex_t ready_mutex;
@@ -123,6 +135,40 @@ xbt_parmap_t xbt_parmap_new(unsigned int num_workers, e_xbt_parmap_mode_t mode)
   return parmap;
 }
 
+#ifdef HAVE_MC
+/**
+ * \brief Creates a parallel map object
+ * \param num_workers number of worker threads to create
+ * \param mode how to synchronize the worker threads
+ * \return the parmap created
+ */
+xbt_parmap_t xbt_parmap_mc_new(unsigned int num_workers, e_xbt_parmap_mode_t mode)
+{
+  unsigned int i;
+  xbt_os_thread_t worker = NULL;
+
+  XBT_DEBUG("Create new parmap (%u workers)", num_workers);
+
+  /* Initialize the thread pool data structure */
+  xbt_parmap_t parmap = xbt_new0(s_xbt_parmap_t, 1);
+
+  parmap->num_workers = num_workers;
+  parmap->status = XBT_PARMAP_WORK;
+  xbt_parmap_set_mode(parmap, mode);
+
+  /* Create the pool of worker threads */
+  xbt_parmap_thread_data_t data;
+  for (i = 1; i < num_workers; i++) {
+    data = xbt_new0(s_xbt_parmap_thread_data_t, 1);
+    data->parmap = parmap;
+    data->worker_id = i;
+    worker = xbt_os_thread_create(NULL, xbt_parmap_mc_worker_main, data, NULL);
+    xbt_os_thread_detach(worker);
+  }
+  return parmap;
+}
+#endif
+
 /**
  * \brief Destroys a parmap
  * \param parmap the parmap to destroy
@@ -287,6 +333,89 @@ static void *xbt_parmap_worker_main(void *arg)
   }
 }
 
+#ifdef HAVE_MC
+
+/**
+ * \brief Applies a list of tasks in parallel.
+ * \param parmap a parallel map object
+ * \param fun the function to call in parallel
+ * \param data each element of this dynar will be passed as an argument to fun
+ */
+int xbt_parmap_mc_apply(xbt_parmap_t parmap, int_f_pvoid_pvoid_t fun, 
+                         void* data, unsigned int length,  void* ref_snapshot)
+{
+  /* Assign resources to worker threads */
+  parmap->snapshot_compare = fun;
+  parmap->mc_data = data;
+  parmap->index = 0;
+  parmap->finish = -1;
+  parmap->length = length;
+  parmap->ref_snapshot = ref_snapshot;
+  parmap->master_signal_f(parmap);
+  xbt_parmap_mc_work(parmap, 0);
+  parmap->master_wait_f(parmap);
+  XBT_DEBUG("Job done");
+  return parmap->finish;
+}
+
+static void xbt_parmap_mc_work(xbt_parmap_t parmap, int worker_id)
+{
+  unsigned int data_size = (parmap->length / parmap->num_workers) +
+    ((parmap->length % parmap->num_workers) ? 1 :0);
+  void* start = (char*)parmap->mc_data + (data_size*worker_id*sizeof(void*));
+  void* end = MIN((char *)start + data_size* sizeof(void*), (char*)parmap->mc_data + parmap->length*sizeof(void*));
+  
+  //XBT_CRITICAL("Worker %d : %p -> %p (%d)", worker_id, start, end, data_size);
+
+  while ( start < end && parmap->finish == -1) {
+    //XBT_CRITICAL("Starting with %p", start);
+    int res = parmap->snapshot_compare(*(void**)start, parmap->ref_snapshot);
+    start = (char *)start + sizeof(start);
+    if (!res){
+    
+      parmap->finish = ((char*)start - (char*)parmap->mc_data) / sizeof(void*);
+      //XBT_CRITICAL("Find good one %p (%p)", start, parmap->mc_data);
+      break;
+    }
+  }
+}
+
+/**
+ * \brief Main function of a worker thread.
+ * \param arg the parmap
+ */
+static void *xbt_parmap_mc_worker_main(void *arg)
+{
+  xbt_parmap_thread_data_t data = (xbt_parmap_thread_data_t) arg;
+  xbt_parmap_t parmap = data->parmap;
+  unsigned round = 0;
+  /* smx_context_t context = SIMIX_context_new(NULL, 0, NULL, NULL, NULL); */
+  /* SIMIX_context_set_current(context); */
+
+  XBT_DEBUG("New worker thread created");
+
+  /* Worker's main loop */
+  while (1) {
+    parmap->worker_wait_f(parmap, ++round);
+    if (parmap->status == XBT_PARMAP_WORK) {
+
+      XBT_DEBUG("Worker %d got a job", data->worker_id);
+
+      xbt_parmap_mc_work(parmap, data->worker_id);
+      parmap->worker_signal_f(parmap);
+
+      XBT_DEBUG("Worker %d has finished", data->worker_id);
+
+    /* We are destroying the parmap */
+    } else {
+      xbt_free(data);
+      parmap->worker_signal_f(parmap);
+      return NULL;
+    }
+  }
+}
+#endif
+
 #ifdef HAVE_FUTEX_H
 static void futex_wait(unsigned *uaddr, unsigned val)
 {
index 67c0c13..ea07092 100644 (file)
@@ -55,7 +55,7 @@ int main(int argc, char **argv)
       fflush(stdout);
     }
   }
-
+  xbt_free(values);
   MPI_Finalize();
   return 0;
 }
index cc0da58..90e04da 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 23f0b3d..4d4093b 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index aae539a..030ac6b 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 093822c..9a95d09 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 9a21317..46e9d88 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 7f5aad9..e7264dc 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 80bbfe2..60e5e9f 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index c333933..11202e8 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index f336884..9a0a418 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 50a6884..c307f82 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 114e424..7ccf420 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 750c568..ddc5164 100644 (file)
@@ -899,11 +899,9 @@ c------------------------------------------------------------------------------
       real    recv_buf(n)
       integer source, tag, count, rank, status(MPI_STATUS_SIZE)
       character*(*) name
-      logical foundError
 
       integer ierr, recv_src, recv_tag, recv_count
 
-      foundError = .false.
       recv_src = status(MPI_SOURCE)
       recv_tag = status(MPI_TAG)
       call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
@@ -913,20 +911,17 @@ c------------------------------------------------------------------------------
          print *, '[', rank, '] Unexpected source:', recv_src, 
      *            ' in ', name
          errs       = errs + 1
-         foundError = .true.
       end if
 
       if (recv_tag .ne. tag) then
          print *, '[', rank, '] Unexpected tag:', recv_tag, ' in ', name
          errs       = errs + 1
-         foundError = .true.
       end if
 
       if (recv_count .ne. count) then
          print *, '[', rank, '] Unexpected count:', recv_count,
      *            ' in ', name
          errs       = errs + 1
-         foundError = .true.
       end if
          
       call verify_test_data(recv_buf, count, n, name, errs )
index ba7092e..9bef6e1 100644 (file)
@@ -72,6 +72,7 @@ C A simple get intracomm for now
         endif
         myindex = mod( myindex, 4 ) + 1
         MTestGetIntracomm = comm .ne. MPI_COMM_NULL
+        qsmaller=.true.
         end
 C
         subroutine MTestFreeComm( comm )
index 361f481..1d9cc9e 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 867fadf..9dbea6c 100644 (file)
@@ -7,8 +7,8 @@
       program main
       use mpi
       integer ierr, errs
-      integer i, ans, size, rank, color, comm, newcomm
-      integer maxSize, displ
+      integer i, size, rank, comm, newcomm
+      integer maxSize
       parameter (maxSize=128)
       integer scounts(maxSize), sdispls(maxSize), stypes(maxSize)
       integer rcounts(maxSize), rdispls(maxSize), rtypes(maxSize)
index 023eec0..bc42b54 100644 (file)
       integer count, datatype
       integer i
       
-!      if (datatype .ne. MPI_INTEGER) then
-!         print *, 'Invalid datatype (',datatype,') passed to user_op()'
-!         return
-!      endif
+      if (datatype .eq. MPI_INTEGER) then
+         print *, 'Invalid datatype (',datatype,') passed to user_op()'
+         return
+      endif
 
       do i=1, count
          cout(i) = cin(i) + cout(i)
index 1ed0bf7..192cb02 100644 (file)
@@ -14,7 +14,7 @@
        integer rbuf(MAX_SIZE)
        integer rdispls(MAX_SIZE), rcounts(MAX_SIZE), rtypes(MAX_SIZE)
        integer ierr, errs
-       integer comm, root
+       integer comm
        integer rank, size
        integer iexpected, igot
        integer i, j
index 0b7406d..a8a0b84 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 1e1841f..a150618 100644 (file)
@@ -6,7 +6,7 @@
 !
       program main
       use mpi
-      integer atype, ierr
+      integer ierr
 !
       call mtest_init(ierr)
       call mpi_comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN,  &
index b146f4f..bf23687 100644 (file)
@@ -9,9 +9,9 @@
       use mpi
       integer max_asizev
       parameter (max_asizev=2)
-      integer (kind=MPI_ADDRESS_KIND) aint, aintv(max_asizev)
+      integer (kind=MPI_ADDRESS_KIND) aintv(max_asizev), gap
 
-      integer iarray(200), gap, intsize
+      integer iarray(200), intsize
       integer ierr, errs
 
       errs = 0
index 32a59e7..f2977fa 100644 (file)
@@ -13,7 +13,6 @@
       integer (kind=MPI_ADDRESS_KIND) aint, aintv(max_asizev)
 
       integer blocklens(max_asizev), dtypes(max_asizev)
-      integer displs(max_asizev)
       integer recvbuf(6*max_asizev)
       integer sendbuf(max_asizev), status(MPI_STATUS_SIZE)
       integer rank, size
index cfe3993..8eb870a 100644 (file)
@@ -40,7 +40,7 @@
        integer max_nints, max_dtypes, max_asizev
        parameter (max_nints = 10, max_dtypes = 10, max_asizev=10)
        integer intv(max_nints), dtypesv(max_dtypes)
-       integer (kind=MPI_ADDRESS_KIND) aint, aintv(max_asizev)
+       integer (kind=MPI_ADDRESS_KIND) aintv(max_asizev)
 
 !
        call mpi_type_get_envelope( dtype, nints, nadds, ntype, &
index 7234ddb..d64be2f 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 65f99ff..682e23c 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi AND SMPI_F2C)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index a7726e9..70f5c51 100644 (file)
       subroutine test_pair_irsend( comm, errs )
       use mpi
       integer comm, errs
-      integer rank, size, ierr, next, prev, tag, count, index, i
+      integer rank, size, ierr, next, prev, tag, count, index
       integer TEST_SIZE
       integer dupcom
       parameter (TEST_SIZE=2000)
       integer TEST_SIZE
       parameter (TEST_SIZE=2000)
       integer status(MPI_STATUS_SIZE)
-      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      real recv_buf(TEST_SIZE)
       logical verbose
       common /flags/ verbose
 !
       integer n, errs
       real buf(n)
       character *(*) name
-      integer count, ierr, i
+      integer count, i
 !
       do 10 i = 1, count
          if (buf(i) .ne. REAL(i)) then
index 957ed25..4db2b95 100644 (file)
@@ -15,6 +15,6 @@
 ! F90 tests from the F77 tests looks for mpif.h
       subroutine dummyupdate( extrastate )
       use mpi
-      integer (kind=MPI_ADDRESS_KIND) extrastate, valin, valout, val
-
+      integer (kind=MPI_ADDRESS_KIND) extrastate
+      extrastate=extrastate
       end
index 8844ce7..e82027e 100644 (file)
@@ -7,7 +7,7 @@
       subroutine query_fn( extrastate, status, ierr )
       use mpi
       integer status(MPI_STATUS_SIZE), ierr
-      integer (kind=MPI_ADDRESS_KIND) extrastate, valin, valout, val
+      integer (kind=MPI_ADDRESS_KIND) extrastate
 
 !
 !    set a default status
       call mpi_status_set_cancelled( status, .false., ierr)
       call mpi_status_set_elements( status, MPI_BYTE, 0, ierr )
       ierr = MPI_SUCCESS
+      extrastate = extrastate
       end
 !
       subroutine free_fn( extrastate, ierr )
       use mpi
-      integer value, ierr
-      integer (kind=MPI_ADDRESS_KIND) extrastate, valin, valout, val
+      integer ierr
+      integer (kind=MPI_ADDRESS_KIND) extrastate
 
       integer freefncall
       common /fnccalls/ freefncall
       use mpi
       integer ierr
       logical complete
-      integer (kind=MPI_ADDRESS_KIND) extrastate, valin, valout, val
+      integer (kind=MPI_ADDRESS_KIND) extrastate
 
 
       ierr = MPI_SUCCESS
+      complete=.true.
+      extrastate=extrastate
       end
 !
 !
@@ -64,7 +67,7 @@
        integer status(MPI_STATUS_SIZE)
        integer request
        external query_fn, free_fn, cancel_fn
-       integer (kind=MPI_ADDRESS_KIND) extrastate, valin, valout, val
+       integer (kind=MPI_ADDRESS_KIND) extrastate
 
        integer freefncall
        common /fnccalls/ freefncall
index ea6f413..8e44792 100644 (file)
@@ -87,6 +87,7 @@ end module
         endif
         myindex(rank+1) = mod( myindex(rank+1), 4 ) + 1
         MTestGetIntracomm = comm .ne. MPI_COMM_NULL
+        qsmaller=.true.
         end
 !
         subroutine MTestFreeComm( comm )
index f801d34..e67ccca 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index c9696b3..c84f088 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index d00d710..b705367 100644 (file)
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-if(enable_smpi)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
index 6da3d56..b64d9ec 100644 (file)
 $ ./xbt/mmalloc_test --log=root.fmt:%m%n
 > Allocating a new heap
 > HeapA allocated
-> 100 bytes allocated with offset 65000
-> 200 bytes allocated with offset 66000
-> 300 bytes allocated with offset 67000
-> 400 bytes allocated with offset 67200
-> 500 bytes allocated with offset 67400
-> 600 bytes allocated with offset 68000
-> 700 bytes allocated with offset 68400
-> 800 bytes allocated with offset 68800
-> 900 bytes allocated with offset 68c00
-> 1000 bytes allocated with offset 69000
-> 1100 bytes allocated with offset 6a000
-> 1200 bytes allocated with offset 6a800
-> 1300 bytes allocated with offset 6b000
-> 1400 bytes allocated with offset 6b800
-> 1500 bytes allocated with offset 6c000
-> 1600 bytes allocated with offset 6c800
-> 1700 bytes allocated with offset 6d000
-> 1800 bytes allocated with offset 6d800
-> 1900 bytes allocated with offset 6e000
-> 2000 bytes allocated with offset 6e800
-> 2100 bytes allocated with offset 6f000
-> 2200 bytes allocated with offset 70000
-> 2300 bytes allocated with offset 71000
-> 2400 bytes allocated with offset 72000
-> 2500 bytes allocated with offset 73000
-> 2600 bytes allocated with offset 74000
-> 2700 bytes allocated with offset 75000
-> 2800 bytes allocated with offset 76000
-> 2900 bytes allocated with offset 77000
-> 3000 bytes allocated with offset 78000
-> 3100 bytes allocated with offset 79000
-> 3200 bytes allocated with offset 7a000
-> 3300 bytes allocated with offset 7b000
-> 3400 bytes allocated with offset 7c000
-> 3500 bytes allocated with offset 7d000
-> 3600 bytes allocated with offset 7e000
-> 3700 bytes allocated with offset 7f000
-> 3800 bytes allocated with offset 80000
-> 3900 bytes allocated with offset 81000
-> 4000 bytes allocated with offset 82000
-> 4100 bytes allocated with offset 83000
-> 4200 bytes allocated with offset 85000
-> 4300 bytes allocated with offset 87000
-> 4400 bytes allocated with offset 89000
-> 4500 bytes allocated with offset 8b000
-> 4600 bytes allocated with offset 8d000
-> 4700 bytes allocated with offset 8f000
-> 4800 bytes allocated with offset 91000
-> 4900 bytes allocated with offset 93000
-> 5000 bytes allocated with offset 95000
-> 100 bytes allocated with offset 65080
-> 200 bytes allocated with offset 66100
-> 300 bytes allocated with offset 67600
-> 400 bytes allocated with offset 67800
-> 500 bytes allocated with offset 67a00
-> 600 bytes allocated with offset 69400
-> 700 bytes allocated with offset 69800
-> 800 bytes allocated with offset 69c00
-> 900 bytes allocated with offset 97000
-> 1000 bytes allocated with offset 97400
-> 1100 bytes allocated with offset 98000
-> 1200 bytes allocated with offset 98800
-> 1300 bytes allocated with offset 99000
-> 1400 bytes allocated with offset 99800
-> 1500 bytes allocated with offset 9a000
-> 1600 bytes allocated with offset 9a800
-> 1700 bytes allocated with offset 9b000
-> 1800 bytes allocated with offset 9b800
-> 1900 bytes allocated with offset 9c000
-> 2000 bytes allocated with offset 9c800
-> 2100 bytes allocated with offset 9d000
-> 2200 bytes allocated with offset 9e000
-> 2300 bytes allocated with offset 9f000
-> 2400 bytes allocated with offset a0000
-> 2500 bytes allocated with offset a1000
-> 2600 bytes allocated with offset a2000
-> 2700 bytes allocated with offset a3000
-> 2800 bytes allocated with offset a4000
-> 2900 bytes allocated with offset a5000
-> 3000 bytes allocated with offset a6000
-> 3100 bytes allocated with offset a7000
-> 3200 bytes allocated with offset a8000
-> 3300 bytes allocated with offset a9000
-> 3400 bytes allocated with offset aa000
-> 3500 bytes allocated with offset ab000
-> 3600 bytes allocated with offset ac000
-> 3700 bytes allocated with offset ad000
-> 3800 bytes allocated with offset ae000
-> 3900 bytes allocated with offset af000
-> 4000 bytes allocated with offset b0000
-> 4100 bytes allocated with offset b1000
-> 4200 bytes allocated with offset b3000
-> 4300 bytes allocated with offset b5000
-> 4400 bytes allocated with offset b7000
-> 4500 bytes allocated with offset b9000
-> 4600 bytes allocated with offset bb000
-> 4700 bytes allocated with offset bd000
-> 4800 bytes allocated with offset bf000
-> 4900 bytes allocated with offset c1000
-> 5000 bytes allocated with offset c3000
+> 100 bytes allocated with offset 45000
+> 200 bytes allocated with offset 46000
+> 300 bytes allocated with offset 47000
+> 400 bytes allocated with offset 47200
+> 500 bytes allocated with offset 47400
+> 600 bytes allocated with offset 48000
+> 700 bytes allocated with offset 48400
+> 800 bytes allocated with offset 48800
+> 900 bytes allocated with offset 48c00
+> 1000 bytes allocated with offset 49000
+> 1100 bytes allocated with offset 4a000
+> 1200 bytes allocated with offset 4a800
+> 1300 bytes allocated with offset 4b000
+> 1400 bytes allocated with offset 4b800
+> 1500 bytes allocated with offset 4c000
+> 1600 bytes allocated with offset 4c800
+> 1700 bytes allocated with offset 4d000
+> 1800 bytes allocated with offset 4d800
+> 1900 bytes allocated with offset 4e000
+> 2000 bytes allocated with offset 4e800
+> 2100 bytes allocated with offset 4f000
+> 2200 bytes allocated with offset 50000
+> 2300 bytes allocated with offset 51000
+> 2400 bytes allocated with offset 52000
+> 2500 bytes allocated with offset 53000
+> 2600 bytes allocated with offset 54000
+> 2700 bytes allocated with offset 55000
+> 2800 bytes allocated with offset 56000
+> 2900 bytes allocated with offset 57000
+> 3000 bytes allocated with offset 58000
+> 3100 bytes allocated with offset 59000
+> 3200 bytes allocated with offset 5a000
+> 3300 bytes allocated with offset 5b000
+> 3400 bytes allocated with offset 5c000
+> 3500 bytes allocated with offset 5d000
+> 3600 bytes allocated with offset 5e000
+> 3700 bytes allocated with offset 5f000
+> 3800 bytes allocated with offset 60000
+> 3900 bytes allocated with offset 61000
+> 4000 bytes allocated with offset 62000
+> 4100 bytes allocated with offset 63000
+> 4200 bytes allocated with offset 65000
+> 4300 bytes allocated with offset 67000
+> 4400 bytes allocated with offset 69000
+> 4500 bytes allocated with offset 6b000
+> 4600 bytes allocated with offset 6d000
+> 4700 bytes allocated with offset 6f000
+> 4800 bytes allocated with offset 71000
+> 4900 bytes allocated with offset 73000
+> 5000 bytes allocated with offset 75000
+> 100 bytes allocated with offset 45080
+> 200 bytes allocated with offset 46100
+> 300 bytes allocated with offset 47600
+> 400 bytes allocated with offset 47800
+> 500 bytes allocated with offset 47a00
+> 600 bytes allocated with offset 49400
+> 700 bytes allocated with offset 49800
+> 800 bytes allocated with offset 49c00
+> 900 bytes allocated with offset 77000
+> 1000 bytes allocated with offset 77400
+> 1100 bytes allocated with offset 78000
+> 1200 bytes allocated with offset 78800
+> 1300 bytes allocated with offset 79000
+> 1400 bytes allocated with offset 79800
+> 1500 bytes allocated with offset 7a000
+> 1600 bytes allocated with offset 7a800
+> 1700 bytes allocated with offset 7b000
+> 1800 bytes allocated with offset 7b800
+> 1900 bytes allocated with offset 7c000
+> 2000 bytes allocated with offset 7c800
+> 2100 bytes allocated with offset 7d000
+> 2200 bytes allocated with offset 7e000
+> 2300 bytes allocated with offset 7f000
+> 2400 bytes allocated with offset 80000
+> 2500 bytes allocated with offset 81000
+> 2600 bytes allocated with offset 82000
+> 2700 bytes allocated with offset 83000
+> 2800 bytes allocated with offset 84000
+> 2900 bytes allocated with offset 85000
+> 3000 bytes allocated with offset 86000
+> 3100 bytes allocated with offset 87000
+> 3200 bytes allocated with offset 88000
+> 3300 bytes allocated with offset 89000
+> 3400 bytes allocated with offset 8a000
+> 3500 bytes allocated with offset 8b000
+> 3600 bytes allocated with offset 8c000
+> 3700 bytes allocated with offset 8d000
+> 3800 bytes allocated with offset 8e000
+> 3900 bytes allocated with offset 8f000
+> 4000 bytes allocated with offset 90000
+> 4100 bytes allocated with offset 91000
+> 4200 bytes allocated with offset 93000
+> 4300 bytes allocated with offset 95000
+> 4400 bytes allocated with offset 97000
+> 4500 bytes allocated with offset 99000
+> 4600 bytes allocated with offset 9b000
+> 4700 bytes allocated with offset 9d000
+> 4800 bytes allocated with offset 9f000
+> 4900 bytes allocated with offset a1000
+> 5000 bytes allocated with offset a3000
 > All blocks were correctly allocated. Free every second block
 > Memset every second block to zero (yeah, they are not currently allocated :)
 > Re-allocate every second block
index 77be118..83108e6 100644 (file)
 $ ./xbt/mmalloc_test --log=root.fmt:%m%n
 > Allocating a new heap
 > HeapA allocated
-> 100 bytes allocated with offset 59000
-> 200 bytes allocated with offset 59100
-> 300 bytes allocated with offset 5a000
-> 400 bytes allocated with offset 5a200
-> 500 bytes allocated with offset 5a400
-> 600 bytes allocated with offset 5b000
-> 700 bytes allocated with offset 5b400
-> 800 bytes allocated with offset 5b800
-> 900 bytes allocated with offset 5bc00
-> 1000 bytes allocated with offset 5c000
-> 1100 bytes allocated with offset 5d000
-> 1200 bytes allocated with offset 5d800
-> 1300 bytes allocated with offset 5e000
-> 1400 bytes allocated with offset 5e800
-> 1500 bytes allocated with offset 5f000
-> 1600 bytes allocated with offset 5f800
-> 1700 bytes allocated with offset 60000
-> 1800 bytes allocated with offset 60800
-> 1900 bytes allocated with offset 61000
-> 2000 bytes allocated with offset 61800
-> 2100 bytes allocated with offset 62000
-> 2200 bytes allocated with offset 63000
-> 2300 bytes allocated with offset 64000
-> 2400 bytes allocated with offset 65000
-> 2500 bytes allocated with offset 66000
-> 2600 bytes allocated with offset 67000
-> 2700 bytes allocated with offset 68000
-> 2800 bytes allocated with offset 69000
-> 2900 bytes allocated with offset 6a000
-> 3000 bytes allocated with offset 6b000
-> 3100 bytes allocated with offset 6c000
-> 3200 bytes allocated with offset 6d000
-> 3300 bytes allocated with offset 6e000
-> 3400 bytes allocated with offset 6f000
-> 3500 bytes allocated with offset 70000
-> 3600 bytes allocated with offset 71000
-> 3700 bytes allocated with offset 72000
-> 3800 bytes allocated with offset 73000
-> 3900 bytes allocated with offset 74000
-> 4000 bytes allocated with offset 75000
-> 4100 bytes allocated with offset 76000
-> 4200 bytes allocated with offset 78000
-> 4300 bytes allocated with offset 7a000
-> 4400 bytes allocated with offset 7c000
-> 4500 bytes allocated with offset 7e000
-> 4600 bytes allocated with offset 80000
-> 4700 bytes allocated with offset 82000
-> 4800 bytes allocated with offset 84000
-> 4900 bytes allocated with offset 86000
-> 5000 bytes allocated with offset 88000
-> 100 bytes allocated with offset 59200
-> 200 bytes allocated with offset 59300
-> 300 bytes allocated with offset 5a600
-> 400 bytes allocated with offset 5a800
-> 500 bytes allocated with offset 5aa00
-> 600 bytes allocated with offset 5c400
-> 700 bytes allocated with offset 5c800
-> 800 bytes allocated with offset 5cc00
-> 900 bytes allocated with offset 8a000
-> 1000 bytes allocated with offset 8a400
-> 1100 bytes allocated with offset 8b000
-> 1200 bytes allocated with offset 8b800
-> 1300 bytes allocated with offset 8c000
-> 1400 bytes allocated with offset 8c800
-> 1500 bytes allocated with offset 8d000
-> 1600 bytes allocated with offset 8d800
-> 1700 bytes allocated with offset 8e000
-> 1800 bytes allocated with offset 8e800
-> 1900 bytes allocated with offset 8f000
-> 2000 bytes allocated with offset 8f800
-> 2100 bytes allocated with offset 90000
-> 2200 bytes allocated with offset 91000
-> 2300 bytes allocated with offset 92000
-> 2400 bytes allocated with offset 93000
-> 2500 bytes allocated with offset 94000
-> 2600 bytes allocated with offset 95000
-> 2700 bytes allocated with offset 96000
-> 2800 bytes allocated with offset 97000
-> 2900 bytes allocated with offset 98000
-> 3000 bytes allocated with offset 99000
-> 3100 bytes allocated with offset 9a000
-> 3200 bytes allocated with offset 9b000
-> 3300 bytes allocated with offset 9c000
-> 3400 bytes allocated with offset 9d000
-> 3500 bytes allocated with offset 9e000
-> 3600 bytes allocated with offset 9f000
-> 3700 bytes allocated with offset a0000
-> 3800 bytes allocated with offset a1000
-> 3900 bytes allocated with offset a2000
-> 4000 bytes allocated with offset a3000
-> 4100 bytes allocated with offset a4000
-> 4200 bytes allocated with offset a6000
-> 4300 bytes allocated with offset a8000
-> 4400 bytes allocated with offset aa000
-> 4500 bytes allocated with offset ac000
-> 4600 bytes allocated with offset ae000
-> 4700 bytes allocated with offset b0000
-> 4800 bytes allocated with offset b2000
-> 4900 bytes allocated with offset b4000
-> 5000 bytes allocated with offset b6000
+> 100 bytes allocated with offset 39000
+> 200 bytes allocated with offset 39100
+> 300 bytes allocated with offset 3a000
+> 400 bytes allocated with offset 3a200
+> 500 bytes allocated with offset 3a400
+> 600 bytes allocated with offset 3b000
+> 700 bytes allocated with offset 3b400
+> 800 bytes allocated with offset 3b800
+> 900 bytes allocated with offset 3bc00
+> 1000 bytes allocated with offset 3c000
+> 1100 bytes allocated with offset 3d000
+> 1200 bytes allocated with offset 3d800
+> 1300 bytes allocated with offset 3e000
+> 1400 bytes allocated with offset 3e800
+> 1500 bytes allocated with offset 3f000
+> 1600 bytes allocated with offset 3f800
+> 1700 bytes allocated with offset 40000
+> 1800 bytes allocated with offset 40800
+> 1900 bytes allocated with offset 41000
+> 2000 bytes allocated with offset 41800
+> 2100 bytes allocated with offset 42000
+> 2200 bytes allocated with offset 43000
+> 2300 bytes allocated with offset 44000
+> 2400 bytes allocated with offset 45000
+> 2500 bytes allocated with offset 46000
+> 2600 bytes allocated with offset 47000
+> 2700 bytes allocated with offset 48000
+> 2800 bytes allocated with offset 49000
+> 2900 bytes allocated with offset 4a000
+> 3000 bytes allocated with offset 4b000
+> 3100 bytes allocated with offset 4c000
+> 3200 bytes allocated with offset 4d000
+> 3300 bytes allocated with offset 4e000
+> 3400 bytes allocated with offset 4f000
+> 3500 bytes allocated with offset 50000
+> 3600 bytes allocated with offset 51000
+> 3700 bytes allocated with offset 52000
+> 3800 bytes allocated with offset 53000
+> 3900 bytes allocated with offset 54000
+> 4000 bytes allocated with offset 55000
+> 4100 bytes allocated with offset 56000
+> 4200 bytes allocated with offset 58000
+> 4300 bytes allocated with offset 5a000
+> 4400 bytes allocated with offset 5c000
+> 4500 bytes allocated with offset 5e000
+> 4600 bytes allocated with offset 60000
+> 4700 bytes allocated with offset 62000
+> 4800 bytes allocated with offset 64000
+> 4900 bytes allocated with offset 66000
+> 5000 bytes allocated with offset 68000
+> 100 bytes allocated with offset 39200
+> 200 bytes allocated with offset 39300
+> 300 bytes allocated with offset 3a600
+> 400 bytes allocated with offset 3a800
+> 500 bytes allocated with offset 3aa00
+> 600 bytes allocated with offset 3c400
+> 700 bytes allocated with offset 3c800
+> 800 bytes allocated with offset 3cc00
+> 900 bytes allocated with offset 6a000
+> 1000 bytes allocated with offset 6a400
+> 1100 bytes allocated with offset 6b000
+> 1200 bytes allocated with offset 6b800
+> 1300 bytes allocated with offset 6c000
+> 1400 bytes allocated with offset 6c800
+> 1500 bytes allocated with offset 6d000
+> 1600 bytes allocated with offset 6d800
+> 1700 bytes allocated with offset 6e000
+> 1800 bytes allocated with offset 6e800
+> 1900 bytes allocated with offset 6f000
+> 2000 bytes allocated with offset 6f800
+> 2100 bytes allocated with offset 70000
+> 2200 bytes allocated with offset 71000
+> 2300 bytes allocated with offset 72000
+> 2400 bytes allocated with offset 73000
+> 2500 bytes allocated with offset 74000
+> 2600 bytes allocated with offset 75000
+> 2700 bytes allocated with offset 76000
+> 2800 bytes allocated with offset 77000
+> 2900 bytes allocated with offset 78000
+> 3000 bytes allocated with offset 79000
+> 3100 bytes allocated with offset 7a000
+> 3200 bytes allocated with offset 7b000
+> 3300 bytes allocated with offset 7c000
+> 3400 bytes allocated with offset 7d000
+> 3500 bytes allocated with offset 7e000
+> 3600 bytes allocated with offset 7f000
+> 3700 bytes allocated with offset 80000
+> 3800 bytes allocated with offset 81000
+> 3900 bytes allocated with offset 82000
+> 4000 bytes allocated with offset 83000
+> 4100 bytes allocated with offset 84000
+> 4200 bytes allocated with offset 86000
+> 4300 bytes allocated with offset 88000
+> 4400 bytes allocated with offset 8a000
+> 4500 bytes allocated with offset 8c000
+> 4600 bytes allocated with offset 8e000
+> 4700 bytes allocated with offset 90000
+> 4800 bytes allocated with offset 92000
+> 4900 bytes allocated with offset 94000
+> 5000 bytes allocated with offset 96000
 > All blocks were correctly allocated. Free every second block
 > Memset every second block to zero (yeah, they are not currently allocated :)
 > Re-allocate every second block
index e7522cc..858e611 100755 (executable)
@@ -40,13 +40,13 @@ print OUTPUT <<EOF;
 This file was generated by tools/doxygen/index_create.pl. DO NOT EDIT.
 
 /** \\defgroup API_index Full Index
-  * \\brief The alphabetical list of all functions, macros and types 
 *  defined by SimGrid
 *
 * List of all functions, variables, defines, enums, and typedefs with
-  * links to the files they belong to. 
 *
 * \\htmlonly Altough completely useless, the complete list of structures defined can be found <a href="annotated.html">here</a> \\endhtmlonly
+ * \\brief The alphabetical list of all functions, macros and types
+ *  defined by SimGrid
+ *
+ * List of all functions, variables, defines, enums, and typedefs with
+ * links to the files they belong to.
+ *
* \\htmlonly Although completely useless, the complete list of structures defined can be found <a href="annotated.html">here</a> \\endhtmlonly
 
 
 EOF