Skip to content

Commit

Permalink
coll/libnbc: fix NBC_Unpack()
Browse files Browse the repository at this point in the history
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 <gilles@rist.or.jp>
(cherry picked from commit ff48e92)
Signed-off-by: Brian Barrett <bbarrett@amazon.com>
  • Loading branch information
ggouaillardet authored and bwbarrett committed Jun 25, 2020
1 parent ba221e1 commit d9d84d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ompi/mca/coll/libnbc/nbc_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,14 +516,18 @@ 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
if(NBC_Type_intrinsic(srctype)) {
#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);
Expand Down

0 comments on commit d9d84d5

Please sign in to comment.