@@ -54,12 +54,6 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons
54
54
rank = ompi_comm_rank (comm );
55
55
p = ompi_comm_size (comm );
56
56
57
- res = ompi_datatype_type_extent (sendtype , & sndext );
58
- if (MPI_SUCCESS != res ) {
59
- NBC_Error ("MPI Error in ompi_datatype_type_extent() (%i)" , res );
60
- return res ;
61
- }
62
-
63
57
res = ompi_datatype_type_extent (recvtype , & rcvext );
64
58
if (MPI_SUCCESS != res ) {
65
59
NBC_Error ("MPI Error in ompi_datatype_type_extent() (%i)" , res );
@@ -87,13 +81,20 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons
87
81
}
88
82
sendcounts = recvcounts ;
89
83
sdispls = rdispls ;
90
- } else if (sendcounts [rank ] != 0 ) {
91
- rbuf = (char * ) recvbuf + rdispls [rank ] * rcvext ;
92
- sbuf = (char * ) sendbuf + sdispls [rank ] * sndext ;
93
- res = NBC_Copy (sbuf , sendcounts [rank ], sendtype , rbuf , recvcounts [rank ], recvtype , comm );
94
- if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
84
+ } else {
85
+ res = ompi_datatype_type_extent (sendtype , & sndext );
86
+ if (MPI_SUCCESS != res ) {
87
+ NBC_Error ("MPI Error in ompi_datatype_type_extent() (%i)" , res );
95
88
return res ;
96
89
}
90
+ if (sendcounts [rank ] != 0 ) {
91
+ rbuf = (char * ) recvbuf + rdispls [rank ] * rcvext ;
92
+ sbuf = (char * ) sendbuf + sdispls [rank ] * sndext ;
93
+ res = NBC_Copy (sbuf , sendcounts [rank ], sendtype , rbuf , recvcounts [rank ], recvtype , comm );
94
+ if (OPAL_UNLIKELY (OMPI_SUCCESS != res )) {
95
+ return res ;
96
+ }
97
+ }
97
98
}
98
99
99
100
schedule = OBJ_NEW (NBC_Schedule );
0 commit comments