From a8c4451c319a18cd8c5f17cda618cdc038516ec6 Mon Sep 17 00:00:00 2001 From: degomme Date: Sun, 4 Nov 2012 17:58:38 +0100 Subject: [PATCH 1/1] add a tesh file and test for two already existing tests, to improve coverage of smpi_bench.c from 15% to 68% --- buildtools/Cmake/AddTests.cmake | 5 +++-- teshsuite/smpi/compute.tesh | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 teshsuite/smpi/compute.tesh diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index 5b35bc6982..b640eed625 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -477,7 +477,7 @@ if(NOT enable_memcheck) ADD_TEST(smpi-indexed-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh) ADD_TEST(smpi-struct-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh) ADD_TEST(smpi-pt2pt-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh) - + ADD_TEST(smpi-compute-thread ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh) if(HAVE_RAWCTX) ADD_TEST(smpi-bcast-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh) @@ -487,6 +487,7 @@ if(NOT enable_memcheck) ADD_TEST(smpi-indexed-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh) ADD_TEST(smpi-struct-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh) ADD_TEST(smpi-pt2pt-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh) + ADD_TEST(smpi-compute-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh) ADD_TEST(NAME smpi-mpich-env-raw COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich-test/env ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/env/runtests -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/env -basedir=${CMAKE_BINARY_DIR}/smpi_script/ -fort=${SMPI_F2C}) ADD_TEST(NAME smpi-mpich-pt2pt-raw COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich-test/pt2pt ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/pt2pt/runtests @@ -509,7 +510,7 @@ if(NOT enable_memcheck) ADD_TEST(smpi-indexed-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh) ADD_TEST(smpi-struct-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh) ADD_TEST(smpi-pt2pt-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh) - + ADD_TEST(smpi-compute-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh) endif() if(HAVE_TRACING) ADD_TEST(smpi-tracing-ptp ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.tesh) diff --git a/teshsuite/smpi/compute.tesh b/teshsuite/smpi/compute.tesh new file mode 100644 index 0000000000..5bca9eed95 --- /dev/null +++ b/teshsuite/smpi/compute.tesh @@ -0,0 +1,29 @@ +p Test compute +! setenv LD_LIBRARY_PATH=../../lib +! output sort +$ ../../bin/smpirun -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 2 ./compute 0 +> 0 2.000000 +> 0 2.000000 +> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' + +p Test compute and bench +! setenv LD_LIBRARY_PATH=../../lib +! output sort +$ ../../bin/smpirun -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 2 ./compute3 +> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0] The result of the computation is: 65536.000000 +> [1] The result of the computation is: 2.000000 +> [rank:0] Run the first computation. It's globally benched, and I want no more than 3 benchmarks (thres<0) +> [rank:0] Run the first computation. It's globally benched, and I want no more than 3 benchmarks (thres<0) +> [rank:0] Run the first (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) +> [rank:0] Run the first (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) +> [rank:1] Run the first computation. It's globally benched, and I want no more than 3 benchmarks (thres<0) +> [rank:1] Run the first (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) +> [rank:1] Run the first (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) + -- 2.20.1