From 8f573465f3fa5627942d49c8caba3d57955b4046 Mon Sep 17 00:00:00 2001 From: Marion Guthmuller Date: Tue, 3 Jun 2014 10:42:48 +0200 Subject: [PATCH] model-checker : new tesh examples about communications determinism verification --- buildtools/Cmake/AddTests.cmake | 4 +++ examples/smpi/mc/non_deterministic.c | 8 ++--- examples/smpi/mc/non_deterministic.tesh | 42 ++++++++++++++++++++++++ examples/smpi/mc/send_deterministic.c | 6 ++-- examples/smpi/mc/send_deterministic.tesh | 21 ++++++++++++ 5 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 examples/smpi/mc/non_deterministic.tesh create mode 100644 examples/smpi/mc/send_deterministic.tesh diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index f57e826fab..304dc051fb 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -445,6 +445,10 @@ IF(NOT enable_memcheck) ADD_TESH(smpi-tracing-ptp --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.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) + ENDIF() # END TESH TESTS ENDIF() diff --git a/examples/smpi/mc/non_deterministic.c b/examples/smpi/mc/non_deterministic.c index 4a0c7dc7c3..9df64c009b 100644 --- a/examples/smpi/mc/non_deterministic.c +++ b/examples/smpi/mc/non_deterministic.c @@ -32,20 +32,20 @@ int main(int argc, char **argv) } if (rank == 0) { - printf("MPI_ISend / MPI_IRecv Test \n"); + //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); + //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); + //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); + //printf("Message received from %d\n", recv_buff); } MPI_Finalize(); diff --git a/examples/smpi/mc/non_deterministic.tesh b/examples/smpi/mc/non_deterministic.tesh new file mode 100644 index 0000000000..f17c79f5e2 --- /dev/null +++ b/examples/smpi/mc/non_deterministic.tesh @@ -0,0 +1,42 @@ +#! ./tesh + +! timeout 60 +$ ../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile_non_deterministic -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check:1 --cfg=model-check/reduction:none --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thres:0 --cfg=smpi/running_power:1e9 ./non_deterministic +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check' to '1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/reduction' to 'none' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/communications_determinism' to '1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/send_is_detached_thres' to '0' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/running_power' to '1e9' +> [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] Get debug information ... +> [0.000000] [mc_global/INFO] Get debug information done ! +> [0.000000] [mc_comm_determinism/INFO] **************************************************** +> [0.000000] [mc_comm_determinism/INFO] ***** Non-deterministic communications pattern ***** +> [0.000000] [mc_comm_determinism/INFO] **************************************************** +> [0.000000] [mc_comm_determinism/INFO] Initial communications pattern: +> [0.000000] [mc_comm_determinism/INFO] [(1) c-1.me <- (2) c-2.me] iRecv +> [0.000000] [mc_comm_determinism/INFO] [(2) c-2.me -> (1) c-1.me] iSend +> [0.000000] [mc_comm_determinism/INFO] [(1) c-1.me -> (2) c-2.me] iSend +> [0.000000] [mc_comm_determinism/INFO] [(2) c-2.me <- (1) c-1.me] iRecv +> [0.000000] [mc_comm_determinism/INFO] [(1) c-1.me <- (3) c-3.me] iRecv +> [0.000000] [mc_comm_determinism/INFO] [(3) c-3.me -> (1) c-1.me] iSend +> [0.000000] [mc_comm_determinism/INFO] [(1) c-1.me -> (3) c-3.me] iSend +> [0.000000] [mc_comm_determinism/INFO] [(3) c-3.me <- (1) c-1.me] iRecv +> [0.000000] [mc_comm_determinism/INFO] Communications pattern counter-example: +> [0.000000] [mc_comm_determinism/INFO] [(1) c-1.me <- (3) c-3.me] iRecv +> [0.000000] [mc_comm_determinism/INFO] [(3) c-3.me -> (1) c-1.me] iSend +> [0.000000] [mc_comm_determinism/INFO] [(1) c-1.me -> (3) c-3.me] iSend +> [0.000000] [mc_comm_determinism/INFO] [(2) c-2.me -> (1) c-1.me] iSend +> [0.000000] [mc_comm_determinism/INFO] [(3) c-3.me <- (1) c-1.me] iRecv +> [0.000000] [mc_comm_determinism/INFO] [(1) c-1.me <- (2) c-2.me] iRecv +> [0.000000] [mc_comm_determinism/INFO] [(1) c-1.me -> (2) c-2.me] iSend +> [0.000000] [mc_comm_determinism/INFO] [(2) c-2.me <- (1) c-1.me] iRecv +> [0.000000] [mc_global/INFO] Expanded states = 16037 +> [0.000000] [mc_global/INFO] Visited states = 80801 +> [0.000000] [mc_global/INFO] Executed transitions = 76048 +> [0.000000] [mc_global/INFO] Communication-deterministic : No diff --git a/examples/smpi/mc/send_deterministic.c b/examples/smpi/mc/send_deterministic.c index 048d75c508..6406ce8365 100644 --- a/examples/smpi/mc/send_deterministic.c +++ b/examples/smpi/mc/send_deterministic.c @@ -32,16 +32,16 @@ int main(int argc, char **argv) } if (rank == 0) { - printf("MPI_ISend / MPI_IRecv Test \n"); + //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); + //printf("Message received from %d\n", recv_buff); } }else{ MPI_Send(&rank, 1, MPI_INT, 0, 42, MPI_COMM_WORLD); - printf("Sent %d to rank 0\n", rank); + //printf("Sent %d to rank 0\n", rank); } MPI_Finalize(); diff --git a/examples/smpi/mc/send_deterministic.tesh b/examples/smpi/mc/send_deterministic.tesh new file mode 100644 index 0000000000..8531c03ab6 --- /dev/null +++ b/examples/smpi/mc/send_deterministic.tesh @@ -0,0 +1,21 @@ +#! ./tesh + +! timeout 60 +$ ../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile_send_deterministic -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check:1 --cfg=model-check/reduction:none --cfg=model-check/send_determinism:1 --cfg=smpi/send_is_detached_thres:0 --cfg=smpi/running_power:1e9 ./send_deterministic +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-3' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check' to '1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/reduction' to 'none' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/send_determinism' to '1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/send_is_detached_thres' to '0' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/running_power' to '1e9' +> [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] Get debug information ... +> [0.000000] [mc_global/INFO] Get debug information done ! +> [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 -- 2.20.1