at 16.09-beta 1.2 kB view raw
1commit 4ee20ba31dd64b8f899447cdad78ec2379acfce7 2Author: Gilles Gouaillardet <gilles@rist.or.jp> 3Date: Tue Nov 10 08:59:03 2015 +0900 4 5 fix NBC_Copy for legitimate zero size messages 6 7 (back ported from commit open-mpi/ompi@0bd765eddd33e3d4ac18ec644c60a5c160cb48dc) 8 (back ported from commit open-mpi/ompi@9a70765f27fdf17e70e1a115754fef7e5f16132a) 9 10diff --git a/ompi/mca/coll/libnbc/nbc_internal.h b/ompi/mca/coll/libnbc/nbc_internal.h 11index bf2f1cb..81be8cc 100644 12--- a/ompi/mca/coll/libnbc/nbc_internal.h 13+++ b/ompi/mca/coll/libnbc/nbc_internal.h 14@@ -501,7 +501,14 @@ static inline int NBC_Copy(void *src, int srccount, MPI_Datatype srctype, void * 15 } else { 16 /* we have to pack and unpack */ 17 res = MPI_Pack_size(srccount, srctype, comm, &size); 18- 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;} 19+ if (MPI_SUCCESS != res) { 20+ printf ("MPI Error in MPI_Pack_size() (%i:%i)", res, size); 21+ return res; 22+ } 23+ 24+ if (0 == size) { 25+ return OMPI_SUCCESS; 26+ } 27 packbuf = malloc(size); 28 if (NULL == packbuf) { printf("Error in malloc()\n"); return res; } 29 pos=0; 30