From a339a624022dea90c2f8a3e44b69563bec3c3b81 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Mon, 7 Mar 2016 20:30:40 +0100 Subject: [PATCH 1/1] simplify allredude tests --- .gitignore | 4 +- teshsuite/smpi/CMakeLists.txt | 21 +++-- teshsuite/smpi/allreduce/CMakeLists.txt | 25 ------ teshsuite/smpi/allreduce/allreduce.c | 85 ------------------- .../coll-allreduce-automatic.tesh} | 3 +- .../coll-allreduce-large.tesh} | 2 +- .../coll-allreduce.c} | 0 .../coll-allreduce.tesh} | 2 +- tools/cmake/DefinePackages.cmake | 1 - 9 files changed, 20 insertions(+), 123 deletions(-) delete mode 100644 teshsuite/smpi/allreduce/CMakeLists.txt delete mode 100644 teshsuite/smpi/allreduce/allreduce.c rename teshsuite/smpi/{allreduce/allreduce_coll_automatic.tesh => coll-allreduce/coll-allreduce-automatic.tesh} (98%) rename teshsuite/smpi/{allreduce/allreduce_coll_large.tesh => coll-allreduce/coll-allreduce-large.tesh} (93%) rename teshsuite/smpi/{allreduce/allreduce_coll.c => coll-allreduce/coll-allreduce.c} (100%) rename teshsuite/smpi/{allreduce/allreduce_coll.tesh => coll-allreduce/coll-allreduce.tesh} (98%) diff --git a/.gitignore b/.gitignore index 541308e5e7..85c4620fb4 100644 --- a/.gitignore +++ b/.gitignore @@ -315,9 +315,7 @@ teshsuite/simix/check_defaults/check_defaults teshsuite/simix/stack_overflow/stack_overflow teshsuite/smpi/coll-allgather/coll-allgather teshsuite/smpi/coll-allgatherv/coll-allgatherv -teshsuite/smpi/allreduce/allreduce -teshsuite/smpi/allreduce/allreduce_coll -teshsuite/smpi/allreduce_coll +teshsuite/smpi/coll-allreduce/coll-allreduce teshsuite/smpi/alltoall2 teshsuite/smpi/alltoall/alltoall2 teshsuite/smpi/alltoall/alltoall_basic diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index 1230f7837c..7a72474311 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -6,7 +6,7 @@ if(enable_smpi) endif() include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") - foreach(x coll-allgather coll-allgatherv coll-alltoallv coll-barrier coll-bcast coll-gather coll-scatter + foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoallv coll-barrier coll-bcast coll-gather coll-scatter pt2pt-dsend pt2pt-pingpong type-hvector type-indexed type-struct type-vector) add_executable (${x} ${x}/${x}.c) target_link_libraries(${x} simgrid) @@ -27,6 +27,11 @@ if(enable_smpi) ADD_TESH(tesh-smpi-coll-allgatherv-${ALLGATHERV_COLL} --cfg smpi/allgatherv:${ALLGATHERV_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allgatherv --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allgatherv coll-allgatherv.tesh) endforeach() + foreach (ALLREDUCE_COLL lr rab1 rab2 rab_rdb rdb smp_binomial smp_binomial_pipeline smp_rdb smp_rsag smp_rsag_lr impi + smp_rsag_rab redbcast ompi mpich ompi_ring_segmented mvapich2 mvapich2_rs mvapich2_two_level) + ADD_TESH(tesh-smpi-coll-allreduce-${ALLREDUCE_COLL} --cfg smpi/allreduce:${ALLREDUCE_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allreduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allreduce coll-allreduce.tesh) + endforeach() + foreach (ALLTOALLV_COLL pair pair_light_barrier pair_mpi_barrier pair_one_barrier ring ring_light_barrier ring_mpi_barrier ring_one_barrier bruck ompi mpich mvapich2 ompi_basic_linear impi) ADD_TESH(tesh-smpi-coll-alltoallv-${ALLTOALLV_COLL} --cfg smpi/alltoallv:${ALLTOALLV_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-alltoallv --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-alltoallv coll-alltoallv.tesh) @@ -52,13 +57,19 @@ if(enable_smpi) endforeach() endif() +# Extra allreduce test: large automatic +ADD_TESH(tesh-smpi-coll-allreduce-large --cfg smpi/allreduce:ompi_ring_segmented --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allreduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allreduce coll-allreduce-large.tesh) +ADD_TESH(tesh-smpi-coll-allreduce-automatic --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allreduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allreduce coll-allreduce-automatic.tesh) + # Extra pt2pt pingpong test: broken usage ti-tracing ADD_TESH_FACTORIES(tesh-smpi-broken "thread" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pt2pt-pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt-pingpong broken_hostfiles.tesh) ADD_TESH(tesh-smpi-replay-ti-tracing --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pt2pt-pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt-pingpong TI_output.tesh) -set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) -set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/broken_hostfiles.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/TI_output.tesh PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/coll-allreduce-large.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/coll-allreduce-automatic.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/broken_hostfiles.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/TI_output.tesh PARENT_SCOPE) set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/hostfile ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_coll - ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_empty PARENT_SCOPE) + ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_empty PARENT_SCOPE) diff --git a/teshsuite/smpi/allreduce/CMakeLists.txt b/teshsuite/smpi/allreduce/CMakeLists.txt deleted file mode 100644 index 257aaee049..0000000000 --- a/teshsuite/smpi/allreduce/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -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() - include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") - - add_executable (allreduce allreduce.c) - target_link_libraries(allreduce simgrid) - add_executable (allreduce_coll allreduce_coll.c) - target_link_libraries(allreduce_coll simgrid) -endif() - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll_large.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll_automatic.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/allreduce.c - ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll.c - PARENT_SCOPE) diff --git a/teshsuite/smpi/allreduce/allreduce.c b/teshsuite/smpi/allreduce/allreduce.c deleted file mode 100644 index a8044afdbc..0000000000 --- a/teshsuite/smpi/allreduce/allreduce.c +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (c) 2012, 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 -#include - -/** - * MESSAGE PASSING INTERFACE TEST CASE SUITE - * - * Copyright IBM Corp. 1995 - * - * IBM Corp. hereby grants a non-exclusive license to use, copy, modify, and - *distribute this software for any purpose and without fee provided that the - *above copyright notice and the following paragraphs appear in all copies. - - * IBM Corp. makes no representation that the test cases comprising this - * suite are correct or are an accurate representation of any standard. - - * In no event shall IBM be liable to any party for direct, indirect, special - * incidental, or consequential damage arising out of the use of this software - * even if IBM Corp. has been advised of the possibility of such damage. - - * IBM CORP. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS AND IBM - * CORP. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, - * ENHANCEMENTS, OR MODIFICATIONS. - * *************************************************************************** - **/ -static int ibm_test(int rank, int size) -{ - int success = 1; -#define MAXLEN 10000 - - int root = 0, i, j, k; - int out[MAXLEN]; - int in[MAXLEN]; - - for (j = 1; j <= MAXLEN; j *= 10) { - for (i = 0; i < j; i++) - out[i] = i; - - MPI_Allreduce(out, in, j, MPI_INT, MPI_SUM, MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); - - if (rank == root) { - for (k = 0; k < j; k++) { - if (in[k] != k * size) { - printf("bad answer (%d) at index %d of %d (should be %d)", in[k], - k, j, k * size); - success = 0; - break; - } - } - } - } - return (success); -} - - - - -int main(int argc, char **argv) -{ - int size, rank; - - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &size); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - - if (0 == rank) - printf("** IBM Test Result: ... \n"); - if (!ibm_test(rank, size)) - printf("\t[%d] failed.\n", rank); - else - printf("\t[%d] ok.\n", rank); - - MPI_Finalize(); - return 0; -} diff --git a/teshsuite/smpi/allreduce/allreduce_coll_automatic.tesh b/teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh similarity index 98% rename from teshsuite/smpi/allreduce/allreduce_coll_automatic.tesh rename to teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh index 0d77eb975a..923d2b4f13 100644 --- a/teshsuite/smpi/allreduce/allreduce_coll_automatic.tesh +++ b/teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh @@ -3,7 +3,7 @@ ! output sort 19 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 --log=smpi_coll.thres:error --cfg=smpi/allreduce:automatic --cfg=smpi/async_small_thresh:65536 --cfg=smpi/send_is_detached_thresh:128000 --cfg=smpi/running_power:-1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --cfg=smpi/allreduce:automatic --cfg=smpi/async_small_thresh:65536 --cfg=smpi/send_is_detached_thresh:128000 --cfg=smpi/running_power:-1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.420130] (5:4@Jupiter) The quickest allreduce was redbcast on rank 4 and took 0.007482 > [ 0.420130] (6:5@Jupiter) The quickest allreduce was redbcast on rank 5 and took 0.007513 > [ 0.420130] (7:6@Jupiter) The quickest allreduce was redbcast on rank 6 and took 0.007513 @@ -68,4 +68,3 @@ $ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform .. > [rank 7] -> Jupiter > [rank 8] -> Fafard > [rank 9] -> Fafard - diff --git a/teshsuite/smpi/allreduce/allreduce_coll_large.tesh b/teshsuite/smpi/coll-allreduce/coll-allreduce-large.tesh similarity index 93% rename from teshsuite/smpi/allreduce/allreduce_coll_large.tesh rename to teshsuite/smpi/coll-allreduce/coll-allreduce-large.tesh index d1d082ca04..f8775edd96 100644 --- a/teshsuite/smpi/allreduce/allreduce_coll_large.tesh +++ b/teshsuite/smpi/coll-allreduce/coll-allreduce-large.tesh @@ -4,7 +4,7 @@ ! timeout 20 p Test allreduce -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 --log=xbt_cfg.thres:critical ${bindir:=.}/allreduce_coll 300000 --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce 300000 --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard diff --git a/teshsuite/smpi/allreduce/allreduce_coll.c b/teshsuite/smpi/coll-allreduce/coll-allreduce.c similarity index 100% rename from teshsuite/smpi/allreduce/allreduce_coll.c rename to teshsuite/smpi/coll-allreduce/coll-allreduce.c diff --git a/teshsuite/smpi/allreduce/allreduce_coll.tesh b/teshsuite/smpi/coll-allreduce/coll-allreduce.tesh similarity index 98% rename from teshsuite/smpi/allreduce/allreduce_coll.tesh rename to teshsuite/smpi/coll-allreduce/coll-allreduce.tesh index a38926d457..25e3402589 100644 --- a/teshsuite/smpi/allreduce/allreduce_coll.tesh +++ b/teshsuite/smpi/coll-allreduce/coll-allreduce.tesh @@ -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 --log=smpi_coll.thres:error +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error > [rank 0] -> Tremblay > [rank 1] -> Tremblay > [rank 2] -> Tremblay diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index b8213d5988..f8b0ec3588 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -1016,7 +1016,6 @@ set(CMAKEFILES_TXT teshsuite/simix/stack_overflow/CMakeLists.txt teshsuite/smpi/CMakeLists.txt - teshsuite/smpi/allreduce/CMakeLists.txt teshsuite/smpi/alltoall/CMakeLists.txt teshsuite/smpi/compute/CMakeLists.txt teshsuite/smpi/reduce/CMakeLists.txt -- 2.20.1