From 9a70765f27fdf17e70e1a115754fef7e5f16132a Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Tue, 12 May 2015 12:38:58 -0700 Subject: [PATCH] Silence malloc(0) warnings reported by Lisandro --- contrib/platform/intel/bend/linux | 2 +- ompi/mca/coll/libnbc/coll_libnbc_ireduce_scatter_block.c | 6 +++--- ompi/mca/coll/libnbc/nbc_internal.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/platform/intel/bend/linux b/contrib/platform/intel/bend/linux index d7027c8333..e9f0de7109 100644 --- a/contrib/platform/intel/bend/linux +++ b/contrib/platform/intel/bend/linux @@ -10,7 +10,7 @@ enable_debug=yes enable_shared=yes enable_static=no enable_memchecker=no -enable_ipv6=yes +enable_ipv6=no enable_mpi_fortran=yes enable_mpi_cxx=no enable_mpi_cxx_seek=no diff --git a/ompi/mca/coll/libnbc/coll_libnbc_ireduce_scatter_block.c b/ompi/mca/coll/libnbc/coll_libnbc_ireduce_scatter_block.c index b35b557a70..bb0f0b7cbd 100644 --- a/ompi/mca/coll/libnbc/coll_libnbc_ireduce_scatter_block.c +++ b/ompi/mca/coll/libnbc/coll_libnbc_ireduce_scatter_block.c @@ -51,9 +51,9 @@ int ompi_coll_libnbc_ireduce_scatter_block(void* sendbuf, void* recvbuf, int rec res = MPI_Comm_rank(comm, &rank); if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; } res = MPI_Comm_size(comm, &p); - if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_size() (%i)\n", res); return res; } + if (MPI_SUCCESS != res || 0 == p) { printf("MPI Error in MPI_Comm_size() (%i:%i)\n", res, p); return (MPI_SUCCESS == res) ? MPI_ERR_SIZE : res; } res = MPI_Type_extent(datatype, &ext); - if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Type_extent() (%i)\n", res); return res; } + if (MPI_SUCCESS != res || 0 == ext) { printf("MPI Error in MPI_Type_extent() (%i:%i)\n", res, (int)ext); return (MPI_SUCCESS == res) ? MPI_ERR_SIZE : res; } schedule = (NBC_Schedule*)malloc(sizeof(NBC_Schedule)); if (NULL == schedule) { printf("Error in malloc()\n"); return NBC_OOR; } @@ -65,7 +65,7 @@ int ompi_coll_libnbc_ireduce_scatter_block(void* sendbuf, void* recvbuf, int rec count = 0; for(r=0;rtmpbuf = malloc(ext*count*2); if(handle->tmpbuf == NULL) { printf("Error in malloc()\n"); return NBC_OOR; } diff --git a/ompi/mca/coll/libnbc/nbc_internal.h b/ompi/mca/coll/libnbc/nbc_internal.h index b89d3310de..10728d6c86 100644 --- a/ompi/mca/coll/libnbc/nbc_internal.h +++ b/ompi/mca/coll/libnbc/nbc_internal.h @@ -501,7 +501,7 @@ static inline int NBC_Copy(void *src, int srccount, MPI_Datatype srctype, void * } else { /* we have to pack and unpack */ res = MPI_Pack_size(srccount, srctype, comm, &size); - if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Pack_size() (%i)\n", res); return res; } + if (MPI_SUCCESS != res || 0 == size) { printf("MPI Error in MPI_Pack_size() (%i:%i)\n", res, size); return (MPI_SUCCESS == res) ? MPI_ERR_SIZE : res; } packbuf = malloc(size); if (NULL == packbuf) { printf("Error in malloc()\n"); return res; } pos=0;