From: Frederic Suter Date: Sat, 5 Mar 2016 18:11:45 +0000 (+0100) Subject: further refactoring X-Git-Tag: v3_13~545 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e791988d14b020b847a39f72da8062fea90bb3b5?hp=74920886a66007492e0aa59e7d40b733f7b06793 further refactoring --- diff --git a/.gitignore b/.gitignore index b4eb31069c..4d73089b92 100644 --- a/.gitignore +++ b/.gitignore @@ -314,8 +314,7 @@ teshsuite/simdag/platforms/is_router_test teshsuite/simix/check_defaults/check_defaults teshsuite/simix/stack_overflow/stack_overflow teshsuite/smpi/coll-allgather/coll-allgather -teshsuite/smpi/allgatherv/allgatherv_coll -teshsuite/smpi/allgatherv_coll +teshsuite/smpi/coll-allgatherv/coll-allgatherv teshsuite/smpi/allreduce/allreduce teshsuite/smpi/allreduce/allreduce_coll teshsuite/smpi/allreduce_coll @@ -325,18 +324,14 @@ teshsuite/smpi/alltoall/alltoall_basic teshsuite/smpi/alltoall/alltoall_coll teshsuite/smpi/alltoall_basic teshsuite/smpi/alltoall_coll -teshsuite/smpi/alltoallv/alltoallv -teshsuite/smpi/alltoallv/alltoallv_coll -teshsuite/smpi/alltoallv_coll -teshsuite/smpi/barrier/barrier_coll -teshsuite/smpi/barrier_coll +teshsuite/smpi/coll-alltoallv/coll-alltoallv teshsuite/smpi/coll-bcast/coll-bcast +teshsuite/smpi/coll-barrier/coll-barrier +teshsuite/smpi/coll-gather/coll-gather teshsuite/smpi/compute/compute teshsuite/smpi/compute/compute2 teshsuite/smpi/compute/compute3 teshsuite/smpi/dsend -teshsuite/smpi/gather_coll -teshsuite/smpi/gather/gather_coll teshsuite/smpi/type-hvector/type-hvector teshsuite/smpi/type-indexed/type-indexed teshsuite/smpi/isp/umpire/abort @@ -1001,7 +996,7 @@ teshsuite/smpi/reduce/reduce teshsuite/smpi/reduce/reduce_coll teshsuite/smpi/reduce/reduce_scatter_coll teshsuite/smpi/reduce_scatter_coll -teshsuite/smpi/scatter/scatter +teshsuite/smpi/coll-scatter/coll-scatter teshsuite/smpi/shared/shared teshsuite/smpi/smpi_sendrecv teshsuite/smpi/split @@ -1014,8 +1009,7 @@ teshsuite/surf/surf_usage/surf_usage teshsuite/surf/surf_usage/surf_usage2 teshsuite/surf/trace_usage/trace_usage teshsuite/xbt/heap_bench/heap_bench -teshsuite/xbt/log_large/log_large_test -teshsuite/xbt/log_large_test +teshsuite/xbt/log_large/log_large teshsuite/xbt/log_usage/log_usage teshsuite/xbt/mallocator/mallocator teshsuite/xbt/mmalloc/mmalloc_test diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index 530c91ad7c..2aac6d1c99 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -6,7 +6,8 @@ if(enable_smpi) endif() include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi") - foreach(x coll-allgather coll-bcast type-hvector type-indexed type-struct type-vector) + foreach(x coll-allgather coll-allgatherv coll-alltoallv coll-barrier coll-bcast coll-gather coll-scatter + 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}) @@ -22,15 +23,37 @@ if(enable_smpi) 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) 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) + 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) + 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) + 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) 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) + 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) + endforeach() endif() -set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/hostfile - ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_coll PARENT_SCOPE) + +set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/hostfile + ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_coll PARENT_SCOPE) set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) set(tesh_files ${tesh_files} PARENT_SCOPE) diff --git a/teshsuite/smpi/allgatherv/CMakeLists.txt b/teshsuite/smpi/allgatherv/CMakeLists.txt deleted file mode 100644 index e5f1e63cf1..0000000000 --- a/teshsuite/smpi/allgatherv/CMakeLists.txt +++ /dev/null @@ -1,21 +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 (allgatherv_coll allgatherv_coll.c) - target_link_libraries(allgatherv_coll simgrid) -endif() - - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.c - PARENT_SCOPE) diff --git a/teshsuite/smpi/alltoallv/CMakeLists.txt b/teshsuite/smpi/alltoallv/CMakeLists.txt deleted file mode 100644 index 513de644a4..0000000000 --- a/teshsuite/smpi/alltoallv/CMakeLists.txt +++ /dev/null @@ -1,21 +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 (alltoallv_coll alltoallv_coll.c) - target_link_libraries(alltoallv_coll simgrid) -endif() - - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.c - PARENT_SCOPE) diff --git a/teshsuite/smpi/barrier/CMakeLists.txt b/teshsuite/smpi/barrier/CMakeLists.txt deleted file mode 100644 index fffb3adb83..0000000000 --- a/teshsuite/smpi/barrier/CMakeLists.txt +++ /dev/null @@ -1,20 +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 (barrier_coll barrier.c) - target_link_libraries(barrier_coll simgrid) -endif() - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/barrier_coll.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/barrier.c - PARENT_SCOPE) diff --git a/teshsuite/smpi/allgatherv/allgatherv_coll.c b/teshsuite/smpi/coll-allgatherv/coll-allgatherv.c similarity index 92% rename from teshsuite/smpi/allgatherv/allgatherv_coll.c rename to teshsuite/smpi/coll-allgatherv/coll-allgatherv.c index d5ffa8d9d9..97ef03e142 100644 --- a/teshsuite/smpi/allgatherv/allgatherv_coll.c +++ b/teshsuite/smpi/coll-allgatherv/coll-allgatherv.c @@ -17,12 +17,9 @@ int main(int argc, char *argv[]) { - int rank, size; - int i; - int *sb; - int *rb; - int *recv_counts; - int *recv_disps; + int i,rank, size; + int *sb, *rb; + int *recv_counts, *recv_disps; int recv_sb_size; int status; @@ -32,11 +29,11 @@ int main(int argc, char *argv[]) recv_counts = (int *) xbt_malloc(size * sizeof(int)); recv_disps = (int *) xbt_malloc(size * sizeof(int)); - + recv_sb_size = 0; for (i = 0; i < size; i++) { recv_counts[i] = i + 1; - recv_disps[i] = recv_sb_size; + recv_disps[i] = recv_sb_size; recv_sb_size += i + 1; } @@ -60,7 +57,6 @@ int main(int argc, char *argv[]) printf("%d ", rb[i]); printf("]\n"); - if (rank == 0) { if (status != MPI_SUCCESS) { printf("allgatherv returned %d\n", status); diff --git a/teshsuite/smpi/allgatherv/allgatherv_coll.tesh b/teshsuite/smpi/coll-allgatherv/coll-allgatherv.tesh similarity index 99% rename from teshsuite/smpi/allgatherv/allgatherv_coll.tesh rename to teshsuite/smpi/coll-allgatherv/coll-allgatherv.tesh index 606597bedd..ef8c66438b 100644 --- a/teshsuite/smpi/allgatherv/allgatherv_coll.tesh +++ b/teshsuite/smpi/coll-allgatherv/coll-allgatherv.tesh @@ -3,7 +3,7 @@ ! output sort p Test allgatherv -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/allgatherv_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-allgatherv --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error > [rank 0] -> Tremblay > [rank 1] -> Tremblay > [rank 2] -> Tremblay diff --git a/teshsuite/smpi/alltoallv/alltoallv_coll.c b/teshsuite/smpi/coll-alltoallv/coll-alltoallv.c similarity index 86% rename from teshsuite/smpi/alltoallv/alltoallv_coll.c rename to teshsuite/smpi/coll-alltoallv/coll-alltoallv.c index 6a2c169e76..23a3939d9e 100644 --- a/teshsuite/smpi/alltoallv/alltoallv_coll.c +++ b/teshsuite/smpi/coll-alltoallv/coll-alltoallv.c @@ -9,27 +9,17 @@ * See COPYRIGHT in top-level directory. */ #include - #include #include #include "mpi.h" -/* - This program tests MPI_Alltoallv by having processor i send different - amounts of data to each processor. - - Because there are separate send and receive types to alltoallv, - there need to be tests to rearrange data on the fly. Not done yet. +/* This program tests MPI_Alltoallv by having processor i send different amounts of data to each processor. + TODO As there are separate send and receive types to alltoallv, there need to be tests to rearrange data on the fly. The first test sends i items to processor i from all processors. + Currently, the test uses only MPI_INT; this is adequate for testing systems that use point-to-point operations - Currently, the test uses only MPI_INT; this is adequate for testing systems - that use point-to-point operations - */ - - -/* example values: - * For 3 processes: + Example values for 3 processes: * <0> sbuf: (#9): [0][1][2][3][4][5][6][7][8] <0> scount: (#3): [0][1][2] <0> rcount: (#3): [0][0][0] @@ -54,7 +44,6 @@ <2> rbuf: (#9): [3][4][103][104][203][204][-1][-1][-1] */ - static void print_buffer_int(void *buf, int len, char *msg, int rank) { int tmp, *v; @@ -70,12 +59,10 @@ static void print_buffer_int(void *buf, int len, char *msg, int rank) int main(int argc, char **argv) { - MPI_Comm comm; int *sbuf, *rbuf; - int rank, size; + int i,rank, size; int *sendcounts, *recvcounts, *rdispls, *sdispls; - int i; MPI_Init(&argc, &argv); @@ -104,15 +91,14 @@ int main(int argc, char **argv) rdispls[i] = i * rank; sdispls[i] = (i * (i + 1)) / 2; } - + print_buffer_int( sbuf, size*size, strdup("sbuf:"),rank); print_buffer_int( sendcounts, size, strdup("scount:"),rank); print_buffer_int( recvcounts, size, strdup("rcount:"),rank); print_buffer_int( sdispls, size, strdup("sdisp:"),rank); print_buffer_int( rdispls, size, strdup("rdisp:"),rank); - - MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, - rbuf, recvcounts, rdispls, MPI_INT, comm); + + MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, rbuf, recvcounts, rdispls, MPI_INT, comm); print_buffer_int( rbuf, size*size, strdup("rbuf:"),rank); diff --git a/teshsuite/smpi/alltoallv/alltoallv_coll.tesh b/teshsuite/smpi/coll-alltoallv/coll-alltoallv.tesh similarity index 99% rename from teshsuite/smpi/alltoallv/alltoallv_coll.tesh rename to teshsuite/smpi/coll-alltoallv/coll-alltoallv.tesh index 467d7551dd..eee1a2666c 100644 --- a/teshsuite/smpi/alltoallv/alltoallv_coll.tesh +++ b/teshsuite/smpi/coll-alltoallv/coll-alltoallv.tesh @@ -3,7 +3,7 @@ ! output sort p Test all to all -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/alltoallv_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-alltoallv --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error > [rank 0] -> Tremblay > [rank 1] -> Tremblay > [rank 2] -> Tremblay diff --git a/teshsuite/smpi/barrier/barrier.c b/teshsuite/smpi/coll-barrier/coll-barrier.c similarity index 80% rename from teshsuite/smpi/barrier/barrier.c rename to teshsuite/smpi/coll-barrier/coll-barrier.c index 5c87292dfb..8e8386e3ef 100644 --- a/teshsuite/smpi/barrier/barrier.c +++ b/teshsuite/smpi/coll-barrier/coll-barrier.c @@ -7,24 +7,18 @@ #include #include - int main(int argc, char **argv) { int size, rank; - //double start_timer; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); - //start_timer = MPI_Wtime(); - MPI_Barrier(MPI_COMM_WORLD); - MPI_Barrier(MPI_COMM_WORLD); if (0 == rank) { printf("... Barrier ....\n"); - //printf("Elapsed=%f s\n", MPI_Wtime() - start_timer); } MPI_Finalize(); diff --git a/teshsuite/smpi/barrier/barrier_coll.tesh b/teshsuite/smpi/coll-barrier/coll-barrier.tesh similarity index 91% rename from teshsuite/smpi/barrier/barrier_coll.tesh rename to teshsuite/smpi/coll-barrier/coll-barrier.tesh index 1e4456c675..04cec90785 100644 --- a/teshsuite/smpi/barrier/barrier_coll.tesh +++ b/teshsuite/smpi/coll-barrier/coll-barrier.tesh @@ -3,7 +3,7 @@ ! output sort p Test barrier -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/barrier_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-barrier --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error > ... Barrier .... > [rank 0] -> Tremblay > [rank 1] -> Tremblay diff --git a/teshsuite/smpi/gather/gather_coll.c b/teshsuite/smpi/coll-gather/coll-gather.c similarity index 88% rename from teshsuite/smpi/gather/gather_coll.c rename to teshsuite/smpi/coll-gather/coll-gather.c index feed6360a1..52e0068e68 100644 --- a/teshsuite/smpi/gather/gather_coll.c +++ b/teshsuite/smpi/coll-gather/coll-gather.c @@ -17,10 +17,8 @@ int main(int argc, char *argv[]) { - int rank, size; - int i; - int *sb; - int *rb; + int i, rank, size; + int *sb, *rb; int status; int root = 0; @@ -46,11 +44,10 @@ int main(int argc, char *argv[]) status = MPI_Gather(sb, count, MPI_INT, rb, count, MPI_INT, root, MPI_COMM_WORLD); if (rank == root) { - printf("[%d] rcvbuf=[", rank); - for (i = 0; i < count * size; i++) - printf("%d ", rb[i]); - printf("]\n"); - + printf("[%d] rcvbuf=[", rank); + for (i = 0; i < count * size; i++) + printf("%d ", rb[i]); + printf("]\n"); if (status != MPI_SUCCESS) { printf("allgather returned %d\n", status); diff --git a/teshsuite/smpi/gather/gather_coll.tesh b/teshsuite/smpi/coll-gather/coll-gather.tesh similarity index 94% rename from teshsuite/smpi/gather/gather_coll.tesh rename to teshsuite/smpi/coll-gather/coll-gather.tesh index abaa5b1153..e320536342 100644 --- a/teshsuite/smpi/gather/gather_coll.tesh +++ b/teshsuite/smpi/coll-gather/coll-gather.tesh @@ -4,7 +4,7 @@ ! timeout 30 p Test all to all -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/gather_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-gather --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error > [rank 0] -> Tremblay > [rank 1] -> Tremblay > [rank 2] -> Tremblay diff --git a/teshsuite/smpi/scatter/scatter.c b/teshsuite/smpi/coll-scatter/coll-scatter.c similarity index 87% rename from teshsuite/smpi/scatter/scatter.c rename to teshsuite/smpi/coll-scatter/coll-scatter.c index 94d88d355a..268b38c225 100644 --- a/teshsuite/smpi/scatter/scatter.c +++ b/teshsuite/smpi/coll-scatter/coll-scatter.c @@ -25,7 +25,6 @@ * 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. - * *************************************************************************** **/ #include #include @@ -41,7 +40,6 @@ static int ibm_test(int rank, int size) int *out; int *in; - out = malloc(MAXLEN * 64 * sizeof(int)); in = malloc(MAXLEN * sizeof(int)); @@ -55,9 +53,7 @@ static int ibm_test(int rank, int size) for (k = 0; k < j; k++) { if (in[k] != k + rank * j) { - fprintf(stderr, - "task %d bad answer (%d) at index %d k of %d (should be %d)", - rank, in[k], k, j, (k + rank * j)); + fprintf(stderr, "task %d bad answer (%d) at index %d k of %d (should be %d)",rank, in[k], k, j, (k + rank * j)); return (0); } } @@ -68,9 +64,7 @@ static int ibm_test(int rank, int size) return (success); } -/** - * small test: the root sends a single distinct double to other processes - **/ +/** small test: the root sends a single distinct double to other processes */ static int small_test(int rank, int size) { int success = 1; @@ -90,15 +84,12 @@ static int small_test(int rank, int size) } } - retval = - MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount, - MPI_DOUBLE, root, MPI_COMM_WORLD); + retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount, MPI_DOUBLE, root, MPI_COMM_WORLD); if (root == rank) { free(sndbuf); } if (retval != MPI_SUCCESS) { - fprintf(stderr, "(%s:%d) MPI_Scatter() returned retval=%d\n", __FILE__, - __LINE__, retval); + fprintf(stderr, "(%s:%d) MPI_Scatter() returned retval=%d\n", __FILE__, __LINE__, retval); return 0; } // verification @@ -109,13 +100,10 @@ static int small_test(int rank, int size) 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); @@ -128,7 +116,6 @@ int main(int argc, char **argv) else printf("\t[%d] ok.\n", rank); - MPI_Barrier(MPI_COMM_WORLD); /* test 2 */ diff --git a/teshsuite/smpi/scatter/scatter_coll.tesh b/teshsuite/smpi/coll-scatter/coll-scatter.tesh similarity index 89% rename from teshsuite/smpi/scatter/scatter_coll.tesh rename to teshsuite/smpi/coll-scatter/coll-scatter.tesh index 5914a50037..0d4b5550b9 100644 --- a/teshsuite/smpi/scatter/scatter_coll.tesh +++ b/teshsuite/smpi/coll-scatter/coll-scatter.tesh @@ -3,7 +3,7 @@ ! output sort p Test scatter -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/scatter --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-scatter --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error > [0] ok. > [0] ok. > [10] ok. diff --git a/teshsuite/smpi/compute/compute3.c b/teshsuite/smpi/compute/compute3.c index 31177306a5..9f8546de1a 100644 --- a/teshsuite/smpi/compute/compute3.c +++ b/teshsuite/smpi/compute/compute3.c @@ -57,17 +57,15 @@ int main(int argc, char *argv[]) else fprintf(stderr, "(1)"); fprintf(stderr, - " [rank:%d] 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)\n", smpi_process_index()); + " [rank:%d] 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)\n", smpi_process_index()); } d = compute(d); } } if (verbose) - fprintf(stderr, "(%12.6f) [rank:%d] The result of the computation is: %f\n", - MPI_Wtime(), smpi_process_index(), d); + fprintf(stderr, "(%12.6f) [rank:%d] The result of the computation is: %f\n", MPI_Wtime(), smpi_process_index(), d); else fprintf(stderr, "(2) [rank:%d] Done.\n", smpi_process_index()); diff --git a/teshsuite/smpi/gather/CMakeLists.txt b/teshsuite/smpi/gather/CMakeLists.txt deleted file mode 100644 index 4918607726..0000000000 --- a/teshsuite/smpi/gather/CMakeLists.txt +++ /dev/null @@ -1,21 +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 (gather_coll gather_coll.c) - target_link_libraries(gather_coll simgrid) -endif() - - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/gather_coll.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/gather_coll.c - PARENT_SCOPE) diff --git a/teshsuite/smpi/scatter/CMakeLists.txt b/teshsuite/smpi/scatter/CMakeLists.txt deleted file mode 100644 index 001cd6245c..0000000000 --- a/teshsuite/smpi/scatter/CMakeLists.txt +++ /dev/null @@ -1,20 +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 (scatter scatter.c) - target_link_libraries(scatter simgrid) -endif() - -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/scatter_coll.tesh - PARENT_SCOPE) -set(examples_src - ${examples_src} - ${CMAKE_CURRENT_SOURCE_DIR}/scatter.c - PARENT_SCOPE) diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 2aacda9cd4..84a695fadb 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -1049,16 +1049,11 @@ set(CMAKEFILES_TXT teshsuite/simix/stack_overflow/CMakeLists.txt teshsuite/smpi/CMakeLists.txt - teshsuite/smpi/allgatherv/CMakeLists.txt teshsuite/smpi/allreduce/CMakeLists.txt teshsuite/smpi/alltoall/CMakeLists.txt - teshsuite/smpi/alltoallv/CMakeLists.txt - teshsuite/smpi/barrier/CMakeLists.txt teshsuite/smpi/compute/CMakeLists.txt - teshsuite/smpi/gather/CMakeLists.txt teshsuite/smpi/pingpong/CMakeLists.txt teshsuite/smpi/reduce/CMakeLists.txt - teshsuite/smpi/scatter/CMakeLists.txt teshsuite/smpi/shared/CMakeLists.txt teshsuite/smpi/isp/umpire/CMakeLists.txt teshsuite/smpi/mpich3-test/CMakeLists.txt diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index 7f1fb622f0..0f16924d07 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -304,13 +304,6 @@ IF(NOT enable_memcheck) # smpi broken usage ADD_TESH_FACTORIES(tesh-smpi-broken "thread" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pingpong broken_hostfiles.tesh) ADD_TESH(tesh-smpi-replay-ti-tracing --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/pingpong --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pingpong TI_output.tesh) - FOREACH (GATHER_COLL default ompi mpich ompi_basic_linear ompi_linear_sync ompi_binomial mvapich2 mvapich2_two_level impi) - ADD_TESH(tesh-smpi-gather-coll-${GATHER_COLL} --cfg smpi/gather:${GATHER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/gather --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/gather gather_coll.tesh) - ENDFOREACH() - - FOREACH (ALLGATHERV_COLL default GB pair ring ompi mpich ompi_neighborexchange ompi_bruck mpich_rdb mpich_ring mvapich2 impi) - ADD_TESH(tesh-smpi-allgatherv-coll-${ALLGATHERV_COLL} --cfg smpi/allgatherv:${ALLGATHERV_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/allgatherv --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgatherv allgatherv_coll.tesh) - ENDFOREACH() FOREACH (ALLREDUCE_COLL default lr rab1 rab2 rab_rdb rdb smp_binomial smp_binomial_pipeline smp_rdb smp_rsag smp_rsag_lr smp_rsag_rab redbcast ompi mpich ompi_ring_segmented mvapich2 mvapich2_rs mvapich2_two_level impi) @@ -325,24 +318,12 @@ IF(NOT enable_memcheck) ring_mpi_barrier ring_one_barrier bruck basic_linear ompi mpich mvapich2 mvapich2_scatter_dest, impi) ADD_TESH(tesh-smpi-alltoall-coll-${ALLTOALL_COLL} --cfg smpi/alltoall:${ALLTOALL_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/alltoall --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoall alltoall_coll.tesh) - ENDFOREACH() - FOREACH (ALLTOALLV_COLL default 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-alltoallv-coll-${ALLTOALLV_COLL} --cfg smpi/alltoallv:${ALLTOALLV_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/alltoallv --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoallv alltoallv_coll.tesh) - ENDFOREACH() - + ENDFOREACH() FOREACH (REDUCE_COLL default arrival_pattern_aware binomial flat_tree NTSL scatter_gather ompi mpich ompi_chain ompi_binary ompi_basic_linear ompi_binomial ompi_in_order_binary mvapich2 mvapich2_knomial mvapich2_two_level impi rab) ADD_TESH(tesh-smpi-reduce-coll-${REDUCE_COLL} --cfg smpi/reduce:${REDUCE_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/reduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce reduce_coll.tesh) ENDFOREACH() FOREACH (REDUCE_SCATTER_COLL default ompi mpich ompi_basic_recursivehalving ompi_ring mpich_noncomm mpich_pair mvapich2 mpich_rdb impi) ADD_TESH(tesh-smpi-reduce-scatter-coll-${REDUCE_SCATTER_COLL} --cfg smpi/reduce_scatter:${REDUCE_SCATTER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/reduce --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce reduce_scatter_coll.tesh) - ENDFOREACH() - FOREACH (SCATTER_COLL default ompi mpich ompi_basic_linear ompi_binomial mvapich2 mvapich2_two_level_binomial mvapich2_two_level_direct impi) - ADD_TESH(tesh-smpi-scatter-coll-${SCATTER_COLL} --cfg smpi/scatter:${SCATTER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/scatter --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/scatter scatter_coll.tesh) - ENDFOREACH() - FOREACH (BARRIER_COLL default ompi mpich ompi_basic_linear ompi_tree ompi_bruck ompi_recursivedoubling ompi_doublering mvapich2_pair mvapich2 impi) - ADD_TESH(tesh-smpi-barrier-coll-${BARRIER_COLL} --cfg smpi/barrier:${BARRIER_COLL} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/barrier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/barrier barrier_coll.tesh) ENDFOREACH() ADD_TESH(tesh-smpi-clusters-types --cfg smpi/alltoall:mvapich2 --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/alltoall --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoall clusters.tesh) # END TESH TESTS