+ for (int i = 0; i < size; i++) { // copy data to avoid bad free
+ send_size += real_sendcounts[i] ;
+ recv_size += recvcounts[i];
+ if (((recvdispls[i] + recvcounts[i]) * dt_size_recv) > maxsize)
+ maxsize = (recvdispls[i] + recvcounts[i]) * dt_size_recv;
+ }
+ real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, maxsize, MPI_CHAR);
+