[mpich] MPICH primary repository branch, master, updated. v3.1b1-181-ga5aa792
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "MPICH primary repository". The branch, master has been updated via a5aa7920ba7045ff66a3c3f5cfec7d8037b40fea (commit) via fda1c8ce26ec28005f7a8b37c788bd9b2afdd158 (commit) from 11e1e075af056e65285474a769bac7a6bd4a60ae (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.mpich.org/mpich.git/commitdiff/a5aa7920ba7045ff66a3c3f5cfec7d8037... commit a5aa7920ba7045ff66a3c3f5cfec7d8037b40fea Author: Pavan Balaji <[email protected]> Date: Sun Nov 3 12:00:00 2013 -0600 Fix assertion for large counts. We were checking for (size of datatype < MPIR_COUNT_MAX / count) earlier. This is not a good test when the count is very large. This patch modifies the assertion to (count * size of datatype < MPIR_COUNT_MAX) so we don't run into integer division issues. Signed-off-by: Rob Latham <[email protected]> diff --git a/src/mpi/datatype/status_set_elements_x.c b/src/mpi/datatype/status_set_elements_x.c index 7e9082c..c1d7ae2 100644 --- a/src/mpi/datatype/status_set_elements_x.c +++ b/src/mpi/datatype/status_set_elements_x.c @@ -38,7 +38,7 @@ int MPIR_Status_set_elements_x_impl(MPI_Status *status, MPI_Datatype datatype, M /* overflow check, should probably be a real error check? */ if (count != 0) { MPIU_Assert(size_x >= 0 && count > 0); - MPIU_Assert(size_x < MPIR_COUNT_MAX / count); + MPIU_Assert(count * size_x < MPIR_COUNT_MAX); } MPIR_STATUS_SET_COUNT(*status, size_x * count); http://git.mpich.org/mpich.git/commitdiff/fda1c8ce26ec28005f7a8b37c788bd9b2a... commit fda1c8ce26ec28005f7a8b37c788bd9b2afdd158 Author: Pavan Balaji <[email protected]> Date: Sun Nov 3 08:56:36 2013 -0600 Fix bit manipulation in the MPI_Status object. In C, left-shift has well-defined behavior, but right-shift does not for signed integers. The implementation is free to pad the shifted bits with 0's or 1's. In this patch, we type-cast the values to unsigned integers to make the behavior well-defined. Signed-off-by: Rob Latham <[email protected]> diff --git a/configure.ac b/configure.ac index 5300fa8..ea90595 100644 --- a/configure.ac +++ b/configure.ac @@ -5755,6 +5755,7 @@ AS_IF([test "$MPI_SIZEOF_AINT" -gt "$MPI_SIZEOF_OFFSET"], AC_SUBST([MPI_COUNT]) AC_SUBST([COUNT_KIND]) AC_DEFINE_UNQUOTED([MPIR_COUNT_MAX],[$MPIR_COUNT_MAX],[limits.h _MAX constant for MPI_Count]) +AC_DEFINE_UNQUOTED(MPIR_Ucount,unsigned $MPI_COUNT,[MPIR_Ucount is an unsigned MPI_Count-sized integer]) AS_CASE([$MPI_SIZEOF_COUNT], [4], [len_mpi_count=04], diff --git a/src/include/mpiimpl.h b/src/include/mpiimpl.h index 4786d60..4987129 100644 --- a/src/include/mpiimpl.h +++ b/src/include/mpiimpl.h @@ -2318,11 +2318,11 @@ void MPIR_Err_print_stack(FILE *, int); { \ (status_).count_lo = ((int) count_); \ (status_).count_hi_and_cancelled &= 1; \ - (status_).count_hi_and_cancelled |= (int) ((MPI_Count) count_ >> MPIR_BITS_IN_INT << 1); \ + (status_).count_hi_and_cancelled |= (int) ((MPIR_Ucount) count_ >> MPIR_BITS_IN_INT << 1); \ } #define MPIR_STATUS_GET_COUNT(status_) \ - ((MPI_Count) ((((MPI_Count) (status_).count_hi_and_cancelled) >> 1 << MPIR_BITS_IN_INT) + (status_).count_lo)) + ((MPI_Count) ((((MPIR_Ucount) (((unsigned int) (status_).count_hi_and_cancelled) >> 1)) << MPIR_BITS_IN_INT) + (unsigned int) (status_).count_lo)) #define MPIR_STATUS_SET_CANCEL_BIT(status_, cancelled_) \ { \ ----------------------------------------------------------------------- Summary of changes: configure.ac | 1 + src/include/mpiimpl.h | 4 ++-- src/mpi/datatype/status_set_elements_x.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org