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
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}")
- 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/).
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)
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()
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)
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
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
)
endif()
+ message(STATUS "Found flex: ${FLEX_EXE}")
IF(FLEX_EXE)
set(HAVE_FLEX 1)
exec_program("${FLEX_EXE} --version" OUTPUT_VARIABLE FLEX_VERSION)
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)
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)
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)
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
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
-# 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
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();
> [ 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
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}
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
)
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
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()
${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
${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
--- /dev/null
+node-1.acme.org
+node-2.acme.org
\ No newline at end of file
+++ /dev/null
-node-1.acme.org
-node-2.acme.org
-node-3.acme.org
+++ /dev/null
-/* ../../../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;
-}
--- /dev/null
+#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;
+}
--- /dev/null
+#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;
+}
--- /dev/null
+#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;
+}
--- /dev/null
+#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;
+}
--- /dev/null
+#! ./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
+++ /dev/null
-#! ./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
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;
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);
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;
#ifdef HAVE_MC
s_smx_synchro_t temp_synchro;
#endif
+ smx_mutex_t mutex = NULL;
switch (req->call) {
case SIMCALL_NONE:
}
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;
|| 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
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
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);
}
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;
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);
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
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)
#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
char *rdv;
ssize_t data_size;
void *data;
+ int tag;
int index;
} s_mc_comm_pattern_t, *mc_comm_pattern_t;
NONE_DIFF,
TYPE_DIFF,
RDV_DIFF,
+ TAG_DIFF,
SRC_PROC_DIFF,
DST_PROC_DIFF,
DATA_SIZE_DIFF,
}
}
-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);
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;
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)
{
("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)
("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
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", "*");
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();
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)
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:
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);
}
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){
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)
{
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);
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);
}
+/* 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"
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
{
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);
}
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;
}
break;
+ case SIMCALL_MUTEX_LOCK:
+ label = bprintf("[(%lu)] Mutex LOCK", req->issuer->pid);
+ break;
+
case SIMCALL_MC_RANDOM:
if (issuer->smx_host)
label =
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
*/
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 */
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{
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);
-/* 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
* \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
*/
}
/** \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
}
/** \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
*/
}
/** \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
}
/** \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
}
/* 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);
"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 */
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);
#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",
}
int find_coll_description(s_mpi_coll_description_t * table,
- char *name)
+ char *name, const char *desc)
{
int i;
char *name_list = NULL;
}
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;
}
}
}
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 =
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);
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))
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,
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;
#! /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@
printf '%b\n' "$SIMGRID_VERSION"
exit 0
;;
+ "-git-version" | "--git-version")
+ printf '%b\n' "$SIMGRID_GITHASH"
+ exit 0
+ ;;
'-compiler-version' | '--compiler-version')
${CC} --version
;;
#! /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@
printf '%b\n' "$SIMGRID_VERSION"
exit 0
;;
+ "-git-version" | "--git-version")
+ printf '%b\n' "$SIMGRID_GITHASH"
+ exit 0
+ ;;
'-compiler-version' | '--compiler-version')
${CXX} --version
;;
#! /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@
printf '%b\n' "$SIMGRID_VERSION"
exit 0
;;
+ "-git-version" | "--git-version")
+ printf '%b\n' "$SIMGRID_GITHASH"
+ exit 0
+ ;;
'-compiler-version' | '--compiler-version')
${F90} --version
;;
#! /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@
printf '%b\n' "$SIMGRID_VERSION"
exit 0
;;
+ "-git-version" | "--git-version")
+ printf '%b\n' "$SIMGRID_GITHASH"
+ exit 0
+ ;;
'-compiler-version' | '--compiler-version')
${F77} --version
;;
#! /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
@CMAKE_SMPI_COMMAND@
SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
+SIMGRID_GITHASH="@SIMGRID_GITHASH@"
DEFAULT_LOOPBACK_BANDWIDTH="498000000"
DEFAULT_LOOPBACK_LATENCY="0.000004"
-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]
printf '%b\n' "$SIMGRID_VERSION"
exit 0
;;
+
+ "-git-version" | "--git-version")
+ printf '%b\n' "$SIMGRID_GITHASH"
+ exit 0
+ ;;
"--cfg="*|"--log="*)
for OPT in ${1#*=}
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
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,
#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);
/** \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) {
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 */
};
! 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
! 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
! 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
! 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
! 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
! 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
! 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
! 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
! 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
! 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 ]
! 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
! 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.
-/* 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>
}
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);