55 * Corporation. All rights reserved.
66 * Copyright (c) 2006 The Technical University of Chemnitz. All
77 * rights reserved.
8- * Copyright (c) 2014-2016 Research Organization for Information Science
8+ * Copyright (c) 2014-2017 Research Organization for Information Science
99 * and Technology (RIST). All rights reserved.
1010 * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1111 * reserved.
@@ -74,6 +74,11 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons
7474 }
7575 }
7676 span = opal_datatype_span (& recvtype -> super , count , & gap );
77+ if (OPAL_UNLIKELY (0 == span )) {
78+ * request = & ompi_request_empty ;
79+ NBC_Return_handle (handle );
80+ return MPI_SUCCESS ;
81+ }
7782 handle -> tmpbuf = malloc (span );
7883 if (OPAL_UNLIKELY (NULL == handle -> tmpbuf )) {
7984 NBC_Return_handle (handle );
@@ -85,6 +90,7 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons
8590 res = ompi_datatype_type_extent (sendtype , & sndext );
8691 if (MPI_SUCCESS != res ) {
8792 NBC_Error ("MPI Error in ompi_datatype_type_extent() (%i)" , res );
93+ NBC_Return_handle (handle );
8894 return res ;
8995 }
9096 if (sendcounts [rank ] != 0 ) {
@@ -336,13 +342,15 @@ static inline int a2av_sched_inplace(int rank, int p, NBC_Schedule *schedule,
336342 if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
337343 return res ;
338344 }
339- res = NBC_Sched_send ((void * )(- gap ), true , counts [peer ], type , peer , schedule , false);
340- if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
341- return res ;
342- }
343- res = NBC_Sched_recv (tbuf , false , counts [peer ], type , peer , schedule , true);
344- if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
345- return res ;
345+ if (0 != counts [peer ]) {
346+ res = NBC_Sched_send ((void * )(- gap ), true , counts [peer ], type , peer , schedule , false);
347+ if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
348+ return res ;
349+ }
350+ res = NBC_Sched_recv (tbuf , false , counts [peer ], type , peer , schedule , true);
351+ if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
352+ return res ;
353+ }
346354 }
347355 }
348356
0 commit comments