Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into mc-process
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 10 Mar 2015 11:13:14 +0000 (12:13 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 10 Mar 2015 12:00:28 +0000 (13:00 +0100)
Conflicts:
examples/smpi/mc/non_deterministic.tesh
examples/smpi/mc/only_send_deterministic.tesh
src/include/mc/mc.h
src/mc/mc_base.c
src/mc/mc_comm_determinism.c
src/mc/mc_config.c
src/mc/mc_global.c
src/mc/mc_page_snapshot.cpp
src/mc/mc_request.c

70 files changed:
.gitignore
CMakeLists.txt
ChangeLog
buildtools/Cmake/AddTests.cmake
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/MaintainerMode.cmake
buildtools/Cmake/MakeExe.cmake
buildtools/Cmake/Scripts/java_bundle.sh
doc/simix.fig
examples/msg/actions/actions_split_p0.txt
examples/msg/energy/e2/e2.c
examples/msg/energy/e2/energy_consumption.tesh
examples/msg/energy/pstate/CMakeLists.txt [moved from examples/msg/energy/e1/CMakeLists.txt with 69% similarity]
examples/msg/energy/pstate/deployment_pstate.xml [moved from examples/msg/energy/e1/deployment_e1.xml with 100% similarity]
examples/msg/energy/pstate/pstate.c [moved from examples/msg/energy/e1/e1.c with 100% similarity]
examples/msg/energy/pstate/pstate.tesh [moved from examples/msg/energy/e1/pstate.tesh with 84% similarity]
examples/smpi/CMakeLists.txt
examples/smpi/mc/hostfile_non_termination [new file with mode: 0644]
examples/smpi/mc/hostfile_only_send_deterministic [moved from examples/smpi/mc/hostfile_non_deterministic with 100% similarity]
examples/smpi/mc/hostfile_send_deterministic [deleted file]
examples/smpi/mc/non_deterministic.c [deleted file]
examples/smpi/mc/non_termination1.c [new file with mode: 0644]
examples/smpi/mc/non_termination2.c [new file with mode: 0644]
examples/smpi/mc/non_termination3.c [new file with mode: 0644]
examples/smpi/mc/non_termination4.c [new file with mode: 0644]
examples/smpi/mc/only_send_deterministic.c [moved from examples/smpi/mc/send_deterministic.c with 100% similarity]
examples/smpi/mc/only_send_deterministic.tesh [new file with mode: 0644]
examples/smpi/mc/send_deterministic.tesh [deleted file]
src/include/mc/mc.h
src/include/smpi/smpi_interface.h
src/mc/mc_base.c
src/mc/mc_comm_determinism.c
src/mc/mc_comm_pattern.h
src/mc/mc_compare.cpp
src/mc/mc_config.c
src/mc/mc_global.c
src/mc/mc_page_snapshot.cpp
src/mc/mc_private.h
src/mc/mc_request.c
src/mc/mc_safety.c
src/mc/mc_snapshot.h
src/mc/mc_state.c
src/msg/msg_gos.c
src/msg/msg_host.c
src/simgrid/sg_config.c
src/simix/README_attempt_without_stack
src/smpi/smpi_coll.c
src/smpi/smpi_global.c
src/smpi/smpicc.in
src/smpi/smpicxx.in
src/smpi/smpif90.in
src/smpi/smpiff.in
src/smpi/smpirun.in
src/surf/maxmin.cpp
src/surf/plugins/energy.cpp
src/surf/surf_interface.cpp
teshsuite/smpi/allgather/allgather_coll.tesh
teshsuite/smpi/allgatherv/allgatherv_coll.tesh
teshsuite/smpi/allreduce/allreduce_coll.tesh
teshsuite/smpi/allreduce/allreduce_coll_large.tesh
teshsuite/smpi/alltoall/alltoall_coll.tesh
teshsuite/smpi/alltoallv/alltoallv_coll.tesh
teshsuite/smpi/barrier/barrier_coll.tesh
teshsuite/smpi/bcast/bcast_coll.tesh
teshsuite/smpi/gather/gather_coll.tesh
teshsuite/smpi/reduce/reduce_coll.tesh
teshsuite/smpi/reduce/reduce_scatter_coll.tesh
teshsuite/smpi/scatter/scatter_coll.tesh
teshsuite/smpi/shared/shared.c

index 2770b2c..973db9c 100644 (file)
@@ -138,7 +138,7 @@ examples/msg/cloud/multicore
 examples/msg/cloud/scale
 examples/msg/cloud/simple_vm
 examples/msg/cloud/two_tasks_vm
-examples/msg/energy/e1/e1
+examples/msg/energy/pstate/pstate
 examples/msg/energy/e2/e2
 examples/msg/energy/e3/e3
 examples/msg/pastry/pastry
index 80bc299..3e01411 100644 (file)
@@ -66,7 +66,7 @@ set(SIMGRID_VERSION_MINOR "12")
 set(SIMGRID_VERSION_PATCH "0")
 set(SIMGRID_VERSION_EXTRA "-devel") # Extra words to add to version string (e.g. -rc1)
 
-set(SIMGRID_VERSION_DATE  "2014") # Year for copyright information
+set(SIMGRID_VERSION_DATE  "2015") # Year for copyright information
 
 if(${SIMGRID_VERSION_PATCH} EQUAL "0")
   set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}")
index e4d2474..5cdf3a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,7 @@ SimGrid (3.12) NOT RELEASED; urgency=low
    - Constant times can be injected inside MPI_Wtime and MPI_Test through options smpi/wtime and smpi/test
    - InfiniBand network model added : Based on the works of Jerome Vienne (http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf )
    - When smpi/display_timing is set, also display global simulation time and application times
+   - Have smpirun, smpicc and friends display the simgrid git hash version on --git-version
  * Collective communications
    - SMP-aware algorithms are now dynamically handled. An internal communicator is created for each node, and an external one to handle communications between "leaders" of each node
    - MVAPICH2 (1.9) collective algorithms selector : normal and SMP algorithms are handled, and selection logic is based on the one used on TACC's Stampede cluster (https://www.tacc.utexas.edu/stampede/).
index e7c1838..103b33e 100644 (file)
@@ -231,7 +231,7 @@ IF(NOT enable_memcheck)
   ADD_TESH_FACTORIES(msg-cloud-master-worker-vm      "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/master_worker_vm.tesh)
   ADD_TESH_FACTORIES(msg-cloud-two-tasks-vm      "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/two_tasks_vm.tesh)
   ADD_TESH_FACTORIES(msg-cloud-simple-vm         "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/cloud/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/ --cd ${CMAKE_BINARY_DIR}/examples/msg/cloud/ ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/simple_vm.tesh)
-  ADD_TESH_FACTORIES(msg-energy-pstates          "thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1/pstate.tesh)
+  ADD_TESH_FACTORIES(msg-energy-pstates          "thread" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/pstate/pstate.tesh)
   ADD_TESH_FACTORIES(msg-energy-consumption      "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2/energy_consumption.tesh)
   ADD_TESH_FACTORIES(msg-energy-concurrent-tasks "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3/concurrent_tasks.tesh)
   ADD_TESH_FACTORIES(msg-token-ring              "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
@@ -487,8 +487,7 @@ IF(NOT enable_memcheck)
       ADD_TESH(smpi-replay                       --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh)
     ENDIF()
     IF(HAVE_MC)
-      ADD_TESH(smpi-mc-non-determinism                  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/non_deterministic.tesh)
-      ADD_TESH(smpi-mc-send-determinism                  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/send_deterministic.tesh)
+      ADD_TESH(smpi-mc-only-send-determinism                  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/only_send_deterministic.tesh)
     ENDIF()
     # END TESH TESTS
   ENDIF()
index b1ba41f..a8410ad 100644 (file)
@@ -550,6 +550,14 @@ if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/)
     string(REPLACE "\n" "" GIT_DATE "${GIT_DATE}")
     message(STATUS "Git date: ${GIT_DATE}")
     string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}")
+    
+    execute_process(COMMAND git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --pretty=format:%H -1
+                    WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.git/
+                   OUTPUT_VARIABLE SIMGRID_GITHASH
+                   RESULT_VARIABLE ret
+                   )
+    string(REPLACE "\n" "" SIMGRID_GITHASH "${SIMGRID_GITHASH}")
+                   
   endif()
 elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion)
   FILE(STRINGS ${CMAKE_HOME_DIRECTORY}/.gitversion GIT_VERSION)
index bf6b18c..6a07df0 100644 (file)
@@ -129,8 +129,7 @@ set(EXTRA_DIST
   tools/tesh/run_context.h
   tools/tesh/tesh.h
   tools/tesh/generate_tesh
-  examples/smpi/mc/non_deterministic.tesh
-  examples/smpi/mc/send_deterministic.tesh
+  examples/smpi/mc/only_send_deterministic.tesh
   )
 
 set(SMPI_SRC
@@ -1017,7 +1016,7 @@ set(EXAMPLES_CMAKEFILES_TXT
   examples/msg/chainsend/CMakeLists.txt
   examples/msg/chord/CMakeLists.txt
   examples/msg/cloud/CMakeLists.txt
-  examples/msg/energy/e1/CMakeLists.txt
+  examples/msg/energy/pstate/CMakeLists.txt
   examples/msg/energy/e2/CMakeLists.txt
   examples/msg/energy/e3/CMakeLists.txt
   examples/msg/exception/CMakeLists.txt
index fba030f..8fed0cc 100644 (file)
@@ -77,6 +77,7 @@ if(enable_maintainer_mode AND NOT WIN32)
       )
   endif()
 
+  message(STATUS "Found flex: ${FLEX_EXE}")
   IF(FLEX_EXE)
     set(HAVE_FLEX 1)
     exec_program("${FLEX_EXE} --version" OUTPUT_VARIABLE FLEX_VERSION)
@@ -87,6 +88,7 @@ if(enable_maintainer_mode AND NOT WIN32)
     string(REGEX MATCH "[0-9]+$" FLEX_PATCH_VERSION "${FLEX_VERSION}")
   ENDIF()
 
+  message(STATUS "Found flexml: ${FLEXML_EXE}")
   IF(FLEXML_EXE)
     set(HAVE_FLEXML 1)
     exec_program("${FLEXML_EXE} --version" OUTPUT_VARIABLE FLEXML_VERSION)
@@ -101,8 +103,6 @@ if(enable_maintainer_mode AND NOT WIN32)
     string(REGEX MATCH "[0-9]+$" FLEXML_PATCH_VERSION "${FLEXML_VERSION}")
   ENDIF()
 
-  message(STATUS "Found flex: ${FLEX_EXE}")
-  message(STATUS "Found flexml: ${FLEXML_EXE}")
   message(STATUS "Found sed: ${SED_EXE}")
 
   if(HAVE_FLEXML AND HAVE_FLEX AND SED_EXE)
index 5cd1d98..926e241 100644 (file)
@@ -33,7 +33,7 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/chord)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/cloud)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/energy/pstate)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/exception)
index 136d568..38f663f 100755 (executable)
@@ -9,8 +9,8 @@ Usage: $0 simgrid.jar java_command strip_command [-so file.so...] [-txt file.txt
     simgrid.jar    SimGrid jar file
     java_command   path to the Java runtime
     strip_command  path to the command used to strip libraries
-    file.so        library file to stript and bundle into the archive
-    file.txt       other file  to bundle into the archive
+    file.so        library file to strip and bundle into the archive
+    file.txt       other file to bundle into the archive
 EOF
     exit 1
 fi
index c4df1aa..90b8e3f 100644 (file)
@@ -108,7 +108,7 @@ Single
         3375 2700 3375 3375 5130 3375 5130 2835 4949 2700 3375 2700
 2 3 0 1 0 31 101 0 17 0.000 0 0 7 0 0 4
         4950 2700 4950 2835 5130 2835 4950 2700
-4 0 0 100 0 16 10 0.0000 4 150 945 3404 2890 smx_action_t\001
+4 0 0 100 0 16 10 0.0000 4 150 945 3404 2890 smx_synchro_t\001
 4 0 0 100 0 16 10 0.0000 4 120 360 3420 3105 Dsc1\001
 4 0 0 100 0 16 10 0.0000 4 120 360 3420 3285 Dsc2\001
 -6
index 35ab7a0..b873353 100644 (file)
@@ -1,4 +1,4 @@
-# sample action file (with only the actions for p1,
+# sample action file (with only the actions for p0,
 #                     to be launched by deployment file)
 p0 init
 p0 recv p1
index 2d46b2b..dbfe96f 100644 (file)
@@ -75,7 +75,7 @@ int dvfs(int argc, char *argv[])
                  MSG_host_get_current_power_peak(host), MSG_host_get_consumed_energy(host));
 
   // =========== Turn the other host off ==========
-  XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 disipated %.0f J so far.",
+  XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated %.0f J so far.",
                  MSG_host_get_consumed_energy(MSG_get_host_by_name("MyHost2")) );
   MSG_host_off(MSG_get_host_by_name("MyHost2"));
   start = MSG_get_clock();
index 574fde4..8f1e1ce 100644 (file)
@@ -15,7 +15,7 @@ $ $SG_TEST_EXENV energy/e2/e2$EXEEXT ${srcdir:=.}/../platforms/energy_platform.x
 > [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1900 J
 > [ 16.000000] (1:dvfs_test@MyHost1) Sleep for 4 seconds
 > [ 20.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 4.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=2260 J
-> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 disipated 2000 J so far.
+> [ 20.000000] (1:dvfs_test@MyHost1) Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated 2000 J so far.
 > [ 30.000000] (0:@) Total simulation time: 30.00
 > [ 30.000000] (0:@) Total energy of host MyHost1: 3160.000000 Joules
 > [ 30.000000] (0:@) Total energy of host MyHost2: 2100.000000 Joules
similarity index 69%
rename from examples/msg/energy/e1/CMakeLists.txt
rename to examples/msg/energy/pstate/CMakeLists.txt
index ef32177..c5f1695 100644 (file)
@@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 2.6)
 
 set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
 
-add_executable(e1 e1.c)
+add_executable(pstate pstate.c)
 
 ### Add definitions for compile
-target_link_libraries(e1 simgrid )
+target_link_libraries(pstate simgrid )
 
 set(tesh_files
   ${tesh_files}
@@ -15,13 +15,13 @@ set(tesh_files
 
 set(xml_files
   ${xml_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/deployment_e1.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/deployment_pstate.xml
   PARENT_SCOPE
   )
 
 set(examples_src
   ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/e1.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/pstate.c
   PARENT_SCOPE
   )
 
similarity index 84%
rename from examples/msg/energy/e1/pstate.tesh
rename to examples/msg/energy/pstate/pstate.tesh
index 51c5fcf..e742ba1 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the DVFS-related functions
 
 ! output sort
-$ $SG_TEST_EXENV energy/e1/e1$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml ${srcdir:=.}/energy/e1/deployment_e1.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV energy/pstate/pstate$EXEEXT ${srcdir:=.}/../platforms/energy_platform.xml ${srcdir:=.}/energy/pstate/deployment_pstate.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:dvfs_test@MyHost1) Number of Processor states=3
 > [  0.000000] (2:dvfs_test@MyHost2) Number of Processor states=1
 > [  0.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000
index 8effff1..2119015 100644 (file)
@@ -29,23 +29,32 @@ if(enable_smpi)
     add_executable(smpi_bugged1 mc/bugged1.c)
     add_executable(smpi_bugged2 mc/bugged2.c)
     add_executable(smpi_bugged1_liveness mc/bugged1_liveness.c)
-    add_executable(smpi_send_deterministic mc/send_deterministic.c)
-    add_executable(smpi_non_deterministic mc/non_deterministic.c)
+    add_executable(smpi_only_send_deterministic mc/only_send_deterministic.c)
     add_executable(smpi_mutual_exclusion mc/mutual_exclusion.c)
+    add_executable(smpi_non_termination1 mc/non_termination1.c)
+    add_executable(smpi_non_termination2 mc/non_termination2.c)
+    add_executable(smpi_non_termination3 mc/non_termination3.c)
+    add_executable(smpi_non_termination4 mc/non_termination4.c)
 
     target_link_libraries(smpi_bugged1 simgrid)
     target_link_libraries(smpi_bugged2 simgrid)
     target_link_libraries(smpi_bugged1_liveness simgrid)
-    target_link_libraries(smpi_send_deterministic simgrid)
-    target_link_libraries(smpi_non_deterministic simgrid)
+    target_link_libraries(smpi_only_send_deterministic simgrid)
     target_link_libraries(smpi_mutual_exclusion simgrid)
+    target_link_libraries(smpi_non_termination1 simgrid)
+    target_link_libraries(smpi_non_termination2 simgrid)
+    target_link_libraries(smpi_non_termination3 simgrid)
+    target_link_libraries(smpi_non_termination4 simgrid)
     
     set_target_properties(smpi_bugged1 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
     set_target_properties(smpi_bugged2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
     set_target_properties(smpi_bugged1_liveness PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
-    set_target_properties(smpi_send_deterministic PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
-    set_target_properties(smpi_non_deterministic PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
+    set_target_properties(smpi_only_send_deterministic PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
     set_target_properties(smpi_mutual_exclusion PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
+    set_target_properties(smpi_non_termination1 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
+    set_target_properties(smpi_non_termination2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
+    set_target_properties(smpi_non_termination3 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
+    set_target_properties(smpi_non_termination4 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "./mc")
     
   endif()
   
@@ -71,9 +80,12 @@ set(examples_src
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/bugged2.c
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/bugged1.c
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/bugged1_liveness.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mc/send_deterministic.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mc/non_deterministic.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/only_send_deterministic.c
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/mutual_exclusion.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/non_termination1.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/non_termination2.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/non_termination3.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/non_termination4.c
   PARENT_SCOPE
   )
 set(bin_files
@@ -83,9 +95,9 @@ set(bin_files
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged1_liveness
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged1
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged2
-  ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_send_deterministic
-  ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_non_deterministic
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_only_send_deterministic
   ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_mutual_exclusion
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_non_termination
   PARENT_SCOPE
   )
 set(txt_files
diff --git a/examples/smpi/mc/hostfile_non_termination b/examples/smpi/mc/hostfile_non_termination
new file mode 100644 (file)
index 0000000..ae28a97
--- /dev/null
@@ -0,0 +1,2 @@
+node-1.acme.org
+node-2.acme.org
\ No newline at end of file
diff --git a/examples/smpi/mc/hostfile_send_deterministic b/examples/smpi/mc/hostfile_send_deterministic
deleted file mode 100644 (file)
index 4ae7dab..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-node-1.acme.org
-node-2.acme.org
-node-3.acme.org
diff --git a/examples/smpi/mc/non_deterministic.c b/examples/smpi/mc/non_deterministic.c
deleted file mode 100644 (file)
index 9df64c0..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ../../../smpi_script/bin/smpirun -hostfile hostfile_send_deterministic -platform ../../platforms/cluster.xml -np 3 --cfg=model-check:1 --cfg=smpi/send_is_detached_thres:0 gdb\ --args\ ./send_deterministic */
-
-/* Copyright (c) 2009-2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <stdio.h>
-#include <mpi.h>
-#include <simgrid/modelchecker.h>
-
-
-int main(int argc, char **argv)
-{
-  int recv_buff, err, size, rank, i;
-  MPI_Status status;
-
-  /* Initialize MPI */
-  err = MPI_Init(&argc, &argv);
-  if (err != MPI_SUCCESS) {
-    printf("MPI initialization failed!\n");
-    exit(1);
-  }
-
-  MPI_Comm_size(MPI_COMM_WORLD, &size);   /* Get nr of tasks */
-  MPI_Comm_rank(MPI_COMM_WORLD, &rank);   /* Get id of this process */
-  if (size < 2) {
-    printf("run this program with at least 2 processes \n");
-    MPI_Finalize();
-    exit(0);
-  }
-
-  if (rank == 0) {
-    //printf("MPI_ISend / MPI_IRecv Test \n");
-
-    for(i=0; i < size - 1; i++){
-      MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
-      //printf("Message received from %d\n", recv_buff);
-      MPI_Send(&recv_buff, 1, MPI_INT, status.MPI_SOURCE, 42, MPI_COMM_WORLD);
-      // printf("Sent %d to rank %d\n", status.MPI_SOURCE);
-    }
-
-  }else{
-    MPI_Send(&rank, 1, MPI_INT, 0, 42, MPI_COMM_WORLD);
-    //printf("Sent %d to rank 0\n", rank);
-    MPI_Recv(&recv_buff, 1, MPI_INT, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
-    //printf("Message received from %d\n", recv_buff);
-  }
-
-  MPI_Finalize();
-
-  return 0;
-}
diff --git a/examples/smpi/mc/non_termination1.c b/examples/smpi/mc/non_termination1.c
new file mode 100644 (file)
index 0000000..1d9c497
--- /dev/null
@@ -0,0 +1,37 @@
+#include <stdio.h>
+#include <mpi.h>
+#include <simgrid/modelchecker.h>
+
+int x = 5;
+int y = 8;
+
+int main(int argc, char **argv) {
+
+  int recv_buff, size, rank;
+  MPI_Status status;
+  
+  MPI_Init(&argc, &argv);
+
+  MPI_Comm_size(MPI_COMM_WORLD, &size);   /* Get nr of tasks */
+  MPI_Comm_rank(MPI_COMM_WORLD, &rank);   /* Get id of this process */
+
+  MC_ignore(&(status.count), sizeof(status.count));
+
+  if (rank == 0) {
+    while (1) {
+      MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+    }
+  } else {
+    while (1) {
+      int old_x = x;
+      x = -y;
+      y = old_x;
+      printf("x = %d, y = %d\n", x, y);
+      MPI_Send(&rank, 1, MPI_INT, 0, 42, MPI_COMM_WORLD);
+    }
+  }
+
+  MPI_Finalize();
+
+  return 0;
+}
diff --git a/examples/smpi/mc/non_termination2.c b/examples/smpi/mc/non_termination2.c
new file mode 100644 (file)
index 0000000..a23435e
--- /dev/null
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include <mpi.h>
+#include <simgrid/modelchecker.h>
+
+int x;
+
+int main(int argc, char **argv) {
+
+  int recv_buff, size, rank;
+  MPI_Status status;
+  
+  MPI_Init(&argc, &argv);
+
+  MPI_Comm_size(MPI_COMM_WORLD, &size);   /* Get nr of tasks */
+  MPI_Comm_rank(MPI_COMM_WORLD, &rank);   /* Get id of this process */
+
+  MC_ignore(&(status.count), sizeof(status.count));
+
+  if (rank == 0) {
+    while (1) {
+      MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+    }
+  } else {
+    while (1) {
+      x = 2;
+      MPI_Send(&rank, 1, MPI_INT, 0, 42, MPI_COMM_WORLD);
+    }
+  }
+
+  MPI_Finalize();
+
+  return 0;
+}
diff --git a/examples/smpi/mc/non_termination3.c b/examples/smpi/mc/non_termination3.c
new file mode 100644 (file)
index 0000000..aecd34d
--- /dev/null
@@ -0,0 +1,38 @@
+#include <stdio.h>
+#include <mpi.h>
+#include <simgrid/modelchecker.h>
+
+int x = 0;
+int y = 0;
+
+int main(int argc, char **argv) {
+
+  int recv_x, recv_y, size, rank;
+  MPI_Status status;
+  
+  MPI_Init(&argc, &argv);
+
+  MPI_Comm_size(MPI_COMM_WORLD, &size);   /* Get nr of tasks */
+  MPI_Comm_rank(MPI_COMM_WORLD, &rank);   /* Get id of this process */
+
+  MC_ignore(&(status.count), sizeof(status.count));
+
+  if (rank == 0) {
+    while (x<5) {
+      MPI_Recv(&recv_x, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+      MPI_Recv(&recv_y, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+    }
+  } else {
+    while (x<5) {
+      int old_x = x;
+      x = old_x - y;
+      MPI_Send(&x, 1, MPI_INT, 0, 42, MPI_COMM_WORLD);
+      y = old_x + y;
+      MPI_Send(&y, 1, MPI_INT, 0, 42, MPI_COMM_WORLD);
+    }
+  }
+
+  MPI_Finalize();
+
+  return 0;
+}
diff --git a/examples/smpi/mc/non_termination4.c b/examples/smpi/mc/non_termination4.c
new file mode 100644 (file)
index 0000000..c992b24
--- /dev/null
@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <mpi.h>
+#include <simgrid/modelchecker.h>
+
+int x = 20;
+
+int main(int argc, char **argv) {
+  
+       int recv_x = 1, size, rank;
+  MPI_Status status;
+
+  MPI_Init(&argc, &argv);
+  
+  MPI_Comm_size(MPI_COMM_WORLD, &size);   /* Get nr of tasks */
+  MPI_Comm_rank(MPI_COMM_WORLD, &rank);   /* Get id of this process */
+  
+  MC_ignore(&(status.count), sizeof(status.count));
+
+  if(rank==0){
+    while (recv_x>=0) {
+      MPI_Recv(&recv_x, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+    }
+  }else{
+    
+    while (x >= 0) {
+      if (MC_random(0,1) == 0) {
+        x -= 1;
+      } else {
+        x += 1;
+      }
+      printf("x=%d\n", x);
+      MPI_Send(&x, 1, MPI_INT, 0, 42, MPI_COMM_WORLD);
+    }
+  }
+
+  MPI_Finalize();
+  
+       return 0;
+}
diff --git a/examples/smpi/mc/only_send_deterministic.tesh b/examples/smpi/mc/only_send_deterministic.tesh
new file mode 100644 (file)
index 0000000..a9c854e
--- /dev/null
@@ -0,0 +1,15 @@
+#! ./tesh
+
+! timeout 60
+$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check:1 --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thres:0 --cfg=smpi/running_power:1e9 ./smpi_only_send_deterministic
+> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [0.000000] [mc_global/INFO] Check communication determinism
+> [0.000000] [mc_global/INFO] ******************************************************
+> [0.000000] [mc_global/INFO] **** Only-send-deterministic communication pattern ****
+> [0.000000] [mc_global/INFO] ******************************************************
+> [0.000000] [mc_global/INFO] The recv communications pattern of the process 0 is different! Different source for communication #2
+> [0.000000] [mc_global/INFO] Expanded states = 1025
+> [0.000000] [mc_global/INFO] Visited states = 3640
+> [0.000000] [mc_global/INFO] Executed transitions = 3360
+> [0.000000] [mc_global/INFO] Send-deterministic : Yes
+> [0.000000] [mc_global/INFO] Recv-deterministic : No
diff --git a/examples/smpi/mc/send_deterministic.tesh b/examples/smpi/mc/send_deterministic.tesh
deleted file mode 100644 (file)
index 39dccba..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#! ./tesh
-
-! timeout 60
-$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" -hostfile ${srcdir:=.}/hostfile_send_deterministic  -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check:1 --cfg=model-check/send_determinism:1 --cfg=smpi/send_is_detached_thres:0 --cfg=smpi/running_power:1e9 ./smpi_send_deterministic
-> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [0.000000] [mc_global/INFO] Check communication determinism
-> [0.000000] [mc_global/INFO] Expanded states = 520
-> [0.000000] [mc_global/INFO] Visited states = 1476
-> [0.000000] [mc_global/INFO] Executed transitions = 1312
-> [0.000000] [mc_global/INFO] Send-deterministic : Yes
index 23b1781..23be47f 100644 (file)
@@ -52,6 +52,7 @@ extern int _sg_mc_send_determinism;
 extern int _sg_mc_safety;
 extern int _sg_mc_liveness;
 extern int _sg_mc_snapshot_fds;
+extern int _sg_mc_termination;
 
 extern xbt_dynar_t mc_heap_comparison_ignore;
 extern xbt_dynar_t stacks_areas;
@@ -70,6 +71,7 @@ void _mc_cfg_cb_visited(const char *name, int pos);
 void _mc_cfg_cb_dot_output(const char *name, int pos);
 void _mc_cfg_cb_comms_determinism(const char *name, int pos);
 void _mc_cfg_cb_send_determinism(const char *name, int pos);
+void _mc_cfg_cb_termination(const char *name, int pos);
 
 XBT_PUBLIC(void) MC_do_the_modelcheck_for_real(void);
 XBT_PUBLIC(void) MC_init(void);
index 41f9d40..40712bc 100644 (file)
@@ -116,7 +116,7 @@ XBT_PUBLIC_DATA(int (*mpi_coll_barrier_fun)
 XBT_PUBLIC(void) coll_help(const char *category,
                            s_mpi_coll_description_t * table);
 XBT_PUBLIC(int) find_coll_description(s_mpi_coll_description_t * table,
-                                      char *name);
+                                      char *name, const char *desc);
 
 
 extern double smpi_wtime_sleep;
index 20d8f43..63d7a58 100644 (file)
@@ -41,6 +41,7 @@ int MC_request_is_enabled(smx_simcall_t req)
 #ifdef HAVE_MC
   s_smx_synchro_t temp_synchro;
 #endif
+  smx_mutex_t mutex = NULL;
 
   switch (req->call) {
   case SIMCALL_NONE:
@@ -92,6 +93,13 @@ int MC_request_is_enabled(smx_simcall_t req)
     }
     return FALSE;
 
+  case SIMCALL_MUTEX_LOCK:
+    mutex = simcall_mutex_lock__get__mutex(req);
+    if(mutex->owner == NULL)
+      return TRUE;
+    else
+      return (mutex->owner->pid == req->issuer->pid);
+
   default:
     /* The rest of the requests are always enabled */
     return TRUE;
@@ -107,6 +115,7 @@ int MC_request_is_visible(smx_simcall_t req)
       || req->call == SIMCALL_COMM_TEST
       || req->call == SIMCALL_COMM_TESTANY
       || req->call == SIMCALL_MC_RANDOM
+      || req->call == SIMCALL_MUTEX_LOCK
 #ifdef HAVE_MC
       || req->call == SIMCALL_MC_SNAPSHOT
       || req->call == SIMCALL_MC_COMPARE_SNAPSHOTS
index 4043b1f..635bc9d 100644 (file)
@@ -46,124 +46,58 @@ static e_mc_comm_pattern_difference_t compare_comm_pattern(mc_comm_pattern_t com
     return SRC_PROC_DIFF;
   if (comm1->dst_proc != comm2->dst_proc)
     return DST_PROC_DIFF;
+  if (comm1->tag != comm2->tag)
+    return TAG_DIFF;
   if (comm1->data_size != comm2->data_size)
     return DATA_SIZE_DIFF;
   if(comm1->data == NULL && comm2->data == NULL)
     return 0;
-  /*if(comm1->data != NULL && comm2->data !=NULL) {
+  if(comm1->data != NULL && comm2->data !=NULL) {
     if (!memcmp(comm1->data, comm2->data, comm1->data_size))
       return 0;
     return DATA_DIFF;
   }else{
     return DATA_DIFF;
-  }*/
+  }
   return 0;
 }
 
-static void print_determinism_result(e_mc_comm_pattern_difference_t diff, int process, mc_comm_pattern_t comm, unsigned int cursor) {
-  if (_sg_mc_comms_determinism && !initial_global_state->comm_deterministic) {
-    XBT_INFO("****************************************************");
-    XBT_INFO("***** Non-deterministic communications pattern *****");
-    XBT_INFO("****************************************************");
-    XBT_INFO("The communications pattern of the process %d is different!",  process);
-    switch(diff) {
-    case TYPE_DIFF:
-      XBT_INFO("Different communication type for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case RDV_DIFF:
-      XBT_INFO("Different communication rdv for communication %s at index %d",  comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case SRC_PROC_DIFF:
-        XBT_INFO("Different communication source process for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case DST_PROC_DIFF:
-        XBT_INFO("Different communication destination process for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case DATA_SIZE_DIFF:
-      XBT_INFO("Different communication data size for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case DATA_DIFF:
-      XBT_INFO("Different communication data for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    default:
-      break;
-    }
-    MC_print_statistics(mc_stats);
-    xbt_abort();
-  } else if (_sg_mc_send_determinism && !initial_global_state->send_deterministic) {
-    XBT_INFO("*********************************************************");
-    XBT_INFO("***** Non-send-deterministic communications pattern *****");
-    XBT_INFO("*********************************************************");
-    XBT_INFO("The communications pattern of the process %d is different!",  process);
-    switch(diff) {
-    case TYPE_DIFF:
-      XBT_INFO("Different communication type for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case RDV_DIFF:
-      XBT_INFO("Different communication rdv for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case SRC_PROC_DIFF:
-        XBT_INFO("Different communication source process for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case DST_PROC_DIFF:
-        XBT_INFO("Different communication destination process for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case DATA_SIZE_DIFF:
-      XBT_INFO("Different communication data size for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    case DATA_DIFF:
-      XBT_INFO("Different communication data for communication %s at index %d", comm->type == SIMIX_COMM_SEND ? "Send" : "Recv", cursor);
-      break;
-    default:
-      break;
-    }
-    MC_print_statistics(mc_stats);
-    xbt_abort();
+static char* print_determinism_result(e_mc_comm_pattern_difference_t diff, int process, mc_comm_pattern_t comm, unsigned int cursor) {
+  char *type, *res;
+
+  if(comm->type == SIMIX_COMM_SEND)
+    type = bprintf("The send communications pattern of the process %d is different!", process - 1);
+  else
+    type = bprintf("The recv communications pattern of the process %d is different!", process - 1);
+
+  switch(diff) {
+  case TYPE_DIFF:
+    res = bprintf("%s Different type for communication #%d", type, cursor);
+    break;
+  case RDV_DIFF:
+    res = bprintf("%s Different rdv for communication #%d", type, cursor);
+    break;
+  case TAG_DIFF:
+    res = bprintf("%s Different tag for communication #%d", type, cursor);
+    break;
+  case SRC_PROC_DIFF:
+      res = bprintf("%s Different source for communication #%d", type, cursor);
+    break;
+  case DST_PROC_DIFF:
+      res = bprintf("%s Different destination for communication #%d", type, cursor);
+    break;
+  case DATA_SIZE_DIFF:
+    res = bprintf("%s\n Different data size for communication #%d", type, cursor);
+    break;
+  case DATA_DIFF:
+    res = bprintf("%s\n Different data for communication #%d", type, cursor);
+    break;
+  default:
+    res = NULL;
+    break;
   }
-}
 
-static void print_communications_pattern()
-{
-  unsigned int cursor = 0, cursor2 = 0;
-  mc_comm_pattern_t current_comm;
-  mc_list_comm_pattern_t current_list;
-  unsigned int current_process = 1;
-  while (current_process < simix_process_maxpid) {
-    current_list = (mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, current_process, mc_list_comm_pattern_t);
-    XBT_INFO("Communications from the process %u:", current_process);
-    while(cursor2 < current_list->index_comm){
-      current_comm = (mc_comm_pattern_t)xbt_dynar_get_as(current_list->list, cursor2, mc_comm_pattern_t);
-      if (current_comm->type == SIMIX_COMM_SEND) {
-        XBT_INFO("(%u) [(%lu) %s -> (%lu) %s] %s ", cursor,current_comm->src_proc,
-                 current_comm->src_host, current_comm->dst_proc,
-                 current_comm->dst_host, "iSend");
-      } else {
-        XBT_INFO("(%u) [(%lu) %s <- (%lu) %s] %s ", cursor, current_comm->dst_proc,
-                 current_comm->dst_host, current_comm->src_proc,
-                 current_comm->src_host, "iRecv");
-      }
-      cursor2++;
-    }
-    current_process++;
-    cursor = 0;
-    cursor2 = 0;
-  }
-}
-
-static void print_incomplete_communications_pattern(){
-  unsigned int cursor = 0;
-  unsigned int current_process = 1;
-  xbt_dynar_t current_pattern;
-  mc_comm_pattern_t comm;
-  while (current_process < simix_process_maxpid) {
-    current_pattern = (xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, current_process, xbt_dynar_t);
-    XBT_INFO("Incomplete communications from the process %u:", current_process);
-    xbt_dynar_foreach(current_pattern, cursor, comm) {
-      XBT_DEBUG("(%u) Communication %p", cursor, comm);
-    }
-    current_process++;
-    cursor = 0;
-  }
+  return res;
 }
 
 // FIXME, remote comm
@@ -195,18 +129,46 @@ static void deterministic_comm_pattern(int process, mc_comm_pattern_t comm, int
   mc_list_comm_pattern_t list_comm_pattern = (mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, process, mc_list_comm_pattern_t);
 
   if(!backtracking){
-    mc_comm_pattern_t initial_comm = xbt_dynar_get_as(list_comm_pattern->list, comm->index, mc_comm_pattern_t);
+    mc_comm_pattern_t initial_comm = xbt_dynar_get_as(list_comm_pattern->list, list_comm_pattern->index_comm, mc_comm_pattern_t);
     e_mc_comm_pattern_difference_t diff;
     
     if((diff = compare_comm_pattern(initial_comm, comm)) != NONE_DIFF){
-      if (comm->type == SIMIX_COMM_SEND)
+      if (comm->type == SIMIX_COMM_SEND){
         initial_global_state->send_deterministic = 0;
-      initial_global_state->comm_deterministic = 0;
-      print_determinism_result(diff, process, comm, list_comm_pattern->index_comm + 1);
+        if(initial_global_state->send_diff != NULL)
+          xbt_free(initial_global_state->send_diff);
+        initial_global_state->send_diff = print_determinism_result(diff, process, comm, list_comm_pattern->index_comm + 1);
+      }else{
+        initial_global_state->recv_deterministic = 0;
+        if(initial_global_state->recv_diff != NULL)
+          xbt_free(initial_global_state->recv_diff);
+        initial_global_state->recv_diff = print_determinism_result(diff, process, comm, list_comm_pattern->index_comm + 1);
+      }
+      if(_sg_mc_send_determinism && !initial_global_state->send_deterministic){
+        XBT_INFO("*********************************************************");
+        XBT_INFO("***** Non-send-deterministic communications pattern *****");
+        XBT_INFO("*********************************************************");
+        XBT_INFO("%s", initial_global_state->send_diff);
+        xbt_free(initial_global_state->send_diff);
+        initial_global_state->send_diff = NULL;
+        MC_print_statistics(mc_stats);
+        xbt_abort(); 
+      }else if(_sg_mc_comms_determinism && (!initial_global_state->send_deterministic && !initial_global_state->recv_deterministic)) {
+        XBT_INFO("****************************************************");
+        XBT_INFO("***** Non-deterministic communications pattern *****");
+        XBT_INFO("****************************************************");
+        XBT_INFO("%s", initial_global_state->send_diff);
+        XBT_INFO("%s", initial_global_state->recv_diff);
+        xbt_free(initial_global_state->send_diff);
+        initial_global_state->send_diff = NULL;
+        xbt_free(initial_global_state->recv_diff);
+        initial_global_state->recv_diff = NULL;
+        MC_print_statistics(mc_stats);
+        xbt_abort();
+      } 
     }
   }
     
-  list_comm_pattern->index_comm++;
   comm_pattern_free(comm);
 
 }
@@ -221,7 +183,7 @@ void list_comm_pattern_free_voidp(void *p) {
   list_comm_pattern_free((mc_list_comm_pattern_t) * (void **) p);
 }
 
-void get_comm_pattern(const xbt_dynar_t list, const smx_simcall_t request, const e_mc_call_type_t call_type)
+void get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking)
 {
   mc_process_t process = &mc_model_checker->process;
   mc_comm_pattern_t pattern = NULL;
@@ -247,6 +209,7 @@ void get_comm_pattern(const xbt_dynar_t list, const smx_simcall_t request, const
     pattern->rdv = (pattern->comm->comm.rdv != NULL) ? strdup(pattern->comm->comm.rdv->name) : strdup(pattern->comm->comm.rdv_cpy->name);
     pattern->src_proc = MC_smx_resolve_process(pattern->comm->comm.src_proc)->pid;
     pattern->src_host = MC_smx_process_get_host_name(issuer);
+    pattern->tag = ((MPI_Request)simcall_comm_isend__get__data(request))->tag;
     if(pattern->comm->comm.src_buff != NULL){
       pattern->data_size = pattern->comm->comm.src_buff_size;
       pattern->data = xbt_malloc0(pattern->data_size);
@@ -257,10 +220,22 @@ void get_comm_pattern(const xbt_dynar_t list, const smx_simcall_t request, const
       else
         memcpy(pattern->data, pattern->comm->comm.src_buff, pattern->data_size);
     }
+    if(((MPI_Request)simcall_comm_isend__get__data(request))->detached){
+      if (!initial_global_state->initial_communications_pattern_done) {
+        /* Store comm pattern */
+        xbt_dynar_push(((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, pattern->src_proc, mc_list_comm_pattern_t))->list, &pattern);
+      } else {
+        /* Evaluate comm determinism */
+        deterministic_comm_pattern(pattern->src_proc, pattern, backtracking);
+        ((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, pattern->src_proc, mc_list_comm_pattern_t))->index_comm++;
+      }
+      return;
+    }
   } else if (call_type == MC_CALL_TYPE_RECV) {                      
     pattern->type = SIMIX_COMM_RECEIVE;
     pattern->comm = simcall_comm_irecv__get__result(request);
     // TODO, remote access
+    pattern->tag = ((MPI_Request)simcall_comm_irecv__get__data(request))->tag;
     pattern->rdv = (pattern->comm->comm.rdv != NULL) ? strdup(pattern->comm->comm.rdv->name) : strdup(pattern->comm->comm.rdv_cpy->name);
     pattern->dst_proc = MC_smx_resolve_process(pattern->comm->comm.dst_proc)->pid;
     // FIXME, remote process access
@@ -274,70 +249,36 @@ void get_comm_pattern(const xbt_dynar_t list, const smx_simcall_t request, const
   XBT_DEBUG("Insert incomplete comm pattern %p for process %lu", pattern, issuer->pid);
 }
 
-void complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm, int backtracking) {
+void complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm, unsigned int issuer, int backtracking) {
   mc_comm_pattern_t current_comm_pattern;
   unsigned int cursor = 0;
-
-  smx_process_t src_proc = MC_smx_resolve_process(comm->comm.src_proc);
-  smx_process_t dst_proc = MC_smx_resolve_process(comm->comm.dst_proc);
-  unsigned int src = src_proc->pid;
-  unsigned int dst = dst_proc->pid;
-
-  mc_comm_pattern_t src_comm_pattern;
-  mc_comm_pattern_t dst_comm_pattern;
-  int src_completed = 0, dst_completed = 0;
+  mc_comm_pattern_t comm_pattern;
+  int completed = 0;
 
   /* Complete comm pattern */
-  xbt_dynar_foreach((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, src, xbt_dynar_t), cursor, current_comm_pattern) {
+  xbt_dynar_foreach((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, issuer, xbt_dynar_t), cursor, current_comm_pattern) {
     if (current_comm_pattern-> comm == comm) {
       update_comm_pattern(current_comm_pattern, comm);
-      src_completed = 1;
-      xbt_dynar_remove_at((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, src, xbt_dynar_t), cursor, &src_comm_pattern);
-      XBT_DEBUG("Remove incomplete comm pattern for process %u at cursor %u", src, cursor);
+      completed = 1;
+      xbt_dynar_remove_at((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, issuer, xbt_dynar_t), cursor, &comm_pattern);
+      XBT_DEBUG("Remove incomplete comm pattern for process %u at cursor %u", issuer, cursor);
       break;
     }
   }
-  if(!src_completed)
-    xbt_die("Corresponding communication for the source process not found!");
-
-  cursor = 0;
+  if(!completed)
+    xbt_die("Corresponding communication not found!");
 
-  xbt_dynar_foreach((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, dst, xbt_dynar_t), cursor, current_comm_pattern) {
-    if (current_comm_pattern-> comm == comm) {
-      update_comm_pattern(current_comm_pattern, comm);
-      dst_completed = 1;
-      xbt_dynar_remove_at((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, dst, xbt_dynar_t), cursor, &dst_comm_pattern);
-      XBT_DEBUG("Remove incomplete comm pattern for process %u at cursor %u", dst, cursor);
-      break;
-    }
-  }
-  if(!dst_completed)
-    xbt_die("Corresponding communication for the destination process not found!");
-  
   if (!initial_global_state->initial_communications_pattern_done) {
     /* Store comm pattern */
-    if(src_comm_pattern->index < xbt_dynar_length(((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, src, mc_list_comm_pattern_t))->list)){
-      xbt_dynar_set(((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, src, mc_list_comm_pattern_t))->list, src_comm_pattern->index, &src_comm_pattern);
-      ((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, src, mc_list_comm_pattern_t))->list->used++;
-    } else {
-      xbt_dynar_insert_at(((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, src, mc_list_comm_pattern_t))->list, src_comm_pattern->index, &src_comm_pattern);
-    }
-    
-    if(dst_comm_pattern->index < xbt_dynar_length(((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, dst, mc_list_comm_pattern_t))->list)) {
-      xbt_dynar_set(((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, dst, mc_list_comm_pattern_t))->list, dst_comm_pattern->index, &dst_comm_pattern);
-      ((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, dst, mc_list_comm_pattern_t))->list->used++;
-    } else {
-      xbt_dynar_insert_at(((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, dst, mc_list_comm_pattern_t))->list, dst_comm_pattern->index, &dst_comm_pattern);
-    }
-    ((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, src, mc_list_comm_pattern_t))->index_comm++;
-    ((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, dst, mc_list_comm_pattern_t))->index_comm++;
+    xbt_dynar_push(((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, issuer, mc_list_comm_pattern_t))->list, &comm_pattern);
   } else {
     /* Evaluate comm determinism */
-    deterministic_comm_pattern(src, src_comm_pattern, backtracking);
-    deterministic_comm_pattern(dst, dst_comm_pattern, backtracking);
+    deterministic_comm_pattern(issuer, comm_pattern, backtracking);
+    ((mc_list_comm_pattern_t)xbt_dynar_get_as(initial_communications_pattern, issuer, mc_list_comm_pattern_t))->index_comm++;
   }
 }
 
+
 /************************ Main algorithm ************************/
 
 void MC_pre_modelcheck_comm_determinism(void)
index 667f24e..2bb40d2 100644 (file)
@@ -10,6 +10,8 @@
 #include <xbt/dynar.h>
 
 #include "../simix/smx_private.h"
+#include "../smpi/private.h"
+#include <smpi/smpi.h>
 
 #ifndef MC_COMM_PATTERN_H
 #define MC_COMM_PATTERN_H
@@ -27,6 +29,7 @@ typedef struct s_mc_comm_pattern{
   char *rdv;
   ssize_t data_size;
   void *data;
+  int tag;
   int index;
 } s_mc_comm_pattern_t, *mc_comm_pattern_t;
 
@@ -50,6 +53,7 @@ typedef enum {
   NONE_DIFF,
   TYPE_DIFF,
   RDV_DIFF,
+  TAG_DIFF,
   SRC_PROC_DIFF,
   DST_PROC_DIFF,
   DATA_SIZE_DIFF,
@@ -72,11 +76,11 @@ static inline e_mc_call_type_t mc_get_call_type(smx_simcall_t req)
   }
 }
 
-void get_comm_pattern(xbt_dynar_t communications_pattern, smx_simcall_t request, e_mc_call_type_t call_type);
+void get_comm_pattern(xbt_dynar_t communications_pattern, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking);
 void handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t request, int value, xbt_dynar_t current_pattern, int backtracking);
 void comm_pattern_free_voidp(void *p);
 void list_comm_pattern_free_voidp(void *p);
-void complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm, int backtracking);
+void complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm, unsigned int issuer, int backtracking);
 void MC_pre_modelcheck_comm_determinism(void);
 void MC_modelcheck_comm_determinism(void);
 
index 5b6352a..696d688 100644 (file)
@@ -394,6 +394,11 @@ int snapshot_compare(void *state1, void *state2)
     s2 = ((mc_visited_pair_t) state2)->graph_state->system_state;
     num1 = ((mc_visited_pair_t) state1)->num;
     num2 = ((mc_visited_pair_t) state2)->num;
+  }else if (_sg_mc_termination) { /* Non-progressive cycle MC */
+    s1 = ((mc_state_t) state1)->system_state;
+    s2 = ((mc_state_t) state2)->system_state;
+    num1 = ((mc_state_t) state1)->num;
+    num2 = ((mc_state_t) state2)->num;
   } else {                      /* Safety or comm determinism MC */
     s1 = ((mc_visited_state_t) state1)->system_state;
     s2 = ((mc_visited_state_t) state2)->system_state;
index 6251712..79e2be3 100644 (file)
@@ -59,6 +59,7 @@ int _sg_mc_send_determinism = 0;
 int _sg_mc_safety = 0;
 int _sg_mc_liveness = 0;
 int _sg_mc_snapshot_fds = 0;
+int _sg_mc_termination = 0;
 
 void _mc_cfg_cb_reduce(const char *name, int pos)
 {
@@ -161,7 +162,6 @@ void _mc_cfg_cb_comms_determinism(const char *name, int pos)
         ("You are specifying a value to enable/disable the detection of determinism in the communications schemes after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_comms_determinism = xbt_cfg_get_boolean(_sg_cfg_set, name);
-  mc_reduce_kind = e_mc_reduce_none;
 }
 
 void _mc_cfg_cb_send_determinism(const char *name, int pos)
@@ -171,7 +171,15 @@ void _mc_cfg_cb_send_determinism(const char *name, int pos)
         ("You are specifying a value to enable/disable the detection of send-determinism in the communications schemes after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_send_determinism = xbt_cfg_get_boolean(_sg_cfg_set, name);
-  mc_reduce_kind = e_mc_reduce_none;
+}
+
+void _mc_cfg_cb_termination(const char *name, int pos)
+{
+  if (_sg_cfg_init_status && !_sg_do_model_check) {
+    xbt_die
+        ("You are specifying a value to enable/disable the detection of non progressive cycles after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
+  }
+  _sg_mc_termination = xbt_cfg_get_boolean(_sg_cfg_set, name);
 }
 
 #endif
index 56ad792..eaba624 100644 (file)
@@ -139,7 +139,7 @@ void MC_init_pid(pid_t pid, int socket)
 
   MC_SET_STD_HEAP;
 
-  if (_sg_mc_visited > 0 || _sg_mc_liveness) {
+  if (_sg_mc_visited > 0 || _sg_mc_liveness  || _sg_mc_termination) {
     /* Ignore some variables from xbt/ex.h used by exception e for stacks comparison */
     MC_ignore_local_variable("e", "*");
     MC_ignore_local_variable("__ex_cleanup", "*");
@@ -220,8 +220,11 @@ static void MC_modelcheck_comm_determinism_init(void)
   initial_global_state = xbt_new0(s_mc_global_t, 1);
   initial_global_state->snapshot = MC_take_snapshot(0);
   initial_global_state->initial_communications_pattern_done = 0;
-  initial_global_state->comm_deterministic = 1;
+  initial_global_state->recv_deterministic = 1;
   initial_global_state->send_deterministic = 1;
+  initial_global_state->recv_diff = NULL;
+  initial_global_state->send_diff = NULL;
+
   MC_SET_STD_HEAP;
 
   MC_modelcheck_comm_determinism();
@@ -289,11 +292,15 @@ void MC_do_the_modelcheck_for_real()
 
   if (_sg_mc_comms_determinism || _sg_mc_send_determinism) {
     XBT_INFO("Check communication determinism");
+    mc_reduce_kind = e_mc_reduce_none;
     MC_modelcheck_comm_determinism_init();
   } else if (!_sg_mc_property_file || _sg_mc_property_file[0] == '\0') {
-    if (mc_reduce_kind == e_mc_reduce_unset)
-      mc_reduce_kind = e_mc_reduce_dpor;
-    XBT_INFO("Check a safety property");
+    if(_sg_mc_termination){
+      XBT_INFO("Check non progressive cycles");
+      mc_reduce_kind = e_mc_reduce_none;
+    }else{
+      XBT_INFO("Check a safety property");
+    }
     MC_modelcheck_safety_init();
   } else {
     if (mc_reduce_kind == e_mc_reduce_unset)
@@ -354,7 +361,7 @@ void handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t req, int valu
     break;
   case MC_CALL_TYPE_SEND:
   case MC_CALL_TYPE_RECV:
-    get_comm_pattern(pattern, req, call_type);
+    get_comm_pattern(pattern, req, call_type, backtracking);
     break;
   case MC_CALL_TYPE_WAIT:
   case MC_CALL_TYPE_WAITANY:
@@ -364,11 +371,9 @@ void handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t req, int valu
         current_comm = simcall_comm_wait__get__comm(req);
       else
         current_comm = xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_synchro_t);
-      // First wait only must be considered:
-      if (current_comm->comm.refcount == 1)
-        complete_comm_pattern(pattern, current_comm, backtracking);
-      break;
+      complete_comm_pattern(pattern, current_comm, req->issuer->pid, backtracking);
     }
+    break;
   default:
     xbt_die("Unexpected call type %i", (int)call_type);
   }
@@ -432,7 +437,7 @@ void MC_replay(xbt_fifo_t stack)
   XBT_DEBUG("**** Begin Replay ****");
 
   /* Intermediate backtracking */
-  if(_sg_mc_checkpoint > 0) {
+  if(_sg_mc_checkpoint > 0 || _sg_mc_termination || _sg_mc_visited > 0) {
     start_item = xbt_fifo_get_first_item(stack);
     state = (mc_state_t)xbt_fifo_get_item_content(start_item);
     if(state->system_state){
@@ -654,6 +659,15 @@ void MC_show_deadlock(smx_simcall_t req)
   MC_print_statistics(mc_stats);
 }
 
+void MC_show_non_termination(void){
+  XBT_INFO("******************************************");
+  XBT_INFO("*** NON-PROGRESSIVE CYCLE DETECTED ***");
+  XBT_INFO("******************************************");
+  XBT_INFO("Counter-example execution trace:");
+  MC_dump_stack_safety(mc_stack);
+  MC_print_statistics(mc_stats);
+}
+
 
 void MC_show_stack_liveness(xbt_fifo_t stack)
 {
@@ -685,9 +699,22 @@ void MC_dump_stack_liveness(xbt_fifo_t stack)
   mmalloc_set_current_heap(heap);
 }
 
-
 void MC_print_statistics(mc_stats_t stats)
 {
+  if(_sg_mc_comms_determinism) {
+    if (!initial_global_state->recv_deterministic && initial_global_state->send_deterministic){
+      XBT_INFO("******************************************************");
+      XBT_INFO("**** Only-send-deterministic communication pattern ****");
+      XBT_INFO("******************************************************");
+      XBT_INFO("%s", initial_global_state->recv_diff);
+    }else if(!initial_global_state->send_deterministic && initial_global_state->recv_deterministic) {
+      XBT_INFO("******************************************************");
+      XBT_INFO("**** Only-recv-deterministic communication pattern ****");
+      XBT_INFO("******************************************************");
+      XBT_INFO("%s", initial_global_state->send_diff);
+    }
+  }
+
   if (stats->expanded_pairs == 0) {
     XBT_INFO("Expanded states = %lu", stats->expanded_states);
     XBT_INFO("Visited states = %lu", stats->visited_states);
@@ -701,11 +728,10 @@ void MC_print_statistics(mc_stats_t stats)
     fprintf(dot_output, "}\n");
     fclose(dot_output);
   }
-  if (initial_global_state != NULL) {
+  if (initial_global_state != NULL && (_sg_mc_comms_determinism || _sg_mc_send_determinism)) {
+    XBT_INFO("Send-deterministic : %s", !initial_global_state->send_deterministic ? "No" : "Yes");
     if (_sg_mc_comms_determinism)
-      XBT_INFO("Communication-deterministic : %s", !initial_global_state->comm_deterministic ? "No" : "Yes");
-    if (_sg_mc_send_determinism)
-      XBT_INFO("Send-deterministic : %s", !initial_global_state->send_deterministic ? "No" : "Yes");
+      XBT_INFO("Recv-deterministic : %s", !initial_global_state->recv_deterministic ? "No" : "Yes");
   }
   mmalloc_set_current_heap(heap);
 }
index c8aa50f..72997ba 100644 (file)
@@ -1,3 +1,10 @@
+/* MC interface: definitions that non-MC modules must see, but not the user */
+
+/* Copyright (c) 2014-2015. The SimGrid Team.  All rights reserved.         */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #include <unistd.h> // pread, pwrite
 
 #include "mc_page_store.h"
index bcc454f..b5f061a 100644 (file)
@@ -62,6 +62,7 @@ void MC_replay_liveness(xbt_fifo_t stack);
 void MC_show_deadlock(smx_simcall_t req);
 void MC_show_stack_safety(xbt_fifo_t stack);
 void MC_dump_stack_safety(xbt_fifo_t stack);
+void MC_show_non_termination(void);
 
 /** Stack (of `mc_state_t`) representing the current position of the
  *  the MC in the exploration graph
index 1b12665..ad4d1fa 100644 (file)
@@ -234,6 +234,7 @@ char *MC_request_to_string(smx_simcall_t req, int value)
 {
   char *type = NULL, *args = NULL, *str = NULL, *p = NULL, *bs = NULL;
   smx_synchro_t act = NULL;
+  smx_mutex_t mutex = NULL;
   size_t size = 0;
 
   smx_process_t issuer = MC_smx_simcall_get_issuer(req);
@@ -342,6 +343,12 @@ char *MC_request_to_string(smx_simcall_t req, int value)
     }
     break;
 
+  case SIMCALL_MUTEX_LOCK:
+    mutex = simcall_mutex_lock__get__mutex(req);
+    type = xbt_strdup("Mutex LOCK");
+    args = bprintf("locked = %d, owner = %d, sleeping = %d", mutex->locked, mutex->owner != NULL ? (int)mutex->owner->pid : -1, xbt_swag_size(mutex->sleeping));
+    break;
+
   case SIMCALL_MC_SNAPSHOT:
     type = xbt_strdup("MC_SNAPSHOT");
     args = NULL;
@@ -542,6 +549,10 @@ char *MC_request_get_dot_output(smx_simcall_t req, int value)
     }
     break;
 
+  case SIMCALL_MUTEX_LOCK:
+    label = bprintf("[(%lu)] Mutex LOCK", req->issuer->pid);
+    break;
+
   case SIMCALL_MC_RANDOM:
     if (issuer->smx_host)
       label =
index 544cf51..3dea427 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_safety, mc,
                                 "Logging specific to MC safety verification ");
 
+static int is_exploration_stack_state(mc_state_t current_state){
+
+  xbt_fifo_item_t item;
+  mc_state_t stack_state;
+  for(item = xbt_fifo_get_first_item(mc_stack); item != NULL; item = xbt_fifo_get_next_item(item)) {
+    stack_state = (mc_state_t) xbt_fifo_get_item_content(item);
+    if(snapshot_compare(stack_state, current_state) == 0){
+      XBT_INFO("Non-progressive cycle : state %d -> state %d", stack_state->num, current_state->num);
+      return 1;
+    }
+  }
+  return 0;
+}
+
 /**
  *  \brief Initialize the DPOR exploration algorithm
  */
@@ -113,6 +127,11 @@ void MC_modelcheck_safety(void)
 
       next_state = MC_state_new();
 
+      if(_sg_mc_termination && is_exploration_stack_state(next_state)){
+          MC_show_non_termination();
+          return;
+      }
+
       if ((visited_state = is_visited_state(next_state)) == NULL) {
 
         /* Get an enabled process and insert it in the interleave set of the next state */
index 70b37f8..98a2c70 100644 (file)
@@ -251,8 +251,10 @@ typedef struct s_mc_global_t {
   int prev_pair;
   char *prev_req;
   int initial_communications_pattern_done;
-  int comm_deterministic;
+  int recv_deterministic;
   int send_deterministic;
+  char *send_diff;
+  char *recv_diff;
 }s_mc_global_t, *mc_global_t;
 
 typedef struct s_mc_checkpoint_ignore_region{
index 09643b4..09b5239 100644 (file)
@@ -74,7 +74,7 @@ mc_state_t MC_state_new()
   state->in_visited_states = 0;
   state->incomplete_comm_pattern = NULL;
   /* Stateful model checking */
-  if(_sg_mc_checkpoint > 0 && mc_stats->expanded_states % _sg_mc_checkpoint == 0){
+  if((_sg_mc_checkpoint > 0 && (mc_stats->expanded_states % _sg_mc_checkpoint == 0)) ||  _sg_mc_termination){
     state->system_state = MC_take_snapshot(state->num);
     if(_sg_mc_comms_determinism || _sg_mc_send_determinism){
       copy_incomplete_communications_pattern(state);
index c2e853b..b36b3eb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2014. The SimGrid Team.
+/* Copyright (c) 2004-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -511,7 +511,7 @@ msg_comm_t MSG_task_isend_bounded(msg_task_t task, const char *alias,
  * \param match_fun boolean function which parameters are:
  *        - match_data_provided_here
  *        - match_data_provided_by_other_side_if_any
- *        - the_smx_action_describing_the_other_side
+ *        - the_smx_synchro_describing_the_other_side
  * \param match_data user provided data passed to match_fun
  * \return the msg_comm_t communication created
  */
index 14aff6c..0df4dbe 100644 (file)
@@ -350,7 +350,7 @@ void MSG_host_get_params(msg_host_t host, ws_params_t params)
 }
 
 /** \ingroup m_host_management
- * \brief Return the speed of the processor (in flop/s) at a given pstate
+ * \brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref SURF_plugin_energy.
  *
  * \param  host host to test
  * \param pstate_index pstate to test
@@ -373,7 +373,7 @@ double MSG_host_get_current_power_peak(msg_host_t host) {
 }
 
 /** \ingroup m_host_management
- * \brief Return the number of pstates defined for a host
+ * \brief Return the number of pstates defined for a host. See also @ref SURF_plugin_energy.
  *
  * \param  host host to test
  */
@@ -384,7 +384,7 @@ int MSG_host_get_pstate_number(msg_host_t host) {
 }
 
 /** \ingroup m_host_management
- * \brief Sets the speed of the processor (in flop/s) at a given pstate
+ * \brief Sets the speed of the processor (in flop/s) at a given pstate. See also @ref SURF_plugin_energy.
  *
  * \param  host host to test
  * \param pstate_index pstate to switch to
@@ -396,7 +396,7 @@ void MSG_host_set_pstate(msg_host_t host, int pstate_index) {
 }
 
 /** \ingroup m_host_management
- * \brief Return the total energy consumed by a host (in Joules)
+ * \brief Return the total energy consumed by a host (in Joules). See also @ref SURF_plugin_energy.
  *
  * \param  host host to test
  * \return Returns the consumed energy
index 18b73fb..e753e76 100644 (file)
@@ -303,7 +303,7 @@ static void _sg_cfg_cb__coll(const char *category,
   }
 
   /* New Module missing */
-  find_coll_description(table, val);
+  find_coll_description(table, val, category);
 }
 static void _sg_cfg_cb__coll_gather(const char *name, int pos){
   _sg_cfg_cb__coll("gather", mpi_coll_gather_description, name, pos);
@@ -718,6 +718,12 @@ void sg_config_init(int *argc, char **argv)
                      "Specify the name of dot file corresponding to graph state",
                      xbt_cfgelm_string, 1, 1, _mc_cfg_cb_dot_output, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "model-check/dot_output", "");
+
+     /* Enable/disable non progressive cycles detection with model-checking */
+    xbt_cfg_register(&_sg_cfg_set, "model-check/termination",
+                     "Enable/Disable non progressive cycle detection",
+                     xbt_cfgelm_boolean, 1, 1, _mc_cfg_cb_termination, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/termination", "no");
 #endif
 
     /* do verbose-exit */
index a7b145f..1652308 100644 (file)
@@ -66,7 +66,7 @@ simcall_* functions). Moreover, you must know that each blocking
 simcall will result in an interruption of your execution flow. 
 
 Let's take an example: If your code contains:
-   smx_action_t act = simcall_comm_isend(......);
+   smx_synchro_t act = simcall_comm_isend(......);
    simcall_comm_wait(act);
    simcall_comm_destroy(act);
    
index 3bca49d..4a3bb41 100644 (file)
@@ -14,6 +14,9 @@
 #include "colls/colls.h"
 #include "simgrid/sg_config.h"
 
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi,
+                                "Logging specific to SMPI (coll)");
+
 s_mpi_coll_description_t mpi_coll_gather_description[] = {
   {"default",
    "gather default collective",
@@ -121,7 +124,7 @@ void coll_help(const char *category, s_mpi_coll_description_t * table)
 }
 
 int find_coll_description(s_mpi_coll_description_t * table,
-                           char *name)
+                           char *name, const char *desc)
 {
   int i;
   char *name_list = NULL;
@@ -132,6 +135,8 @@ int find_coll_description(s_mpi_coll_description_t * table,
   }
   for (i = 0; table[i].name; i++)
     if (!strcmp(name, table[i].name)) {
+      if (strcmp(table[i].name,"default"))
+        XBT_INFO("Switch to algorithm %s for collective %s",table[i].name,desc);
       return i;
     }
 
@@ -144,7 +149,7 @@ int find_coll_description(s_mpi_coll_description_t * table,
     }
   }
   if (!table[0].name)
-    xbt_die("No collective is valid! This is a bug.");
+    xbt_die("No collective is valid for '%s'! This is a bug.",name);
   name_list = xbt_strdup(table[0].name);
   for (i = 1; table[i].name; i++) {
     name_list =
@@ -157,9 +162,6 @@ int find_coll_description(s_mpi_coll_description_t * table,
   return -1;
 }
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi,
-                                "Logging specific to SMPI (coll)");
-
 int (*mpi_coll_gather_fun)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, int root, MPI_Comm);
 int (*mpi_coll_allgather_fun)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
 int (*mpi_coll_allgatherv_fun)(void *, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm);
index 9a647ee..585847b 100644 (file)
@@ -550,51 +550,51 @@ static void smpi_init_logs(){
 
 static void smpi_init_options(){
   int gather_id = find_coll_description(mpi_coll_gather_description,
-                                          sg_cfg_get_string("smpi/gather"));
+                                          sg_cfg_get_string("smpi/gather"),"gather");
     mpi_coll_gather_fun = (int (*)(void *, int, MPI_Datatype,
                                    void *, int, MPI_Datatype, int, MPI_Comm))
         mpi_coll_gather_description[gather_id].coll;
 
     int allgather_id = find_coll_description(mpi_coll_allgather_description,
-                                             sg_cfg_get_string("smpi/allgather"));
+                                             sg_cfg_get_string("smpi/allgather"),"allgather");
     mpi_coll_allgather_fun = (int (*)(void *, int, MPI_Datatype,
                                       void *, int, MPI_Datatype, MPI_Comm))
         mpi_coll_allgather_description[allgather_id].coll;
 
     int allgatherv_id = find_coll_description(mpi_coll_allgatherv_description,
-                                              sg_cfg_get_string("smpi/allgatherv"));
+                                              sg_cfg_get_string("smpi/allgatherv"),"allgatherv");
     mpi_coll_allgatherv_fun = (int (*)(void *, int, MPI_Datatype, void *, int *,
                                        int *, MPI_Datatype, MPI_Comm))
         mpi_coll_allgatherv_description[allgatherv_id].coll;
 
     int allreduce_id = find_coll_description(mpi_coll_allreduce_description,
-                                             sg_cfg_get_string("smpi/allreduce"));
+                                             sg_cfg_get_string("smpi/allreduce"),"allreduce");
     mpi_coll_allreduce_fun = (int (*)(void *sbuf, void *rbuf, int rcount,
                                       MPI_Datatype dtype, MPI_Op op,
                                       MPI_Comm comm))
         mpi_coll_allreduce_description[allreduce_id].coll;
 
     int alltoall_id = find_coll_description(mpi_coll_alltoall_description,
-                                            sg_cfg_get_string("smpi/alltoall"));
+                                            sg_cfg_get_string("smpi/alltoall"),"alltoall");
     mpi_coll_alltoall_fun = (int (*)(void *, int, MPI_Datatype,
                                      void *, int, MPI_Datatype, MPI_Comm))
         mpi_coll_alltoall_description[alltoall_id].coll;
 
     int alltoallv_id = find_coll_description(mpi_coll_alltoallv_description,
-                                             sg_cfg_get_string("smpi/alltoallv"));
+                                             sg_cfg_get_string("smpi/alltoallv"),"alltoallv");
     mpi_coll_alltoallv_fun = (int (*)(void *, int *, int *, MPI_Datatype,
                                       void *, int *, int *, MPI_Datatype,
                                       MPI_Comm))
         mpi_coll_alltoallv_description[alltoallv_id].coll;
 
     int bcast_id = find_coll_description(mpi_coll_bcast_description,
-                                         sg_cfg_get_string("smpi/bcast"));
+                                         sg_cfg_get_string("smpi/bcast"),"bcast");
     mpi_coll_bcast_fun = (int (*)(void *buf, int count, MPI_Datatype datatype,
                                   int root, MPI_Comm com))
         mpi_coll_bcast_description[bcast_id].coll;
 
     int reduce_id = find_coll_description(mpi_coll_reduce_description,
-                                          sg_cfg_get_string("smpi/reduce"));
+                                          sg_cfg_get_string("smpi/reduce"),"reduce");
     mpi_coll_reduce_fun = (int (*)(void *buf, void *rbuf, int count,
                                    MPI_Datatype datatype, MPI_Op op,
                                    int root, MPI_Comm comm))
@@ -602,14 +602,14 @@ static void smpi_init_options(){
 
     int reduce_scatter_id =
         find_coll_description(mpi_coll_reduce_scatter_description,
-                              sg_cfg_get_string("smpi/reduce_scatter"));
+                              sg_cfg_get_string("smpi/reduce_scatter"),"reduce_scatter");
     mpi_coll_reduce_scatter_fun = (int (*)(void *sbuf, void *rbuf, int *rcounts,
                                            MPI_Datatype dtype, MPI_Op op,
                                            MPI_Comm comm))
         mpi_coll_reduce_scatter_description[reduce_scatter_id].coll;
 
     int scatter_id = find_coll_description(mpi_coll_scatter_description,
-                                           sg_cfg_get_string("smpi/scatter"));
+                                           sg_cfg_get_string("smpi/scatter"),"scatter");
     mpi_coll_scatter_fun = (int (*)(void *sendbuf, int sendcount,
                                     MPI_Datatype sendtype, void *recvbuf,
                                     int recvcount, MPI_Datatype recvtype,
@@ -617,7 +617,7 @@ static void smpi_init_options(){
         mpi_coll_scatter_description[scatter_id].coll;
 
     int barrier_id = find_coll_description(mpi_coll_barrier_description,
-                                           sg_cfg_get_string("smpi/barrier"));
+                                           sg_cfg_get_string("smpi/barrier"),"barrier");
     mpi_coll_barrier_fun = (int (*)(MPI_Comm comm))
         mpi_coll_barrier_description[barrier_id].coll;
 
index 6902a25..41ece46 100755 (executable)
@@ -1,12 +1,13 @@
 #! /bin/sh
 
-# Copyright (c) 2007-2014. The SimGrid Team.
+# Copyright (c) 2007-2015. The SimGrid Team.
 # All rights reserved.
 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
+SIMGRID_GITHASH="@SIMGRID_GITHASH@"
 
 CC=@CMAKE_C_COMPILER@
 
@@ -46,6 +47,10 @@ while [ $# -gt 0 ]; do
             printf '%b\n' "$SIMGRID_VERSION"
             exit 0
             ;;
+        "-git-version" | "--git-version")
+            printf '%b\n' "$SIMGRID_GITHASH"
+            exit 0
+            ;;
         '-compiler-version' | '--compiler-version')
             ${CC} --version
             ;;
index b23a274..cec9115 100755 (executable)
@@ -1,12 +1,13 @@
 #! /bin/sh
 
-# Copyright (c) 2014. The SimGrid Team.
+# Copyright (c) 2014-2015. The SimGrid Team.
 # All rights reserved.
 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
+SIMGRID_GITHASH="@SIMGRID_GITHASH@"
 
 CXX=@CMAKE_CXX_COMPILER@
 
@@ -46,6 +47,10 @@ while [ $# -gt 0 ]; do
             printf '%b\n' "$SIMGRID_VERSION"
             exit 0
             ;;
+        "-git-version" | "--git-version")
+            printf '%b\n' "$SIMGRID_GITHASH"
+            exit 0
+            ;;
         '-compiler-version' | '--compiler-version')
             ${CXX} --version
             ;;
index 1a33ba1..1e6a7e6 100644 (file)
@@ -1,12 +1,13 @@
 #! /bin/sh
 
-# Copyright (c) 2012-2014. The SimGrid Team.
+# Copyright (c) 2012-2015. The SimGrid Team.
 # All rights reserved.
 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
+SIMGRID_GITHASH="@SIMGRID_GITHASH@"
 
 F90=@GFORTRAN_EXE@
 
@@ -49,6 +50,10 @@ while [ $# -gt 0 ]; do
             printf '%b\n' "$SIMGRID_VERSION"
             exit 0
             ;;
+        "-git-version" | "--git-version")
+            printf '%b\n' "$SIMGRID_GITHASH"
+            exit 0
+            ;;
         '-compiler-version' | '--compiler-version')
             ${F90} --version
             ;;
index 1c6308d..8cb4bf4 100644 (file)
@@ -1,12 +1,13 @@
 #! /bin/sh
 
-# Copyright (c) 2012-2014. The SimGrid Team.
+# Copyright (c) 2012-2015. The SimGrid Team.
 # All rights reserved.
 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the license (GNU LGPL) which comes with this package.
 
 SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
+SIMGRID_GITHASH="@SIMGRID_GITHASH@"
 
 F77=@GFORTRAN_EXE@
 
@@ -53,6 +54,10 @@ while [ $# -gt 0 ]; do
             printf '%b\n' "$SIMGRID_VERSION"
             exit 0
             ;;
+        "-git-version" | "--git-version")
+            printf '%b\n' "$SIMGRID_GITHASH"
+            exit 0
+            ;;
         '-compiler-version' | '--compiler-version')
             ${F77} --version
             ;;
index 67e4624..812acdb 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# Copyright (c) 2007-2014. The SimGrid Team.
+# Copyright (c) 2007-2015. The SimGrid Team.
 # All rights reserved.
 
 # This program is free software; you can redistribute it and/or modify it
@@ -9,6 +9,7 @@
 @CMAKE_SMPI_COMMAND@
 
 SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
+SIMGRID_GITHASH="@SIMGRID_GITHASH@"
 
 DEFAULT_LOOPBACK_BANDWIDTH="498000000"
 DEFAULT_LOOPBACK_LATENCY="0.000004"
@@ -44,6 +45,9 @@ Options:
   -trace-viva                # generate configuration for Viva's GraphView
   -trace-file <tracefile>    # name of the tracefile (simgrid_smpi.trace)
   -ext <value>               # additional parameter (reserved)
+  
+  -version                   # Displays the SimGrid version (human readable)
+  -git-version               # Displays the git hash of SimGrid
 
 or (deprecated usage):
   $0 [-keep-temps] [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]
@@ -172,6 +176,11 @@ while true; do
             printf '%b\n' "$SIMGRID_VERSION"
             exit 0
             ;;
+           
+        "-git-version" | "--git-version")
+            printf '%b\n' "$SIMGRID_GITHASH"
+            exit 0
+            ;;
 
         "--cfg="*|"--log="*)
             for OPT in ${1#*=}
@@ -225,6 +234,20 @@ if [ -z "${HOSTFILE}" ] ; then
     HOSTFILETMP=1
     HOSTFILE="$(mktemp tmphostXXXXXX)"
     perl -ne 'print "$1\n" if /.*<host.*?id="(.*?)".*?\/>.*/' ${PLATFORM} > ${HOSTFILE}
+    perl -ne 'if (/.*<cluster.*?prefix="(.*?)".*?radical="(.*?)".*?suffix="(.*?)".*/) { 
+                my ($pre,$rad,$post)=($1,$2,$3); 
+               for my $elm (split(",",$rad)) { 
+                 if ($elm=~/^([^-]*?)-([^-]*)$/) { 
+                    for (my $i=$1; $i<=$2;$i++) { 
+                       print "$pre$i$post\n"; 
+                    }
+                 } else {
+                    print "$pre$elm$post\n";
+                 }
+               }
+             } elsif (/<cluster/) {
+               die ("Unparsable cluster tag. Either provide an hostfile yourself or give the attributes prefix, radical and suffix in that order on the <cluster line");
+             }' ${PLATFORM} >> ${HOSTFILE}
 fi
 UNROLLEDHOSTFILETMP=0
 
index ba1f601..fc8b453 100644 (file)
@@ -810,7 +810,7 @@ void lmm_solve(lmm_system_t sys)
     saturated_constraint_set->pos = 0;
     int pos;
     for(pos=0; pos<cnst_light_num; pos++){
-       xbt_assert(cnst_light_tab[pos].cnst->active_element_set.count>0, "Cannot saturate more a constraint that has no active element! You want to check the maxmin precision and possible rounding effects." );
+      xbt_assert(cnst_light_tab[pos].cnst->active_element_set.count>0, "Cannot saturate more a constraint that has no active element! You may want to change the maxmin precision (--cfg=maxmin/precision:<new_value>) because of possible rounding effects.\n\tFor the record, the usage of this constraint is %g while the maxmin precision to which it is compared is %g.\n\tThe usage of the previous constraint is %g.", cnst_light_tab[pos].cnst->usage, sg_maxmin_precision, cnst_light_tab[pos-1].cnst->usage);
       saturated_constraint_set_update(
           cnst_light_tab[pos].remaining_over_usage,
           pos,
index 3badfdf..63fcfad 100644 (file)
@@ -8,9 +8,42 @@
 #include "../cpu_cas01.hpp"
 
 /** @addtogroup SURF_plugin_energy
- *
- *
- *  This is the energy plugin, enabling to account not only for computation time, but also for the dissipated energy in the simulated platform.
+
+
+This is the energy plugin, enabling to account not only for computation time,
+but also for the dissipated energy in the simulated platform.
+
+The energy consumption of a CPU depends directly of its current load. Specify that consumption in your platform file as follows:
+
+\verbatim
+<host id="HostA" power="100.0Mf" >
+    <prop id="watt_per_state" value="100.0:200.0" />
+    <prop id="watt_off" value="10" />
+</host>
+\endverbatim
+
+The first property means that when your host is up and running, but without anything to do, it will dissipate 100 Watts.
+If it's fully loaded, it will dissipate 200 Watts. If its load is at 50%, then it will dissipate 150 Watts.
+The second property means that when your host is turned off, it will dissipate only 10 Watts (please note that these values are arbitrary).
+
+If your CPU is using pstates, then you can provide one consumption interval per pstate.
+
+\verbatim
+<host id="HostB" power="100.0Mf,50.0Mf,20.0Mf" pstate="0" >
+    <prop id="watt_per_state" value="95.0:200.0, 93.0:170.0, 90.0:150.0" />
+    <prop id="watt_off" value="10" />
+</host>
+\endverbatim
+
+That host has 3 levels of performance with the following performance: 100 Mflop/s, 50 Mflop/s or 20 Mflop/s.
+It starts at pstate 0 (ie, at 100 Mflop/s). In this case, you have to specify one interval per pstate in the watt_per_state property.
+In this example, the idle consumption is 95 Watts, 93 Watts and 90 Watts in each pstate while the CPU burn consumption are at 200 Watts,
+170 Watts and 150 Watts respectively.
+
+To change the pstate of a given CPU, use the following functions: #MSG_host_get_pstate_number, #MSG_host_set_pstate(), #MSG_host_get_power_peak_at().
+
+To simulate the energy-related elements, first call the #sg_energy_plugin_init() before your #MSG_init(),
+and then use the following function to retrieve the consumption of a given host: #MSG_host_get_consumed_energy().
  */
 
 XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
@@ -94,7 +127,7 @@ static void sg_energy_plugin_exit()
 
 /** \ingroup SURF_plugin_energy
  * \brief Enable energy plugin
- * \details Enable energy plugin to get joules consumption of each cpu.
+ * \details Enable energy plugin to get joules consumption of each cpu. You should call this function before #MSG_init().
  */
 void sg_energy_plugin_init() {
   if (surf_energy == NULL) {
index 16b6f4e..c3adc90 100644 (file)
@@ -99,9 +99,7 @@ xbt_dict_t watched_hosts_lib;
 surf_callback(void, void) surfExitCallbacks;
 
 s_surf_model_description_t surf_plugin_description[] = {
-    {"Energy",
-     "Cpu energy consumption.",
-     sg_energy_plugin_init},
+    {"Energy", "Cpu energy consumption.", sg_energy_plugin_init},
      {NULL, NULL,  NULL}      /* this array must be NULL terminated */
 };
 
index bbfce75..dc2d218 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test all to all
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allgather_coll --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allgather_coll --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 843b330..6c36aa6 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test allgatherv
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allgatherv_coll --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allgatherv_coll --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 5d9832f..cecba0c 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test allreduce
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allreduce_coll --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allreduce_coll --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index deacf27..8f7eaa7 100644 (file)
@@ -4,7 +4,7 @@
 
 ! timeout 20
 p Test allreduce
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allreduce_coll 30000 --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allreduce_coll 30000 --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 3bc5d07..c2bd4d5 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test all to all
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/alltoall_coll -q --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/alltoall_coll -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 2d1dc1e..e47b26a 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test all to all
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/alltoallv_coll --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/alltoallv_coll --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 73cfd31..8f53e26 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test barrier
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/barrier_coll --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/barrier_coll --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > ... Barrier ....
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [rank 0] -> Tremblay
index 5827590..d92f374 100644 (file)
@@ -2,7 +2,7 @@ p Test Broadcast with more processes than hosts
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/bcast_coll --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/bcast_coll --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 63483f0..c6af534 100644 (file)
@@ -4,7 +4,7 @@
 ! timeout 30
 
 p Test all to all
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/gather_coll --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/gather_coll --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 1587445..917bfe5 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test allreduce
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/reduce_coll --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/reduce_coll --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ]
 > [0] second sndbuf=[0 ]
index 1c5155e..dcbcda7 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test reduce_scatter
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/reduce_scatter_coll --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/reduce_scatter_coll --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 >  No Errors
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [rank 0] -> Tremblay
index 5dafeb3..08cc4ba 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test scatter
-$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/scatter --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/scatter --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
 >      [0] ok.
 >      [0] ok.
 >      [10] ok.
index 7875935..8636be2 100644 (file)
@@ -1,11 +1,10 @@
-/* Copyright (c) 2009-2014. The SimGrid Team.
+/* Copyright (c) 2009-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-/* This example should be instructive to learn about SMPI_SAMPLE_LOCAL and 
-   SMPI_SAMPLE_GLOBAL macros for execution sampling */
+/* This example should be instructive to learn about SMPI_SHARED_CALL */
 
 #include <stdio.h>
 #include <mpi.h>
@@ -39,7 +38,7 @@ int main(int argc, char *argv[])
   }
   
   MPI_Barrier(MPI_COMM_WORLD);
-  //everyobne reads from it. 
+  //everyone reads from it.
   printf("[%d] The value in the shared buffer is: %" PRIu64"\n", rank, *buf);