From 78f60c03e259edfbb61fd09ecc94962186517541 Mon Sep 17 00:00:00 2001 From: degomme Date: Tue, 15 Jul 2014 18:29:37 +0200 Subject: [PATCH] allred test needed unsigned char support, which was forgotten. TODO : This part of the code is ugly and should be replaced by macros asap, as it may lead to nasty bugs --- src/smpi/smpi_mpi_dt.c | 23 +++++++++++++++++-- .../smpi/mpich3-test/coll/CMakeLists.txt | 4 ++-- teshsuite/smpi/mpich3-test/coll/testlist | 6 ++--- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/smpi/smpi_mpi_dt.c b/src/smpi/smpi_mpi_dt.c index 923193b576..852b4d4a9c 100644 --- a/src/smpi/smpi_mpi_dt.c +++ b/src/smpi/smpi_mpi_dt.c @@ -1261,6 +1261,8 @@ static void max_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, MAX_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, MAX_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, MAX_OP); } else if (*datatype == MPI_FLOAT) { APPLY_FUNC(a, b, length, float, MAX_OP); } else if (*datatype == MPI_DOUBLE) { @@ -1287,6 +1289,8 @@ static void min_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, MIN_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, MIN_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, MIN_OP); } else if (*datatype == MPI_FLOAT) { APPLY_FUNC(a, b, length, float, MIN_OP); } else if (*datatype == MPI_DOUBLE) { @@ -1313,6 +1317,8 @@ static void sum_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, SUM_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, SUM_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, SUM_OP); } else if (*datatype == MPI_FLOAT) { APPLY_FUNC(a, b, length, float, SUM_OP); } else if (*datatype == MPI_DOUBLE) { @@ -1345,6 +1351,8 @@ static void prod_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, PROD_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, PROD_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, PROD_OP); } else if (*datatype == MPI_FLOAT) { APPLY_FUNC(a, b, length, float, PROD_OP); } else if (*datatype == MPI_DOUBLE) { @@ -1377,6 +1385,8 @@ static void land_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, LAND_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, LAND_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, LAND_OP); } else if (*datatype == MPI_C_BOOL) { APPLY_FUNC(a, b, length, _Bool, LAND_OP); } @@ -1399,6 +1409,8 @@ static void lor_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, LOR_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, LOR_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, LOR_OP); } else if (*datatype == MPI_C_BOOL) { APPLY_FUNC(a, b, length, _Bool, LOR_OP); } @@ -1421,6 +1433,8 @@ static void lxor_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, LXOR_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, LXOR_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, LXOR_OP); } else if (*datatype == MPI_C_BOOL) { APPLY_FUNC(a, b, length, _Bool, LXOR_OP); } @@ -1431,8 +1445,7 @@ static void band_func(void *a, void *b, int *length, { if (*datatype == MPI_CHAR) { APPLY_FUNC(a, b, length, char, BAND_OP); - } - if (*datatype == MPI_SHORT) { + }else if (*datatype == MPI_SHORT) { APPLY_FUNC(a, b, length, short, BAND_OP); } else if (*datatype == MPI_INT) { APPLY_FUNC(a, b, length, int, BAND_OP); @@ -1444,6 +1457,8 @@ static void band_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, BAND_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, BAND_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, BAND_OP); } else if (*datatype == MPI_BYTE) { APPLY_FUNC(a, b, length, uint8_t, BAND_OP); } @@ -1466,6 +1481,8 @@ static void bor_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, BOR_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, BOR_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, BOR_OP); } else if (*datatype == MPI_BYTE) { APPLY_FUNC(a, b, length, uint8_t, BOR_OP); } @@ -1488,6 +1505,8 @@ static void bxor_func(void *a, void *b, int *length, APPLY_FUNC(a, b, length, unsigned int, BXOR_OP); } else if (*datatype == MPI_UNSIGNED_LONG) { APPLY_FUNC(a, b, length, unsigned long, BXOR_OP); + } else if (*datatype == MPI_UNSIGNED_CHAR) { + APPLY_FUNC(a, b, length, unsigned char, BXOR_OP); } else if (*datatype == MPI_BYTE) { APPLY_FUNC(a, b, length, uint8_t, BXOR_OP); } diff --git a/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt b/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt index 71e315137f..b3e10c42d9 100644 --- a/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt @@ -22,7 +22,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) add_executable(allred4 allred4.c) add_executable(allred5 allred5.c) add_executable(allred6 allred6.c) -# add_executable(allred allred.c) + add_executable(allred allred.c) add_executable(allredmany allredmany.c) add_executable(alltoall1 alltoall1.c) add_executable(alltoallv0 alltoallv0.c) @@ -112,7 +112,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) target_link_libraries(allred4 simgrid mtest_c) target_link_libraries(allred5 simgrid mtest_c) target_link_libraries(allred6 simgrid mtest_c) -# target_link_libraries(allred simgrid mtest_c) + target_link_libraries(allred simgrid mtest_c) target_link_libraries(allredmany simgrid mtest_c) target_link_libraries(alltoall1 simgrid mtest_c) target_link_libraries(alltoallv0 simgrid mtest_c) diff --git a/teshsuite/smpi/mpich3-test/coll/testlist b/teshsuite/smpi/mpich3-test/coll/testlist index 3533065f52..5bd4ecf530 100644 --- a/teshsuite/smpi/mpich3-test/coll/testlist +++ b/teshsuite/smpi/mpich3-test/coll/testlist @@ -1,7 +1,7 @@ #needs MPI_Errhandler_set MPI_Type_get_name -#allred 4 -#allred 7 -#allred 4 arg=100 +allred 4 +allred 7 +allred 4 arg=100 allredmany 4 allred2 4 allred3 10 -- 2.20.1