- if (0 == root){
- /* root on 0, just use the recv buffer */
- ptmp = (char *) rbuf;
- if (sbuf != MPI_IN_PLACE) {
- err = Datatype::copy(sbuf, scount, sdtype,
- ptmp, rcount, rdtype);
- if (MPI_SUCCESS != err) { line = __LINE__; goto err_hndl; }
- }
- } else {
- /* root is not on 0, allocate temp buffer for recv,
- * rotate data at the end */
- tempbuf = (char *) smpi_get_tmp_recvbuffer(rtrue_extent + (rcount*size - 1) * rextent);
- if (NULL == tempbuf) {
- err= MPI_ERR_OTHER; line = __LINE__; goto err_hndl;
- }
-
- ptmp = tempbuf - rlb;
- if (sbuf != MPI_IN_PLACE) {
- /* copy from sbuf to temp buffer */
- err = Datatype::copy(sbuf, scount, sdtype,
- ptmp, rcount, rdtype);
- if (MPI_SUCCESS != err) { line = __LINE__; goto err_hndl; }
- } else {
- /* copy from rbuf to temp buffer */
- err = Datatype::copy((char *) rbuf + rank*rextent*rcount, rcount, rdtype, ptmp, rcount, rdtype );
- if (MPI_SUCCESS != err) { line = __LINE__; goto err_hndl; }
- }
- }
- total_recv = rcount;
+ if (0 == root) {
+ /* root on 0, just use the recv buffer */
+ ptmp = (char*)rbuf;
+ if (sbuf != MPI_IN_PLACE) {
+ err = Datatype::copy(sbuf, scount, sdtype, ptmp, rcount, rdtype);
+ if (MPI_SUCCESS != err) {
+ line = __LINE__;
+ goto err_hndl;
+ }
+ }
+ } else {
+ /* root is not on 0, allocate temp buffer for recv,
+ * rotate data at the end */
+ tempbuf = (char*)smpi_get_tmp_recvbuffer(rtrue_extent + (rcount * size - 1) * rextent);
+ if (NULL == tempbuf) {
+ err = MPI_ERR_OTHER;
+ line = __LINE__;
+ goto err_hndl;
+ }
+
+ ptmp = tempbuf - rlb;
+ if (sbuf != MPI_IN_PLACE) {
+ /* copy from sbuf to temp buffer */
+ err = Datatype::copy(sbuf, scount, sdtype, ptmp, rcount, rdtype);
+ if (MPI_SUCCESS != err) {
+ line = __LINE__;
+ goto err_hndl;
+ }
+ } else {
+ /* copy from rbuf to temp buffer */
+ err = Datatype::copy((char*)rbuf + rank * rextent * rcount, rcount, rdtype, ptmp, rcount, rdtype);
+ if (MPI_SUCCESS != err) {
+ line = __LINE__;
+ goto err_hndl;
+ }
+ }
+ }
+ total_recv = rcount;