From ff48e9286430b37aac3146efe2b355f255db94d5 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 12 Sep 2018 16:46:13 +0900 Subject: [PATCH] coll/libnbc: fix NBC_Unpack() always initialize 'size'. Only the a2a_sched_diss() alltoall algorithm is impacted, and this algo is currently unused, so there is no need to backport nor update the NEWS file for now. Signed-off-by: Gilles Gouaillardet --- ompi/mca/coll/libnbc/nbc_internal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ompi/mca/coll/libnbc/nbc_internal.h b/ompi/mca/coll/libnbc/nbc_internal.h index da9786dbb6..735beaa06e 100644 --- a/ompi/mca/coll/libnbc/nbc_internal.h +++ b/ompi/mca/coll/libnbc/nbc_internal.h @@ -516,6 +516,11 @@ static inline int NBC_Unpack(void *src, int srccount, MPI_Datatype srctype, void int res; ptrdiff_t ext, lb; + res = ompi_datatype_pack_external_size("external32", srccount, srctype, &size); + if (OMPI_SUCCESS != res) { + NBC_Error ("MPI Error in ompi_datatype_pack_external_size() (%i)", res); + return res; + } #if OPAL_CUDA_SUPPORT if(NBC_Type_intrinsic(srctype) && !(opal_cuda_check_bufs((char *)tgt, (char *)src))) { #else @@ -523,7 +528,6 @@ static inline int NBC_Unpack(void *src, int srccount, MPI_Datatype srctype, void #endif /* OPAL_CUDA_SUPPORT */ /* if we have the same types and they are contiguous (intrinsic * types are contiguous), we can just use a single memcpy */ - res = ompi_datatype_pack_external_size("external32", srccount, srctype, &size); res = ompi_datatype_get_extent (srctype, &lb, &ext); if (OMPI_SUCCESS != res) { NBC_Error ("MPI Error in MPI_Type_extent() (%i)", res);