From: Martin Quinson Date: Wed, 26 Mar 2014 16:57:28 +0000 (+0100) Subject: integrate the testcase of #17132 into our testsuite X-Git-Tag: v3_11~189^2~23 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2591e519da64d744ad34e5ca2de5352eb4206b7b?ds=sidebyside integrate the testcase of #17132 into our testsuite --- diff --git a/.gitignore b/.gitignore index 6dc00ee2e1..5b889c15ac 100644 --- a/.gitignore +++ b/.gitignore @@ -254,6 +254,7 @@ examples/smpi/mc/bugged2 src/replay/replay src/testall +teshsuite/bug-17132/bug-17132 teshsuite/smpi/allgather_coll teshsuite/smpi/allgatherv_coll teshsuite/smpi/allreduce_coll diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index 03ad3a8a69..1881156098 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -444,6 +444,10 @@ if(NOT enable_memcheck) ADD_TEST(smpi-struct-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh) ADD_TEST(smpi-pt2pt-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh) ADD_TEST(smpi-compute-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh) + + # https://gforge.inria.fr/tracker/index.php?func=detail&aid=17132&group_id=12&atid=165 + ADD_TEST(smpi-bug-17132 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/bug-17132 ${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132.tesh) + if (NOT WIN32) ADD_TEST(smpi-shared-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared.tesh) endif() diff --git a/buildtools/Cmake/MakeExe.cmake b/buildtools/Cmake/MakeExe.cmake index a5a5819361..b9445e4573 100644 --- a/buildtools/Cmake/MakeExe.cmake +++ b/buildtools/Cmake/MakeExe.cmake @@ -90,6 +90,8 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132) + add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simix) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi) diff --git a/teshsuite/bug-17132/CMakeLists.txt b/teshsuite/bug-17132/CMakeLists.txt new file mode 100644 index 0000000000..e4c86f6c5d --- /dev/null +++ b/teshsuite/bug-17132/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 2.6) + +if(enable_smpi) + if(WIN32) + set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h") + else() + set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc") + endif() + + + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + + add_executable(bug-17132 ${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132/bug-17132.c) + target_link_libraries(bug-17132 simgrid) + + set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132.tesh + PARENT_SCOPE) + set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/small_platform.xml + PARENT_SCOPE) + set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132.c + PARENT_SCOPE) + set(bin_files + ${bin_files} + PARENT_SCOPE) + set(txt_files + ${txt_files} + ${CMAKE_CURRENT_SOURCE_DIR}/hostfile.txt + PARENT_SCOPE) + +endif(enable_smpi) diff --git a/teshsuite/bug-17132/README b/teshsuite/bug-17132/README new file mode 100644 index 0000000000..22e35b9bb3 --- /dev/null +++ b/teshsuite/bug-17132/README @@ -0,0 +1,8 @@ +This is the bug #17132 described on gforge [1]. This small SMPI code +triggers an issue in SURF, which is still to be debugged. + +The problem seems to be related to the order of events, as changing it +(with another platform or another message size or a MPI_barrier in +between) fixes the problem. + +[1] https://gforge.inria.fr/tracker/index.php?func=detail&aid=17132&group_id=12&atid=165 \ No newline at end of file diff --git a/teshsuite/bug-17132/bug-17132.c b/teshsuite/bug-17132/bug-17132.c new file mode 100644 index 0000000000..cecb3e4607 --- /dev/null +++ b/teshsuite/bug-17132/bug-17132.c @@ -0,0 +1,40 @@ +#include "xbt/log.h" +#include +#include + +XBT_LOG_NEW_DEFAULT_CATEGORY(MM_mpi, "Messages for this SMPI test"); + +int main(int argc, char ** argv) +{ + size_t err; + size_t M = 8*1024; + size_t N = 32*1024; + + MPI_Init(&argc, &argv); + + double *a = malloc(sizeof(double) * M); + double *b = malloc(sizeof(double) * N); + + // A broadcast + err = MPI_Bcast(a, M, MPI_DOUBLE, 0, MPI_COMM_WORLD); + if (err != MPI_SUCCESS) { + perror("Error Bcast A\n"); MPI_Finalize(); exit(-1); + } + +// Uncommenting this barrier fixes it! +// MPI_Barrier(MPI_COMM_WORLD); + + // Another broadcast + err = MPI_Bcast(b, N, MPI_DOUBLE, 0, MPI_COMM_WORLD ); + if (err != MPI_SUCCESS) { + perror("Error Bcast B\n"); MPI_Finalize(); exit(-1); + } + + // Commenting out this barrier fixes it!! + MPI_Barrier(MPI_COMM_WORLD); + + MPI_Finalize(); + free(a); + free(b); + return 0; +} diff --git a/teshsuite/bug-17132/bug-17132.tesh b/teshsuite/bug-17132/bug-17132.tesh new file mode 100644 index 0000000000..c886390b78 --- /dev/null +++ b/teshsuite/bug-17132/bug-17132.tesh @@ -0,0 +1,2 @@ +$ smpirun -np 16 -platform small_platform.xml -hostfile hostfile.txt ./bug-17132 +> (some sensible output) \ No newline at end of file diff --git a/teshsuite/bug-17132/hostfile.txt b/teshsuite/bug-17132/hostfile.txt new file mode 100644 index 0000000000..994b3e2cfc --- /dev/null +++ b/teshsuite/bug-17132/hostfile.txt @@ -0,0 +1,2 @@ +host1 +host2 diff --git a/teshsuite/bug-17132/small_platform.xml b/teshsuite/bug-17132/small_platform.xml new file mode 100644 index 0000000000..a2b420d810 --- /dev/null +++ b/teshsuite/bug-17132/small_platform.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +