5
5
* Corporation. All rights reserved.
6
6
* Copyright (c) 2006 The Technical University of Chemnitz. All
7
7
* rights reserved.
8
- * Copyright (c) 2014-2016 Research Organization for Information Science
8
+ * Copyright (c) 2014-2017 Research Organization for Information Science
9
9
* and Technology (RIST). All rights reserved.
10
10
* Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights
11
11
* reserved.
@@ -74,6 +74,11 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons
74
74
}
75
75
}
76
76
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
+ }
77
82
handle -> tmpbuf = malloc (span );
78
83
if (OPAL_UNLIKELY (NULL == handle -> tmpbuf )) {
79
84
NBC_Return_handle (handle );
@@ -85,6 +90,7 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons
85
90
res = ompi_datatype_type_extent (sendtype , & sndext );
86
91
if (MPI_SUCCESS != res ) {
87
92
NBC_Error ("MPI Error in ompi_datatype_type_extent() (%i)" , res );
93
+ NBC_Return_handle (handle );
88
94
return res ;
89
95
}
90
96
if (sendcounts [rank ] != 0 ) {
@@ -338,13 +344,15 @@ static inline int a2av_sched_inplace(int rank, int p, NBC_Schedule *schedule,
338
344
if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
339
345
return res ;
340
346
}
341
- res = NBC_Sched_send ((void * )(- gap ), true , counts [peer ], type , peer , schedule , false);
342
- if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
343
- return res ;
344
- }
345
- res = NBC_Sched_recv (tbuf , false , counts [peer ], type , peer , schedule , true);
346
- if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
347
- return res ;
347
+ if (0 != counts [peer ]) {
348
+ res = NBC_Sched_send ((void * )(- gap ), true , counts [peer ], type , peer , schedule , false);
349
+ if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
350
+ return res ;
351
+ }
352
+ res = NBC_Sched_recv (tbuf , false , counts [peer ], type , peer , schedule , true);
353
+ if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
354
+ return res ;
355
+ }
348
356
}
349
357
}
350
358
0 commit comments