@@ -54,12 +54,6 @@ int ompi_coll_libnbc_ialltoallv(const void* sendbuf, const int *sendcounts, cons
5454 rank = ompi_comm_rank (comm );
5555 p = ompi_comm_size (comm );
5656
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-
6357 res = ompi_datatype_type_extent (recvtype , & rcvext );
6458 if (MPI_SUCCESS != res ) {
6559 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
8781 }
8882 sendcounts = recvcounts ;
8983 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 );
9588 return res ;
9689 }
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+ }
9798 }
9899
99100 schedule = OBJ_NEW (NBC_Schedule );
0 commit comments