-
- for (i = 0; i < X; i++)
- {
- dst = (i * Y + my_col_base);
- if (dst == rank)
- continue;
-
- recv_offset = 0;
- for (j = 0; j < Y; j++)
- {
- send_offset = (dst + j * num_procs) * block_size;
-
- if (j + my_row_base == rank)
- MPI_Sendrecv (send_buff + dst * block_size, send_count, send_type,
- rank, tag,
- tmp_buff2 + recv_offset, recv_count, recv_type,
- rank, tag, comm, &s);
- else
- MPI_Sendrecv (tmp_buff1 + send_offset, send_count, send_type,
- rank, tag,
- tmp_buff2 + recv_offset, recv_count, recv_type,
- rank, tag, comm, &s);
-
- recv_offset += block_size;
- }
-
- MPI_Send(tmp_buff2, send_count * Y, send_type, dst, tag, comm);
+
+ for (i = 0; i < X; i++) {
+ dst = (i * Y + my_col_base);
+ if (dst == rank)
+ continue;
+
+ recv_offset = 0;
+ for (j = 0; j < Y; j++) {
+ send_offset = (dst + j * num_procs) * block_size;
+
+ if (j + my_row_base == rank)
+ smpi_mpi_sendrecv((char *) send_buff + dst * block_size, send_count,
+ send_type, rank, tag, tmp_buff2 + recv_offset, recv_count,
+ recv_type, rank, tag, comm, &s);
+ else
+ smpi_mpi_sendrecv(tmp_buff1 + send_offset, send_count, send_type,
+ rank, tag,
+ tmp_buff2 + recv_offset, recv_count, recv_type,
+ rank, tag, comm, &s);
+
+ recv_offset += block_size;