Skip to content

Commit a7bfe68

Browse files
ggouaillardethjelmn
authored andcommitted
fix NBC_Copy for legitimate zero size messages
this fixes a regression from open-mpi/ompi@9a70765 master commit open-mpi/ompi@0bd765e Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 8f8590e commit a7bfe68

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ompi/mca/coll/libnbc/nbc_internal.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*
1010
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
1111
* Copyright (c) 2014 NVIDIA Corporation. All rights reserved.
12+
* Copyright (c) 2015 Research Organization for Information Science
13+
* and Technology (RIST). All rights reserved.
1214
*
1315
*/
1416
#ifndef __NBC_INTERNAL_H__
@@ -501,7 +503,10 @@ static inline int NBC_Copy(void *src, int srccount, MPI_Datatype srctype, void *
501503
} else {
502504
/* we have to pack and unpack */
503505
res = MPI_Pack_size(srccount, srctype, comm, &size);
504-
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; }
506+
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Pack_size() (%i:%i)\n", res, size); return (MPI_SUCCESS == res) ? MPI_ERR_SIZE : res; }
507+
if (0 == size) {
508+
return NBC_OK;
509+
}
505510
packbuf = malloc(size);
506511
if (NULL == packbuf) { printf("Error in malloc()\n"); return res; }
507512
pos=0;

0 commit comments

Comments
 (0)