Skip to content

Commit ee5e037

Browse files
committed
coll/libnbc: fix NBC_Unpack()
always initialize 'size' Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent b83ad04 commit ee5e037

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ompi/mca/coll/libnbc/nbc_internal.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,14 +516,18 @@ static inline int NBC_Unpack(void *src, int srccount, MPI_Datatype srctype, void
516516
int res;
517517
ptrdiff_t ext, lb;
518518

519+
res = ompi_datatype_pack_external_size("external32", srccount, srctype, &size);
520+
if (OMPI_SUCCESS != res) {
521+
NBC_Error ("MPI Error in ompi_datatype_pack_external_size() (%i)", res);
522+
return res;
523+
}
519524
#if OPAL_CUDA_SUPPORT
520525
if(NBC_Type_intrinsic(srctype) && !(opal_cuda_check_bufs((char *)tgt, (char *)src))) {
521526
#else
522527
if(NBC_Type_intrinsic(srctype)) {
523528
#endif /* OPAL_CUDA_SUPPORT */
524529
/* if we have the same types and they are contiguous (intrinsic
525530
* types are contiguous), we can just use a single memcpy */
526-
res = ompi_datatype_pack_external_size("external32", srccount, srctype, &size);
527531
res = ompi_datatype_get_extent (srctype, &lb, &ext);
528532
if (OMPI_SUCCESS != res) {
529533
NBC_Error ("MPI Error in MPI_Type_extent() (%i)", res);

0 commit comments

Comments
 (0)