Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 24 Sep 2013 18:23:58 +0000 (20:23 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 24 Sep 2013 18:23:58 +0000 (20:23 +0200)
112 files changed:
ChangeLog
buildtools/Cmake/AddTests.cmake
buildtools/Cmake/Flags.cmake
buildtools/Cmake/Option.cmake
buildtools/Cmake/Pipol.cmake
buildtools/Cmake/PrintArgs.cmake
buildtools/jenkins/run.bat [changed mode: 0644->0755]
buildtools/jenkins/run.sh [changed mode: 0644->0755]
buildtools/jenkins/runmingw.sh [changed mode: 0644->0755]
buildtools/pipol/Experimental_bindings.sh
buildtools/pipol/Nightly_simgrid.sh
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]
examples/smpi/replay/actions_allgatherv.txt
examples/smpi/replay/actions_alltoallv.txt
examples/smpi/replay/smpi_replay.tesh
include/msg/datatypes.h
include/msg/msg.h
include/simgrid/simix.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_io.c
src/simix/smx_io_private.h
src/smpi/colls/allgatherv-mpich-rdb.c
src/smpi/colls/alltoallv-ompi-basic-linear.c
src/smpi/colls/bcast-ompi-pipeline.c
src/smpi/colls/bcast-ompi-split-bintree.c
src/smpi/colls/gather-ompi.c
src/smpi/colls/reduce-binomial.c
src/smpi/colls/reduce-ompi.c
src/smpi/colls/reduce-scatter-gather.c
src/smpi/colls/reduce_scatter-mpich.c
src/smpi/colls/smpi_automatic_selector.c
src/smpi/colls/smpi_mpich_selector.c
src/smpi/colls/smpi_openmpi_selector.c
src/smpi/smpi_bench.c
src/smpi/smpi_global.c
src/smpi/smpi_replay.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
src/xbt/xbt_main.c
src/xbt/xbt_os_time.c
teshsuite/smpi/allgatherv_coll.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/smpi/reduce_scatter_coll.c
teshsuite/smpi/scatter.c
teshsuite/xbt/mmalloc_32.tesh
teshsuite/xbt/mmalloc_64.tesh
tools/doxygen/index_create.pl

index 941c3bf..48b472a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,7 +45,8 @@ SimGrid (3.10) NOT RELEASED; urgency=low
  * Add a --cfg:tracing/smpi/internals option, to trace internal communications
    happening inside a collective SMPI call.
  * Fix the behavior of complex data types handling
- * replace MPICH-1 test suite by the one from MPICH 3.0.4
+ * replace MPICH-1 test suite by the one from MPICH 3.0.4. Can be built using
+   enable_smpi_MPICH3_testsuite flag in cmake. Run with ctest.
  * Add all missing Fortran bindings, SMPI should work with Fortran 90
    (no privatization of global variables yet)
 
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 2a2a96f..c573f81 100644 (file)
@@ -25,8 +25,16 @@ endif()
 
 if(enable_compile_optimizations)
   set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ")
-  if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
-    set(optCFLAGS "${optCFLAGS}-flto ")
+  if(WIN32)
+    if (COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.7")
+    # On windows, we need 4.8 or higher to enable lto because of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50293
+      set(optCFLAGS "${optCFLAGS} -flto ")
+    endif()
+  else()    
+    # On non-windows, 4.6 is enough for that
+    if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
+      set(optCFLAGS "${optCFLAGS} -flto ")
+    endif()
   endif()
 else()
   set(optCFLAGS "-O0 ")
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("")
old mode 100644 (file)
new mode 100755 (executable)
index 867f69c..16c8cd6
@@ -1 +1 @@
-c:\mingw\msys\1.0\bin\sh -login .\buildtools\Jenkins\runmingw.sh %1 %2
+c:\mingw\msys\1.0\bin\sh -login .\buildtools\jenkins\runmingw.sh %1 %2
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
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 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..bd59651 100644 (file)
@@ -29,12 +29,13 @@ int coordinator(int argc, char *argv[])
   int CS_used = 0;   
   msg_task_t task = NULL, answer = NULL; 
   xbt_dynar_t requests = xbt_dynar_new(sizeof(char *), NULL);
+  char *req;
 
   while(1){  
     MSG_task_receive(&task, "coordinator");
     const char *kind = MSG_task_get_name(task); 
     if (!strcmp(kind, "request")) {    
-      char *req = MSG_task_get_data(task);
+      req = MSG_task_get_data(task);
       if (CS_used) {           
         XBT_INFO("CS already used. Queue the request.");
         xbt_dynar_push(requests, &req);
@@ -50,12 +51,12 @@ int coordinator(int argc, char *argv[])
     } else {      
       if (!xbt_dynar_is_empty(requests)) {
         XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
-        char *req;
         xbt_dynar_pop(requests, &req);
         if(strcmp(req, "1") != 0){
           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");
@@ -65,6 +66,7 @@ int coordinator(int argc, char *argv[])
     MSG_task_destroy(task);
     task = NULL;
     kind = NULL;
+    req = NULL;
   }
  
   return 0;
@@ -127,14 +129,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..2e5bd61
--- /dev/null
@@ -0,0 +1,240 @@
+#! ./tesh
+
+! expect signal SIGABRT
+! timeout 60
+$ ${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] (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] (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] (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] (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] (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 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] (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] (3:client@Fafard) Propositions changed : r=1, cs=0
+> [  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] (0:@) Pair 86 already reached (equal to pair 74) !
+> [  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:@) [(2)Boivin (client)] 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:@) [(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:@) [(3)Fafard (client)] Wait(comm=(verbose only) [(3)Fafard (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)] 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:@) Expanded pairs = 86
+> [  0.000000] (0:@) Visited pairs = 461
+> [  0.000000] (0:@) Executed transitions = 460
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 f0c0e58..d5d4024 100644 (file)
@@ -3,10 +3,10 @@
 2 init
 3 init
 
-0 allGatherV 275427 275427 275427 275427 204020 0 275427 550854 826281 0 0
-1 allGatherV 275427 275427 275427 275427 204020 0 275427 550854 826281 0 0
-2 allGatherV 275427 275427 275427 275427 204020 0 275427 550854 826281 0 0
-3 allGatherV 204020 275427 275427 275427 204020 0 275427 550854 826281 0 0
+0 allGatherV 275427 275427 275427 275427 204020 0 0
+1 allGatherV 275427 275427 275427 275427 204020 0 0
+2 allGatherV 275427 275427 275427 275427 204020 0 0
+3 allGatherV 204020 275427 275427 275427 204020 0 0
 
 0 finalize
 1 finalize
index cd4f95c..a96f7b7 100644 (file)
@@ -2,10 +2,9 @@
 1 init
 2 init
 
-0 allToAllV 100 1 40 30 1 20 150 1000 1 80 100 1 20 110
-1 allToAllV 1000 80 1 40 1 100 160 1000 40 1 30 10 70 140
-2 allToAllV 1000 100 30 1 1 120 150 1000 30 40 1 1 50 60
-
+0 allToAllV 100 1 40 30 1000 1 80 100
+1 allToAllV 1000 80 1 40 1000 40 1 30
+2 allToAllV 1000 100 30 1 1000 30 40 1
 
 0 finalize
 1 finalize
index cf6c20f..664f7a8 100644 (file)
@@ -337,13 +337,31 @@ $ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_rep
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '1'
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [Tremblay:0:(0) 0.003999] [smpi_replay/VERBOSE] 0 allToAllV 100 1 40 30 1 20 150 1000 1 80 100 1 20 110 0.003999
-> [Jupiter:1:(0) 0.006934] [smpi_replay/VERBOSE] 1 allToAllV 1000 80 1 40 1 100 160 1000 40 1 30 10 70 140 0.006934
-> [Fafard:2:(0) 0.006936] [smpi_replay/VERBOSE] 2 allToAllV 1000 100 30 1 1 120 150 1000 30 40 1 1 50 60 0.006936
+> [Tremblay:0:(0) 0.003999] [smpi_replay/VERBOSE] 0 allToAllV 100 1 40 30 1000 1 80 100 0.003999
+> [Jupiter:1:(0) 0.006934] [smpi_replay/VERBOSE] 1 allToAllV 1000 80 1 40 1000 40 1 30 0.006934
+> [Fafard:2:(0) 0.006936] [smpi_replay/VERBOSE] 2 allToAllV 1000 100 30 1 1000 30 40 1 0.006936
 > [Fafard:2:(0) 0.006936] [smpi_replay/INFO] Simulation time 0.00693554
 
 $ rm -f replay/one_trace
 
+p Test of AllGatherv replay with SMPI (one trace for all processes)
+
+< replay/actions_allgatherv.txt
+$ mkfile replay/one_trace
+
+$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '1'
+> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [Tremblay:0:(0) 0.841244] [smpi_replay/VERBOSE] 0 allGatherV 275427 275427 275427 275427 204020 0 0 0.841244
+> [Fafard:2:(0) 1.239482] [smpi_replay/VERBOSE] 2 allGatherV 275427 275427 275427 275427 204020 0 0 1.239482
+> [Jupiter:1:(0) 1.239482] [smpi_replay/VERBOSE] 1 allGatherV 275427 275427 275427 275427 204020 0 0 1.239482
+> [Jupiter:1:(0) 1.239482] [smpi_replay/INFO] Simulation time 1.23948
+
+$ rm -f replay/one_trace
+
 p Test of waitall replay with SMPI (one trace for all processes)
 
 < replay/actions_waitall.txt
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 55685ad..a748f1e 100644 (file)
@@ -98,9 +98,11 @@ XBT_PUBLIC(size_t) MSG_storage_get_free_size(const char* name);
 XBT_PUBLIC(size_t) MSG_storage_get_used_size(const char* name);
 XBT_PUBLIC(msg_storage_t) MSG_storage_get_by_name(const char *name);
 XBT_PUBLIC(xbt_dict_t) MSG_storage_get_properties(msg_storage_t storage);
+XBT_PUBLIC(void) MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn);
 XBT_PUBLIC(xbt_dynar_t) MSG_storages_as_dynar(void);
 XBT_PUBLIC(msg_error_t) MSG_storage_set_data(msg_storage_t host, void *data);
 XBT_PUBLIC(void *) MSG_storage_get_data(msg_storage_t storage);
+XBT_PUBLIC(xbt_dict_t) MSG_storage_get_content(msg_storage_t storage);
 /************************** AS Router handling ************************************/
 XBT_PUBLIC(const char *) MSG_as_router_get_property_value(const char* asr, const char *name);
 XBT_PUBLIC(xbt_dict_t) MSG_as_router_get_properties(const char* asr);
index fdd78b7..1c095a8 100644 (file)
@@ -497,6 +497,7 @@ XBT_PUBLIC(size_t) simcall_storage_get_used_size (const char* name);
 XBT_PUBLIC(xbt_dict_t) simcall_storage_get_properties(smx_storage_t storage);
 XBT_PUBLIC(void*) SIMIX_storage_get_data(smx_storage_t storage);
 XBT_PUBLIC(void) SIMIX_storage_set_data(smx_storage_t storage, void *data);
+XBT_PUBLIC(xbt_dict_t) SIMIX_storage_get_content(smx_storage_t storage);
 
 /************************** AS router   **********************************/
 XBT_PUBLIC(xbt_dict_t) SIMIX_asr_get_properties(const char *name);
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 e93f43f..5e767d2 100644 (file)
@@ -237,7 +237,8 @@ typedef struct surf_storage_model_extension_public {
   surf_action_t(*write) (void *storage, size_t size, surf_file_t fd);
   surf_action_t(*stat) (void *storage, surf_file_t fd);
   surf_action_t(*ls) (void *storage, const char *path);
-  xbt_dict_t(*get_properties) (const void *resource);
+  xbt_dict_t(*get_properties) (const void *storage);
+  xbt_dict_t(*get_content) (void *storage);
 } s_surf_model_extension_storage_t;
 
      /** \ingroup SURF_models
@@ -359,8 +360,8 @@ static inline void *surf_cpu_resource_priv(const void *host) {
 static inline void *surf_workstation_resource_priv(const void *host){
   return xbt_lib_get_level((void *)host, SURF_WKS_LEVEL);
 }
-static inline void *surf_storage_resource_priv(const void *host){
-  return xbt_lib_get_level((void *)host, SURF_STORAGE_LEVEL);
+static inline void *surf_storage_resource_priv(const void *storage){
+  return xbt_lib_get_level((void *)storage, SURF_STORAGE_LEVEL);
 }
 
 static inline void *surf_cpu_resource_by_name(const char *name) {
@@ -377,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..1007083 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 ****************************/
 /********************************************************************/
@@ -128,7 +128,6 @@ static int compare_areas_with_type(void *area1, void *area2, xbt_dict_t types, x
   dw_type_t member, subtype, subsubtype;
   int elm_size, i, res, switch_types = 0;
   void *addr_pointed1, *addr_pointed2;
-  int pointed_area_size1, pointed_area_size2;
 
   switch(type->type){
   case e_dw_base_type:
@@ -194,8 +193,6 @@ static int compare_areas_with_type(void *area1, void *area2, xbt_dict_t types, x
       addr_pointed1 = *((void **)(area1)); 
       addr_pointed2 = *((void **)(area2));
       
-      if((addr_pointed1 == addr_pointed2) && ((pointed_area_size1 = get_pointed_area_size(addr_pointed1, 1)) != (pointed_area_size2 = get_pointed_area_size(addr_pointed2, 2))))
-        return -1;
       if(addr_pointed1 == NULL && addr_pointed2 == NULL)
         return 0;
       if(already_compared_pointers(addr_pointed1, addr_pointed2) != -1)
@@ -271,17 +268,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){
+    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);
       xbt_dynar_free(&compared_pointers);
+      compared_pointers = NULL;
       return 1;
     }
 
   }
 
   xbt_dynar_free(&compared_pointers);
+  compared_pointers = NULL;
 
   return 0;
 
@@ -299,6 +296,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;
@@ -314,28 +312,30 @@ static int compare_local_variables(mc_snapshot_stack_t stack1, mc_snapshot_stack
       offset1 = (char *)current_var1->address - (char *)std_heap;
       offset2 = (char *)current_var2->address - (char *)std_heap;
       if(current_var1->region == 1)
-        res = compare_areas_with_type( (char *)heap1 + offset1, (char *)heap2 + offset2, mc_variables_type_libsimgrid, mc_variables_type_binary, current_var1->type, 0, 1, start_data_libsimgrid, 0l);
+        res = compare_areas_with_type( (char *)heap1 + offset1, (char *)heap2 + offset2, mc_variables_type_libsimgrid, mc_variables_type_binary, current_var1->type, 0, 1, start_data_libsimgrid, 0);
       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);
+        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, 0);
       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 (%p - %p) in frame %s  is different between snapshots", current_var1->name,(char *)heap1 + offset1, (char *)heap2 + offset2, 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 +359,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 +373,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 +404,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 +432,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 +442,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 +480,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 +495,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 +514,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 +527,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 +544,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 +557,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 +572,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 +587,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 +611,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..562e66b 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){
@@ -1480,6 +1474,23 @@ void MC_ignore_local_variable(const char *var_name, const char *frame_name){
           } 
         }
       }
+       xbt_dict_foreach(mc_local_variables_binary, dict_cursor, current_frame_name, frame){
+        start = 0;
+        end = xbt_dynar_length(frame->variables) - 1;
+        while(start <= end){
+          cursor = (start + end) / 2;
+          current_var = (dw_variable_t)xbt_dynar_get_as(frame->variables, cursor, dw_variable_t); 
+          if(strcmp(current_var->name, var_name) == 0){
+            xbt_dynar_remove_at(frame->variables, cursor, NULL);
+            start = 0;
+            end = xbt_dynar_length(frame->variables) - 1;
+          }else if(strcmp(current_var->name, var_name) < 0){
+            start = cursor + 1;
+          }else{
+            end = cursor - 1;
+          } 
+        }
+      }
     }else{
       xbt_dynar_t variables_list = ((dw_frame_t)xbt_dict_get_or_null(mc_local_variables_libsimgrid, frame_name))->variables;
       start = 0;
@@ -1554,10 +1565,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 +1575,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 +1587,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 +1612,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 +1732,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 +1761,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 d69d762..24147ac 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){
@@ -242,9 +242,21 @@ xbt_dict_t MSG_storage_get_properties(msg_storage_t storage)
   return (simcall_storage_get_properties(storage));
 }
 
+/** \ingroup msg_storage_management
+ * \brief Change the value of a given storage property
+ *
+ * \param storage a storage
+ * \param name a property name
+ * \param value what to change the property to
+ * \param free_ctn the freeing function to use to kill the value on need
+ */
+void MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn) {
+  xbt_dict_set(MSG_storage_get_properties(storage), name, value,free_ctn);
+}
+
 /** \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)
@@ -290,7 +302,7 @@ msg_error_t MSG_storage_set_data(msg_storage_t storage, void *data)
  *
  * \brief Returns the user data of a #msg_storage_t.
  *
- * This functions checks whether \a storage is a valid pointer or not and return
+ * This functions checks whether \a storage is a valid pointer or not and returns
    the user data associated to \a storage if it is possible.
  */
 void *MSG_storage_get_data(msg_storage_t storage)
@@ -298,3 +310,12 @@ void *MSG_storage_get_data(msg_storage_t storage)
   return SIMIX_storage_get_data(storage);
 }
 
+/** \ingroup msg_storage_management
+ *
+ * \brief Returns the content (file list) of a #msg_storage_t.
+ * \param storage a storage
+ */
+xbt_dict_t MSG_storage_get_content(msg_storage_t storage){
+
+       return SIMIX_storage_get_content(storage);
+}
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 f61b9e3..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,7 +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);
 }
 
@@ -359,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) {
@@ -399,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 */
@@ -415,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: ");
@@ -428,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: ");
@@ -441,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                                                   */
@@ -457,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,
@@ -472,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: ");
@@ -486,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: ");
@@ -499,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);
 
@@ -515,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 */
 
@@ -524,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)",
@@ -546,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 = (char*)"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 = (char*)"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 = (char*)"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 = (char*)"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",
@@ -590,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 = (char*)"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",
@@ -620,64 +615,61 @@ void sg_config_init(int *argc, char **argv)
 #endif
 
     /* do verbose-exit */
-    default_value = (char*)"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 = (char*)"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 = (char*)"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",
@@ -686,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",
@@ -701,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 = (char*)"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"
@@ -773,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 = (char*)"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");
@@ -880,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;
@@ -898,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);
@@ -953,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 daa80e5..1c16b3b 100644 (file)
@@ -338,12 +338,22 @@ void SIMIX_storage_set_data(smx_storage_t storage, void *data){
 void* SIMIX_pre_storage_get_data(smx_simcall_t simcall,smx_storage_t storage){
   return SIMIX_storage_get_data(storage);
 }
+
 void* SIMIX_storage_get_data(smx_storage_t storage){
   xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
 
   return SIMIX_storage_priv(storage)->data;
 }
 
+xbt_dict_t SIMIX_pre_storage_get_content(smx_simcall_t simcall, smx_storage_t storage){
+  return SIMIX_storage_get_content(storage);
+}
+
+xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage){
+  xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
+  return surf_storage_model->extension.storage.get_content(storage);
+}
+
 void SIMIX_post_io(smx_action_t action)
 {
   xbt_fifo_item_t i;
index f2496b9..7914bc8 100644 (file)
@@ -55,6 +55,9 @@ xbt_dict_t SIMIX_pre_storage_get_properties(smx_simcall_t, smx_storage_t);
 void SIMIX_pre_storage_set_data(smx_simcall_t, smx_storage_t, void*);
 void* SIMIX_pre_storage_get_data(smx_simcall_t, smx_storage_t);
 
+xbt_dict_t SIMIX_pre_storage_get_content(smx_simcall_t simcall, smx_storage_t storage);
+xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage);
+
 void SIMIX_post_io(smx_action_t action);
 void SIMIX_io_destroy(smx_action_t action);
 void SIMIX_io_finish(smx_action_t action);
index 454288d..8391807 100644 (file)
@@ -206,5 +206,6 @@ int smpi_coll_tuned_allgatherv_mpich_rdb (
                 position += recvcounts[j];
             }
         }
-return MPI_SUCCESS;
+  free(tmp_buf);
+  return MPI_SUCCESS;
 }
index abc29f5..fe035ae 100644 (file)
@@ -93,6 +93,7 @@ smpi_coll_tuned_alltoallv_ompi_basic_linear(void *sbuf, int *scounts, int *sdisp
     for (i = 0; i < nreqs; ++i) {
       if(ireqs[i]!=MPI_REQUEST_NULL)smpi_mpi_request_free(&ireqs[i]);
     }
+    free(ireqs);
 
     return MPI_SUCCESS;
 }
index cd0e3ce..7085562 100644 (file)
@@ -199,6 +199,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
     }
 
     if( NULL != send_reqs ) free(send_reqs);
+    xbt_free(tree);
 
     return (MPI_SUCCESS);
 }
index 58bf387..a0f1876 100644 (file)
@@ -291,6 +291,7 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
                                             comm, MPI_STATUS_IGNORE); 
         }
     }
+    xbt_free(tree);
     return (MPI_SUCCESS);
   
 
index 4a7489b..df34f27 100644 (file)
@@ -172,6 +172,7 @@ smpi_coll_tuned_gather_ompi_binomial(void *sbuf, int scount,
        /* other non-leaf nodes */
        free(tempbuf);
     }
+    xbt_free(bmtree);
     return MPI_SUCCESS;
 
  err_hndl:
index a7ece3e..c3b4067 100644 (file)
@@ -70,14 +70,17 @@ int smpi_coll_tuned_reduce_binomial(void *sendbuf, void *recvbuf, int count,
     mask <<= 1;
   }
 
-if (!is_commutative && (root != 0)){
-  if (rank == 0){
-    smpi_mpi_send(recvbuf, count, datatype, root,tag, comm);
-  }else if (rank == root){
-    smpi_mpi_recv(recvbuf, count, datatype, 0, tag, comm, &status);
+  if (!is_commutative && (root != 0)){
+    if (rank == 0){
+      smpi_mpi_send(recvbuf, count, datatype, root,tag, comm);
+    }else if (rank == root){
+      smpi_mpi_recv(recvbuf, count, datatype, 0, tag, comm, &status);
+    }
   }
-}
 
+  if (rank != root) {
+        xbt_free(recvbuf);
+  }
   free(tmp_buf);
 
   return 0;
index 25353aa..0b71d60 100644 (file)
@@ -302,6 +302,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
             free(sreq);
         }
     }
+    free(tree);
     return MPI_SUCCESS;
 
  error_hndl:  /* error handler */
index 24ad911..19c6794 100644 (file)
@@ -387,6 +387,8 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf,
       }
     }
   }
+  if (tmp_buf)
+    free(tmp_buf);
   if (cnts)
     free(cnts);
   if (disps)
index 586142b..76cbf0f 100644 (file)
@@ -182,6 +182,9 @@ int smpi_coll_tuned_reduce_scatter_mpich_noncomm(void *sendbuf, void *recvbuf, i
 
     tmp_buf0=( void *)xbt_malloc( true_extent * total_count);
     tmp_buf1=( void *)xbt_malloc( true_extent * total_count);
+    void *tmp_buf0_save=tmp_buf0;
+    void *tmp_buf1_save=tmp_buf1;
+
     /* adjust for potential negative lower bound in datatype */
     tmp_buf0 = (void *)((char*)tmp_buf0 - true_lb);
     tmp_buf1 = (void *)((char*)tmp_buf1 - true_lb);
@@ -249,6 +252,8 @@ int smpi_coll_tuned_reduce_scatter_mpich_noncomm(void *sendbuf, void *recvbuf, i
     result_ptr = (char *)(buf0_was_inout ? tmp_buf0 : tmp_buf1) + recv_offset * true_extent;
     mpi_errno = smpi_datatype_copy(result_ptr, size, datatype,
                                recvbuf, size, datatype);
+    xbt_free(tmp_buf0_save);
+    xbt_free(tmp_buf1_save);
     if (mpi_errno) return(mpi_errno);
     return MPI_SUCCESS;
 }
@@ -469,8 +474,8 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                     }
                 }
 
-                //smpi_datatype_free(&sendtype);
-                //smpi_datatype_free(&recvtype);
+                smpi_datatype_free(&sendtype);
+                smpi_datatype_free(&recvtype);
 
                 mask <<= 1;
                 i++;
@@ -481,6 +486,7 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                                        recvcounts[rank], datatype, recvbuf,
                                        recvcounts[rank], datatype);
             if (mpi_errno) return(mpi_errno);
+
     xbt_free(disps);
     xbt_free(tmp_recvbuf);
     xbt_free(tmp_results);
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 7ebc7dd..d82c2a3 100644 (file)
@@ -696,8 +696,12 @@ int smpi_coll_tuned_scatter_mpich(void *sbuf, int scount,
       scount=rcount;
       sdtype=rdtype;
   }
-        return smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype, 
+  int ret= smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype,
                                                        rbuf, rcount, rdtype, 
                                                        root, comm);
+  if(smpi_comm_rank(comm)!=root){
+      xbt_free(sbuf);
+  }
+  return ret;
 }
 
index b24a7f4..e2d7533 100644 (file)
@@ -601,9 +601,13 @@ int smpi_coll_tuned_scatter_ompi(void *sbuf, int scount,
             scount=rcount;
             sdtype=rdtype;
         }
-        return smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype, 
-                                                       rbuf, rcount, rdtype, 
-                                                       root, comm);
+        int ret=smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype,
+            rbuf, rcount, rdtype,
+            root, comm);
+        if(rank!=root){
+            xbt_free(sbuf);
+        }
+        return ret;
     }
     return smpi_coll_tuned_scatter_ompi_basic_linear (sbuf, scount, sdtype, 
                                                        rbuf, rcount, rdtype, 
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 d52ec60..da9263e 100644 (file)
@@ -632,13 +632,12 @@ static void action_allgatherv(const char *const *action) {
   /*
  The structure of the allgatherv action for the rank 0 (total 4 processes) 
  is the following:   
-0 allGatherV 275427 275427 275427 275427 204020 0 275427 550854 826281 
+0 allGatherV 275427 275427 275427 275427 204020
 
   where: 
   1) 275427 is the sendcount
   2) The next four elements declare the recvcounts array
-  3) The next four values declare the disps array
-  4) No more values mean that the datatype for sent and receive buffer
+  3) No more values mean that the datatype for sent and receive buffer
   is the default one, see decode_datatype().
 
    */
@@ -653,9 +652,9 @@ static void action_allgatherv(const char *const *action) {
   int recv_sum=0;  
   MPI_Datatype MPI_CURRENT_TYPE2;
 
-  if(action[3+2*comm_size]) {
-    MPI_CURRENT_TYPE = decode_datatype(action[3+2*comm_size]);
-    MPI_CURRENT_TYPE2 = decode_datatype(action[4+2*comm_size]);
+  if(action[3+comm_size]) {
+    MPI_CURRENT_TYPE = decode_datatype(action[3+comm_size]);
+    MPI_CURRENT_TYPE2 = decode_datatype(action[4+comm_size]);
   } else {
     MPI_CURRENT_TYPE = MPI_DEFAULT_TYPE;
     MPI_CURRENT_TYPE2 = MPI_DEFAULT_TYPE;    
@@ -665,7 +664,6 @@ static void action_allgatherv(const char *const *action) {
   for(i=0;i<comm_size;i++) {
     recvcounts[i] = atoi(action[i+3]);
     recv_sum=recv_sum+recvcounts[i];
-    disps[i] = atoi(action[i+3+comm_size]);
   }
   void *recvbuf = calloc(recv_sum, smpi_datatype_size(MPI_CURRENT_TYPE2));  
 
@@ -694,15 +692,13 @@ static void action_allToAllv(const char *const *action) {
   /*
  The structure of the allToAllV action for the rank 0 (total 4 processes) 
  is the following:   
-  0 allToAllV 100 1 7 10 12 5 10 20 45 100 1 70 10 5 1 5 77 90
+  0 allToAllV 100 1 7 10 12 100 1 70 10 5
 
   where: 
   1) 100 is the size of the send buffer *sizeof(int),
   2) 1 7 10 12 is the sendcounts array
-  3) 5 10 20 45 is the sdispls array
-  4) 100*sizeof(int) is the size of the receiver buffer
-  5)  1 70 10 5 is the recvcounts array
-  6) 1 5 77 90 is the rdispls array
+  3) 100*sizeof(int) is the size of the receiver buffer
+  4)  1 70 10 5 is the recvcounts array
 
    */
 
@@ -719,10 +715,10 @@ static void action_allToAllv(const char *const *action) {
   MPI_Datatype MPI_CURRENT_TYPE2;
 
   send_buf_size=parse_double(action[2]);
-  recv_buf_size=parse_double(action[3+2*comm_size]);
-  if(action[4+4*comm_size]) {
-    MPI_CURRENT_TYPE=decode_datatype(action[4+4*comm_size]);    
-    MPI_CURRENT_TYPE2=decode_datatype(action[5+4*comm_size]);    
+  recv_buf_size=parse_double(action[3+comm_size]);
+  if(action[4+2*comm_size]) {
+    MPI_CURRENT_TYPE=decode_datatype(action[4+2*comm_size]);
+    MPI_CURRENT_TYPE2=decode_datatype(action[5+2*comm_size]);
   }
   else {
       MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
@@ -734,9 +730,7 @@ static void action_allToAllv(const char *const *action) {
 
   for(i=0;i<comm_size;i++) {
     sendcounts[i] = atoi(action[i+3]);
-    senddisps[i] = atoi(action[i+3+comm_size]);
-    recvcounts[i] = atoi(action[i+4+2*comm_size]);
-    recvdisps[i] = atoi(action[i+4+3*comm_size]);
+    recvcounts[i] = atoi(action[i+4+comm_size]);
   }
 
 
@@ -747,7 +741,7 @@ static void action_allToAllv(const char *const *action) {
   for(i=0;i<comm_size;i++) count+=sendcounts[i];
   TRACE_smpi_collective_in(rank, -1, __FUNCTION__,count*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
-    mpi_coll_alltoallv_fun(sendbuf, sendcounts, senddisps,     MPI_CURRENT_TYPE,
+    mpi_coll_alltoallv_fun(sendbuf, sendcounts, senddisps, MPI_CURRENT_TYPE,
                                recvbuf, recvcounts, recvdisps, MPI_CURRENT_TYPE,
                                MPI_COMM_WORLD);
 #ifdef HAVE_TRACING
index b3aeec0..04d91ea 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_cas01_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_cas01_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 e00a721..21a9c63 100644 (file)
@@ -197,6 +197,22 @@ static xbt_dict_t storage_get_properties(const void *storage)
   return surf_resource_properties(surf_storage_resource_priv(storage));
 }
 
+static xbt_dict_t storage_get_content(void *storage)
+{
+  /* For the moment this action has no cost, but in the future we could take in account access latency of the disk */
+  /* surf_action_t action = storage_action_execute(storage,0, LS); */
+  xbt_dict_t content_dict = xbt_dict_new();
+
+  xbt_dict_cursor_t cursor = NULL;
+  char *file;
+  size_t size;
+
+  xbt_dict_foreach(((storage_t)storage)->content,cursor,file,size)
+    xbt_dict_set(content_dict,file,&size,NULL);
+
+  return content_dict;
+}
+
 static void* storage_create_resource(const char* id, const char* model,
     const char* type_id, const char* content_name, const char* content_type, xbt_dict_t properties){
   storage_t storage = NULL;
@@ -205,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;
@@ -503,8 +519,8 @@ static void surf_storage_model_init_internal(void)
   surf_storage_model->extension.storage.read = storage_action_read;
   surf_storage_model->extension.storage.write = storage_action_write;
   surf_storage_model->extension.storage.ls = storage_action_ls;
-
   surf_storage_model->extension.storage.get_properties = storage_get_properties;
+  surf_storage_model->extension.storage.get_content = storage_get_content;
 
   if (!storage_maxmin_system) {
     storage_maxmin_system = lmm_system_new(storage_selective_update);
index fbd51c2..8d001f7 100644 (file)
@@ -488,7 +488,7 @@ void surf_exit(void)
   xbt_free(surf_mins);
   surf_mins = NULL;
 #endif
-  if(host_that_restart)xbt_dynar_free(&host_that_restart);
+  xbt_dynar_free(&host_that_restart);
   xbt_dynar_free(&surf_path);
 
   xbt_lib_free(&host_lib);
index 683f037..ae8e115 100644 (file)
@@ -746,9 +746,6 @@ static void routing_parse_cabinet(sg_platf_cabinet_cbarg_t cabinet)
     s_sg_platf_host_cbarg_t host;
     memset(&host, 0, sizeof(host));
     host.initial_state = SURF_RESOURCE_ON;
-    xbt_dynar_t power_state_list = xbt_dynar_new(sizeof(double), NULL);
-    xbt_dynar_push(power_state_list,&cabinet->power);
-    host.power_peak = power_state_list;
     host.pstate = 0;
     host.power_scale = 1.0;
     host.core_amount = 1;
@@ -768,6 +765,9 @@ static void routing_parse_cabinet(sg_platf_cabinet_cbarg_t cabinet)
       link_id = bprintf("link_%s%d%s",cabinet->prefix,i,cabinet->suffix);
       host.id = host_id;
       link.id = link_id;
+      xbt_dynar_t power_state_list = xbt_dynar_new(sizeof(double), NULL);
+      xbt_dynar_push(power_state_list,&cabinet->power);
+      host.power_peak = power_state_list;
       sg_platf_new_host(&host);
       sg_platf_new_link(&link);
 
@@ -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..14bf9ff 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);
@@ -712,9 +706,8 @@ static int compare_heap_area_without_type(void *real_area1, void *real_area2, vo
       }else if((addr_pointed1 > s_heap) && ((char *)addr_pointed1 < (char *)s_heap + STD_HEAP_SIZE) 
                && (addr_pointed2 > s_heap) && ((char *)addr_pointed2 < (char *)s_heap + STD_HEAP_SIZE)){
         res_compare = compare_heap_area(addr_pointed1, addr_pointed2, previous, all_types, other_types, NULL, 0); 
-        if(res_compare != 0){
+        if(res_compare == 1)
           return res_compare;
-        }
         i = pointer_align + sizeof(void *);
         continue;
       }else{
@@ -821,7 +814,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 +833,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 +863,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,8 +876,8 @@ 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)
-          return res;        
+        if(res == 1)
+          return res;
       }
     }
     break;
@@ -913,6 +906,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 +938,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 > 0){
+          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 > 0){
+        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);
@@ -1077,7 +1070,7 @@ int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t
       }
       return 1;
     }
-    
+      
     if(!add_heap_area_pair(previous, block1, frag1, block2, frag2)){
       if(match_pairs){
         match_equals(previous);
@@ -1086,12 +1079,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 +1088,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 +1112,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 b11a855..e60540b 100644 (file)
@@ -91,7 +91,9 @@ static void xbt_preinit(void) {
   xbt_dict_preinit();
    
   srand(seed);
+#ifndef _WIN32
   srand48(seed);
+#endif
 
   atexit(xbt_postexit);
 }
index f0d4387..6f5f81e 100644 (file)
@@ -253,7 +253,7 @@ void xbt_os_cputimer_start(xbt_os_timer_t timer)
   clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &(timer->start));
 #elif defined(_XBT_WIN32)
   timer->elapse.tv_sec = 0;
-  timer->elapse.tv_nsec = 0;
+  timer->elapse.tv_usec = 0;
 #  if defined(WIN32_WCE) || (_WIN32_WINNT < 0x0400)
   THROW_UNIMPLEMENTED;
 #  else
@@ -281,7 +281,7 @@ void xbt_os_cputimer_resume(xbt_os_timer_t timer)
   clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &(timer->start));
 #elif defined(_XBT_WIN32)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
-  timer->elapse.tv_nsec += timer->stop.tv_nsec - timer->start.tv_nsec;
+  timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
 #  if defined(WIN32_WCE) || (_WIN32_WINNT < 0x0400)
   THROW_UNIMPLEMENTED;
 #  else
@@ -361,7 +361,7 @@ void xbt_os_threadtimer_resume(xbt_os_timer_t timer)
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->start));
 #elif defined(_XBT_WIN32)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
-  timer->elapse.tv_nsec += timer->stop.tv_nsec - timer->start.tv_nsec;
+  timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
 #  if defined(WIN32_WCE) || (_WIN32_WINNT < 0x0400)
   THROW_UNIMPLEMENTED;
 #  else
index 2d8c87f..692dc12 100644 (file)
@@ -69,6 +69,8 @@ int main(int argc, char *argv[])
   }
   free(sb);
   free(rb);
+  free(recv_counts);
+  free(recv_disps);
   MPI_Finalize();
   return (EXIT_SUCCESS);
 }
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 cba19bc..f8d9fb3 100644 (file)
@@ -28,7 +28,7 @@ int main( int argc, char **argv )
     for (i=0; i<size; i++) 
        sendbuf[i] = rank + i;
     recvcounts = (int *)malloc( size * sizeof(int) );
-        recvbuf = (int *)malloc( size * sizeof(int) );
+    recvbuf = (int *)malloc( size * sizeof(int) );
     for (i=0; i<size; i++) 
     recvcounts[i] = 1;
     MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
@@ -44,6 +44,10 @@ int main( int argc, char **argv )
     if (rank == 0 && toterr == 0) {
        printf( " No Errors\n" );
     }
+    free(sendbuf);
+    free(recvcounts);
+    free(recvbuf);
+    
     MPI_Finalize( );
 
     return toterr;
index e4a6303..50cec08 100644 (file)
@@ -87,6 +87,9 @@ static int small_test(int rank, int size)
   retval =
       MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount,
                   MPI_DOUBLE, root, MPI_COMM_WORLD);
+  if (root == rank) {
+    free(sndbuf);
+    }
   if (retval != MPI_SUCCESS) {
     fprintf(stderr, "(%s:%d) MPI_Scatter() returned retval=%d\n", __FILE__,
             __LINE__, retval);
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