@@ -56,8 +56,6 @@ int ompi_coll_libnbc_ialltoallv(void* sendbuf, int *sendcounts, int *sdispls,
5656 if (MPI_SUCCESS != res ) { printf ("MPI Error in MPI_Comm_rank() (%i)\n" , res ); return res ; }
5757 res = MPI_Comm_size (comm , & p );
5858 if (MPI_SUCCESS != res ) { printf ("MPI Error in MPI_Comm_size() (%i)\n" , res ); return res ; }
59- res = MPI_Type_extent (sendtype , & sndext );
60- if (MPI_SUCCESS != res ) { printf ("MPI Error in MPI_Type_extent() (%i)\n" , res ); return res ; }
6159 res = MPI_Type_extent (recvtype , & rcvext );
6260 if (MPI_SUCCESS != res ) { printf ("MPI Error in MPI_Type_extent() (%i)\n" , res ); return res ; }
6361
@@ -82,11 +80,15 @@ int ompi_coll_libnbc_ialltoallv(void* sendbuf, int *sendcounts, int *sdispls,
8280 if (OPAL_UNLIKELY (NULL == handle -> tmpbuf )) { printf ("Error in malloc()\n" ); return NBC_OOR ; }
8381 sendcounts = recvcounts ;
8482 sdispls = rdispls ;
85- } else if (sendcounts [rank ] != 0 ) {
86- rbuf = (char * ) recvbuf + rdispls [rank ] * rcvext ;
87- sbuf = (char * ) sendbuf + sdispls [rank ] * sndext ;
88- res = NBC_Copy (sbuf , sendcounts [rank ], sendtype , rbuf , recvcounts [rank ], recvtype , comm );
89- if (NBC_OK != res ) { printf ("Error in NBC_Copy() (%i)\n" , res ); return res ; }
83+ } else {
84+ res = MPI_Type_extent (sendtype , & sndext );
85+ if (MPI_SUCCESS != res ) { printf ("MPI Error in MPI_Type_extent() (%i)\n" , res ); return res ; }
86+ if (sendcounts [rank ] != 0 ) {
87+ rbuf = (char * ) recvbuf + rdispls [rank ] * rcvext ;
88+ sbuf = (char * ) sendbuf + sdispls [rank ] * sndext ;
89+ res = NBC_Copy (sbuf , sendcounts [rank ], sendtype , rbuf , recvcounts [rank ], recvtype , comm );
90+ if (NBC_OK != res ) { printf ("Error in NBC_Copy() (%i)\n" , res ); return res ; }
91+ }
9092 }
9193
9294 if (inplace ) {
0 commit comments