- int i, size, rank;
- char *psnd, *prcv;
- int nreqs;
- ptrdiff_t sext, rext;
- MPI_Request *preq;
- size = comm->size();
- rank = comm->rank();
- MPI_Request* ireqs = new MPI_Request[size * 2];
- XBT_DEBUG(
- "coll:tuned:alltoallv_intra_basic_linear rank %d", rank);
-
- sext=sdtype->get_extent();
- rext=rdtype->get_extent();
-
- /* Simple optimization - handle send to self first */
- psnd = ((char *) sbuf) + (sdisps[rank] * sext);
- prcv = ((char *) rbuf) + (rdisps[rank] * rext);
- if (0 != scounts[rank]) {
- Datatype::copy(psnd, scounts[rank], sdtype,
- prcv, rcounts[rank], rdtype);
- }
-
- /* If only one process, we're done. */
- if (1 == size) {
- return MPI_SUCCESS;
- }
-
- /* Now, initiate all send/recv to/from others. */
- nreqs = 0;
- preq = ireqs;
-
- /* Post all receives first */
- for (i = 0; i < size; ++i) {
- if (i == rank) {
- continue;
- }
-
- prcv = ((char *) rbuf) + (rdisps[i] * rext);
-
- *preq = Request::irecv_init(prcv, rcounts[i], rdtype,
- i, COLL_TAG_ALLTOALLV, comm
- );
- preq++;
- ++nreqs;
-
- }
+ int i, size, rank;
+ char *psnd, *prcv;
+ int nreqs;
+ ptrdiff_t sext, rext;
+ MPI_Request* preq;
+ size = comm->size();
+ rank = comm->rank();
+ MPI_Request* ireqs = new MPI_Request[size * 2];
+ XBT_DEBUG("coll:tuned:alltoallv_intra_basic_linear rank %d", rank);
+
+ sext = sdtype->get_extent();
+ rext = rdtype->get_extent();
+
+ /* Simple optimization - handle send to self first */
+ psnd = ((char*)sbuf) + (sdisps[rank] * sext);
+ prcv = ((char*)rbuf) + (rdisps[rank] * rext);
+ if (0 != scounts[rank]) {
+ Datatype::copy(psnd, scounts[rank], sdtype, prcv, rcounts[rank], rdtype);
+ }
+
+ /* If only one process, we're done. */
+ if (1 == size) {
+ return MPI_SUCCESS;
+ }