From 877c773a694a049fc8b926ac126ad776ab257f3d Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Mon, 7 Mar 2016 22:13:00 +0100 Subject: [PATCH] split and simplify reduce and reduce-scatter --- .gitignore | 7 +- teshsuite/smpi/CMakeLists.txt | 64 +++++---- .../coll-reduce-scatter.c} | 24 ++-- .../coll-reduce-scatter.tesh} | 2 +- .../coll-reduce.c} | 9 +- .../coll-reduce.tesh} | 2 +- teshsuite/smpi/reduce/CMakeLists.txt | 28 ---- teshsuite/smpi/reduce/reduce.c | 130 ------------------ teshsuite/smpi/reduce/reduce.tesh | 82 ----------- teshsuite/smpi/type-hvector/type-hvector.c | 1 - tools/cmake/DefinePackages.cmake | 1 - tools/cmake/Tests.cmake | 7 - 12 files changed, 55 insertions(+), 302 deletions(-) rename teshsuite/smpi/{reduce/reduce_scatter_coll.c => coll-reduce-scatter/coll-reduce-scatter.c} (79%) rename teshsuite/smpi/{reduce/reduce_scatter_coll.tesh => coll-reduce-scatter/coll-reduce-scatter.tesh} (82%) rename teshsuite/smpi/{reduce/reduce_coll.c => coll-reduce/coll-reduce.c} (99%) rename teshsuite/smpi/{reduce/reduce_coll.tesh => coll-reduce/coll-reduce.tesh} (97%) delete mode 100644 teshsuite/smpi/reduce/CMakeLists.txt delete mode 100644 teshsuite/smpi/reduce/reduce.c delete mode 100644 teshsuite/smpi/reduce/reduce.tesh diff --git a/.gitignore b/.gitignore index 3b0eef8345..6a6cfb79c7 100644 --- a/.gitignore +++ b/.gitignore @@ -984,11 +984,8 @@ teshsuite/smpi/mpich-test/pt2pt/waitany teshsuite/smpi/mpich-test/*/*.stdo teshsuite/smpi/pt2pt-dsend/pt2pt-dsend teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong -teshsuite/smpi/reduce_coll -teshsuite/smpi/reduce/reduce -teshsuite/smpi/reduce/reduce_coll -teshsuite/smpi/reduce/reduce_scatter_coll -teshsuite/smpi/reduce_scatter_coll +teshsuite/smpi/coll-reduce/coll-reduce +teshsuite/smpi/coll-reduce-scatter/coll-reduce-scatter teshsuite/smpi/coll-scatter/coll-scatter teshsuite/smpi/shared/shared teshsuite/smpi/smpi_sendrecv diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index 1e37e2b064..3b0ba5ff79 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -7,7 +7,8 @@ if(enable_smpi) include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast - coll-gather coll-scatter pt2pt-dsend pt2pt-pingpong type-hvector type-indexed type-struct type-vector) + coll-gather coll-reduce coll-reduce-scatter 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) set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) @@ -18,48 +19,57 @@ if(enable_smpi) ADD_TESH_FACTORIES(tesh-smpi-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/${x} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/${x} ${x}.tesh) endforeach() - foreach (ALLGATHER_COLL 2dmesh 3dmesh bruck GB loosely_lr NTSLR_NB pair rdb rhv ring SMP_NTS smp_simple - spreading_simple ompi mpich ompi_neighborexchange mvapich2 mvapich2_smp impi) - ADD_TESH(tesh-smpi-coll-allgather-${ALLGATHER_COLL} --cfg smpi/allgather:${ALLGATHER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allgather --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allgather coll-allgather.tesh) + foreach (ALLGATHER 2dmesh 3dmesh bruck GB loosely_lr NTSLR_NB pair rdb rhv ring SMP_NTS smp_simple spreading_simple + ompi mpich ompi_neighborexchange mvapich2 mvapich2_smp impi) + ADD_TESH(tesh-smpi-coll-allgather-${ALLGATHER} --cfg smpi/allgather:${ALLGATHER} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allgather --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allgather coll-allgather.tesh) endforeach() - foreach (ALLGATHERV_COLL GB pair ring ompi mpich ompi_neighborexchange ompi_bruck mpich_rdb mpich_ring mvapich2 impi) - 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) + foreach (ALLGATHERV GB pair ring ompi mpich ompi_neighborexchange ompi_bruck mpich_rdb mpich_ring mvapich2 impi) + ADD_TESH(tesh-smpi-coll-allgatherv-${ALLGATHERV} --cfg smpi/allgatherv:${ALLGATHERV} --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) + foreach (ALLREDUCE 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} --cfg smpi/allreduce:${ALLREDUCE} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allreduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allreduce coll-allreduce.tesh) endforeach() - foreach (ALLTOALL_COLL 2dmesh 3dmesh pair pair_rma pair_one_barrier pair_light_barrier pair_mpi_barrier rdb ring - ring_light_barrier ring_mpi_barrier ring_one_barrier bruck basic_linear ompi mpich mvapich2 - mvapich2_scatter_dest impi) - ADD_TESH(tesh-smpi-coll-alltoall-${ALLTOALL_COLL} --cfg smpi/alltoall:${ALLTOALL_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-alltoall --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-alltoall coll-alltoall.tesh) + foreach (ALLTOALL 2dmesh 3dmesh pair pair_rma pair_one_barrier pair_light_barrier pair_mpi_barrier rdb ring + ring_light_barrier ring_mpi_barrier ring_one_barrier bruck basic_linear ompi mpich mvapich2 + mvapich2_scatter_dest impi) + ADD_TESH(tesh-smpi-coll-alltoall-${ALLTOALL} --cfg smpi/alltoall:${ALLTOALL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-alltoall --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-alltoall coll-alltoall.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) + foreach (ALLTOALLV 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} --cfg smpi/alltoallv:${ALLTOALLV} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-alltoallv --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-alltoallv coll-alltoallv.tesh) endforeach() - foreach (BARRIER_COLL ompi mpich ompi_basic_linear ompi_tree ompi_bruck ompi_recursivedoubling ompi_doublering mvapich2_pair mvapich2 impi) - ADD_TESH(tesh-smpi-coll-barrier-${BARRIER_COLL} --cfg smpi/barrier:${BARRIER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-barrier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-barrier coll-barrier.tesh) + foreach (BARRIER ompi mpich ompi_basic_linear ompi_tree ompi_bruck ompi_recursivedoubling ompi_doublering mvapich2_pair mvapich2 impi) + ADD_TESH(tesh-smpi-coll-barrier-${BARRIER} --cfg smpi/barrier:${BARRIER} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-barrier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-barrier coll-barrier.tesh) endforeach() - foreach (BCAST_COLL arrival_pattern_aware arrival_pattern_aware_wait arrival_scatter binomial_tree flattree - flattree_pipeline NTSB NTSL NTSL_Isend scatter_LR_allgather scatter_rdb_allgather SMP_binary - SMP_binomial SMP_linear ompi mpich ompi_split_bintree ompi_pipeline mvapich2 mvapich2_intra_node - mvapich2_knomial_intra_node impi) - ADD_TESH(tesh-smpi-coll-bcast-${BCAST_COLL} --cfg smpi/bcast:${BCAST_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-bcast --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-bcast coll-bcast.tesh) + foreach (BCAST arrival_pattern_aware arrival_pattern_aware_wait arrival_scatter binomial_tree flattree + flattree_pipeline NTSB NTSL NTSL_Isend scatter_LR_allgather scatter_rdb_allgather SMP_binary + SMP_binomial SMP_linear ompi mpich ompi_split_bintree ompi_pipeline mvapich2 mvapich2_intra_node + mvapich2_knomial_intra_node impi) + ADD_TESH(tesh-smpi-coll-bcast-${BCAST} --cfg smpi/bcast:${BCAST} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-bcast --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-bcast coll-bcast.tesh) endforeach() - foreach (GATHER_COLL ompi mpich ompi_basic_linear ompi_linear_sync ompi_binomial mvapich2 mvapich2_two_level impi) - ADD_TESH(tesh-smpi-coll-gather-${GATHER_COLL} --cfg smpi/gather:${GATHER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-gather --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-gather coll-gather.tesh) + foreach (GATHER ompi mpich ompi_basic_linear ompi_linear_sync ompi_binomial mvapich2 mvapich2_two_level impi) + ADD_TESH(tesh-smpi-coll-gather-${GATHER} --cfg smpi/gather:${GATHER} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-gather --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-gather coll-gather.tesh) endforeach() - foreach (SCATTER_COLL ompi mpich ompi_basic_linear ompi_binomial mvapich2 mvapich2_two_level_binomial mvapich2_two_level_direct impi) - ADD_TESH(tesh-smpi-coll-scatter-${SCATTER_COLL} --cfg smpi/scatter:${SCATTER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-scatter --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-scatter coll-scatter.tesh) + foreach (REDUCE arrival_pattern_aware binomial flat_tree NTSL scatter_gather ompi mpich ompi_chain ompi_binary impi + ompi_basic_linear ompi_binomial ompi_in_order_binary mvapich2 mvapich2_knomial mvapich2_two_level rab) + ADD_TESH(tesh-smpi-coll-reduce-${REDUCE} --cfg smpi/reduce:${REDUCE} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-reduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-reduce coll-reduce.tesh) + endforeach() + + foreach (REDUCE_SCATTER ompi mpich ompi_basic_recursivehalving ompi_ring mpich_noncomm mpich_pair mvapich2 mpich_rdb impi) + ADD_TESH(tesh-smpi-coll-reduce-scatter-${REDUCE_SCATTER} --cfg smpi/reduce_scatter:${REDUCE_SCATTER} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-reduce-scatter --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-reduce-scatter coll-reduce-scatter.tesh) + endforeach() + + foreach (SCATTER ompi mpich ompi_basic_linear ompi_binomial mvapich2 mvapich2_two_level_binomial mvapich2_two_level_direct impi) + ADD_TESH(tesh-smpi-coll-scatter-${SCATTER} --cfg smpi/scatter:${SCATTER} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-scatter --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-scatter coll-scatter.tesh) endforeach() endif() diff --git a/teshsuite/smpi/reduce/reduce_scatter_coll.c b/teshsuite/smpi/coll-reduce-scatter/coll-reduce-scatter.c similarity index 79% rename from teshsuite/smpi/reduce/reduce_scatter_coll.c rename to teshsuite/smpi/coll-reduce-scatter/coll-reduce-scatter.c index 0df0d9c961..3bf3d91930 100644 --- a/teshsuite/smpi/reduce/reduce_scatter_coll.c +++ b/teshsuite/smpi/coll-reduce-scatter/coll-reduce-scatter.c @@ -6,10 +6,7 @@ /* * Test of reduce scatter. - * - * Each processor contributes its rank + the index to the reduction, - * then receives the ith sum - * + * Each processor contributes its rank + the index to the reduction, then receives the ith sum * Can be called with any number of processors. */ @@ -24,7 +21,6 @@ int main( int argc, char **argv ) int size, rank, i, sumval; MPI_Comm comm; - MPI_Init( &argc, &argv ); comm = MPI_COMM_WORLD; @@ -32,29 +28,29 @@ int main( int argc, char **argv ) MPI_Comm_rank( comm, &rank ); sendbuf = (int *) malloc( size * sizeof(int) ); for (i=0; i No Errors > [rank 0] -> Tremblay > [rank 10] -> Fafard diff --git a/teshsuite/smpi/reduce/reduce_coll.c b/teshsuite/smpi/coll-reduce/coll-reduce.c similarity index 99% rename from teshsuite/smpi/reduce/reduce_coll.c rename to teshsuite/smpi/coll-reduce/coll-reduce.c index 7acc93d99f..9b63466624 100644 --- a/teshsuite/smpi/reduce/reduce_coll.c +++ b/teshsuite/smpi/coll-reduce/coll-reduce.c @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) sb = (int *) xbt_malloc(size * sizeof(int)); rb = (int *) xbt_malloc(size * sizeof(int)); - + for (i = 0; i < size; ++i) { sb[i] = rank*size + i; rb[i] = 0; @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) for (i = 0; i < size; i++) printf("%d ", sb[i]); printf("]\n"); - + int root=0; status = MPI_Reduce(sb, rb, size, MPI_INT, MPI_SUM, root, MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD); @@ -53,13 +53,12 @@ int main(int argc, char *argv[]) fflush(stdout); } } - - + printf("[%d] second sndbuf=[", rank); for (i = 0; i < 1; i++) printf("%d ", sb[i]); printf("]\n"); - + root=size-1; status = MPI_Reduce(sb, rb, 1, MPI_INT, MPI_PROD, root, MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD); diff --git a/teshsuite/smpi/reduce/reduce_coll.tesh b/teshsuite/smpi/coll-reduce/coll-reduce.tesh similarity index 97% rename from teshsuite/smpi/reduce/reduce_coll.tesh rename to teshsuite/smpi/coll-reduce/coll-reduce.tesh index 203c9f620d..c9fa212cfd 100644 --- a/teshsuite/smpi/reduce/reduce_coll.tesh +++ b/teshsuite/smpi/coll-reduce/coll-reduce.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:=.}/reduce_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-reduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error > [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ] > [0] second sndbuf=[0 ] > [0] sndbuf=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ] diff --git a/teshsuite/smpi/reduce/CMakeLists.txt b/teshsuite/smpi/reduce/CMakeLists.txt deleted file mode 100644 index af3df4d5e7..0000000000 --- a/teshsuite/smpi/reduce/CMakeLists.txt +++ /dev/null @@ -1,28 +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 (reduce reduce.c) - target_link_libraries(reduce simgrid) - add_executable (reduce_coll reduce_coll.c) - target_link_libraries(reduce_coll simgrid) - add_executable (reduce_scatter_coll reduce_scatter_coll.c) - target_link_libraries(reduce_scatter_coll simgrid) -endif() - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/reduce.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/reduce_coll.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter_coll.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/reduce.c - ${CMAKE_CURRENT_SOURCE_DIR}/reduce_coll.c - ${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter_coll.c - PARENT_SCOPE) diff --git a/teshsuite/smpi/reduce/reduce.c b/teshsuite/smpi/reduce/reduce.c deleted file mode 100644 index 09671e6781..0000000000 --- a/teshsuite/smpi/reduce/reduce.c +++ /dev/null @@ -1,130 +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, i, j, k; - int out[MAXLEN]; - int in[MAXLEN]; - root = size / 2; - - for (j = 1; j <= MAXLEN; j *= 10) { - for (i = 0; i < j; i++) - out[i] = i; - - MPI_Reduce(out, in, j, MPI_INT, MPI_SUM, root, 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; - int root = 0; - int value; - int sum = -99, sum_mirror = -99, min = 999, max = -999; - - double start_timer; - int quiet = 0; - - - MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD, &size); - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - if (argc > 1 && !strcmp(argv[1], "-q")) - quiet = 1; - - start_timer = MPI_Wtime(); - - value = rank + 1; /* easy to verify that sum= (size*(size+1))/2; */ - - //printf("[%d] has value %d\n", rank, value); - MPI_Reduce(&value, &sum, 1, MPI_INT, MPI_SUM, root, MPI_COMM_WORLD); - MPI_Reduce(&value, &sum_mirror, 1, MPI_INT, MPI_SUM, root, - MPI_COMM_WORLD); - - MPI_Reduce(&value, &min, 1, MPI_INT, MPI_MIN, root, MPI_COMM_WORLD); - MPI_Reduce(&value, &max, 1, MPI_INT, MPI_MAX, root, MPI_COMM_WORLD); - if (rank == root) { - printf("** Scalar Int Test Result:\n"); - printf("\t[%d] sum=%d ... validation ", rank, sum); - if (((size * (size + 1)) / 2 == sum) && (sum_mirror == sum)) - printf("ok.\n"); - else - printf("failed (sum=%d,sum_mirror=%d while both sould be %d.\n", - sum, sum_mirror, (size * (size + 1)) / 2); - printf("\t[%d] min=%d ... validation ", rank, min); - if (1 == min) - printf("ok.\n"); - else - printf("failed.\n"); - printf("\t[%d] max=%d ... validation ", rank, max); - if (size == max) - printf("ok.\n"); - else - printf("failed.\n"); - if (!quiet) - printf("Elapsed time=%f s\n", MPI_Wtime() - start_timer); - } - - MPI_Barrier(MPI_COMM_WORLD); - - if (0 == rank) - printf("** IBM Test Result: ...\n"); - if (!ibm_test(rank, size)) - printf("\t[%d] failed.\n", rank); - else if (!quiet) - printf("\t[%d] ok.\n", rank); - else - printf("\tok.\n"); - - MPI_Finalize(); - return 0; -} diff --git a/teshsuite/smpi/reduce/reduce.tesh b/teshsuite/smpi/reduce/reduce.tesh deleted file mode 100644 index 1bd2449973..0000000000 --- a/teshsuite/smpi/reduce/reduce.tesh +++ /dev/null @@ -1,82 +0,0 @@ -# use the tested library, not the installed one -# (since we want to pass it to the child, it has to be redefined before each command) -# Go for the first test -p Test Reduce with 3 processes -! output sort -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 3 ${bindir:=.}/reduce -q --log=smpi_kernel.thres:warning -> [rank 0] -> Tremblay -> [rank 1] -> Tremblay -> [rank 2] -> Tremblay -> [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' -> ** Scalar Int Test Result: -> [0] sum=6 ... validation ok. -> [0] min=1 ... validation ok. -> [0] max=3 ... validation ok. -> ** IBM Test Result: ... -> ok. -> ok. -> ok. - -# second test -! setenv LD_LIBRARY_PATH=../../lib -! output sort -p Test Reduce with 5 processes -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 5 ${bindir:=.}/reduce -q --log=smpi_kernel.thres:warning -> [rank 0] -> Tremblay -> [rank 1] -> Tremblay -> [rank 2] -> Tremblay -> [rank 3] -> Tremblay -> [rank 4] -> Jupiter -> [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' -> ** Scalar Int Test Result: -> [0] sum=15 ... validation ok. -> [0] min=1 ... validation ok. -> [0] max=5 ... validation ok. -> ** IBM Test Result: ... -> ok. -> ok. -> ok. -> ok. -> ok. - -# third test -! output sort -! setenv LD_LIBRARY_PATH=../../lib -p Test Reduce with 12 processes -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 12 ${bindir:=.}/reduce -q --log=smpi_kernel.thres:warning -> [rank 0] -> Tremblay -> [rank 1] -> Tremblay -> [rank 2] -> Tremblay -> [rank 3] -> Tremblay -> [rank 4] -> Jupiter -> [rank 5] -> Jupiter -> [rank 6] -> Jupiter -> [rank 7] -> Jupiter -> [rank 8] -> Fafard -> [rank 9] -> Fafard -> [rank 10] -> Fafard -> [rank 11] -> Fafard -> [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' -> ** Scalar Int Test Result: -> [0] sum=78 ... validation ok. -> [0] min=1 ... validation ok. -> [0] max=12 ... validation ok. -> ** IBM Test Result: ... -> ok. -> ok. -> ok. -> ok. -> ok. -> ok. -> ok. -> ok. -> ok. -> ok. -> ok. -> ok. diff --git a/teshsuite/smpi/type-hvector/type-hvector.c b/teshsuite/smpi/type-hvector/type-hvector.c index ef277acbd0..14f7ae39cc 100644 --- a/teshsuite/smpi/type-hvector/type-hvector.c +++ b/teshsuite/smpi/type-hvector/type-hvector.c @@ -20,7 +20,6 @@ int main(int argc, char **argv) { MPI_Type_hvector(SIZE, 1, SIZE*sizeof(double), MPI_DOUBLE, &columntype); MPI_Type_commit(&columntype); - if (rank == 0) { for(i=0; i