Skip to content

Commit 40d4dc8

Browse files
committed
fix(mpi): fix parameters for MPI_Isend, MPI_Irecv, and MPI_Wait
close #11
1 parent 5a64feb commit 40d4dc8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mpi/transpose-pairwise-omc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static void transpose_chunks(int *sched, int n_pes, int my_pe,
7171
buf[1] = bufs[1];
7272
#endif
7373
int pe = sched[0], pe2, j=0;
74-
MPI_Status send_status, recv_status;
74+
MPI_Request send_request, recv_request;
7575

7676
#ifdef AMD_MPI_TRANSPOSE_LOGS
7777
printf("TRANSPOSE-PAIRWISE: n_pes[%d], my_pe[%d], first_pe[%d]\n", n_pes, my_pe, pe);
@@ -105,13 +105,13 @@ static void transpose_chunks(int *sched, int n_pes, int my_pe,
105105
#ifdef AMD_MPI_TRANSPOSE_LOGS
106106
printf("OVERLAP REGION:(my_pe != pe)=> my_pe[%d], i[%d]:pe[%d], src_offset[%d], dst_offset[%d], size[%d]\n", my_pe, i, pe2, sbo[pe2], rbo[pe2], sbs[pe2]);
107107
#endif
108-
MPI_Isend(buf[j&0x1], (int) (sbs[pe]), FFTW_MPI_TYPE, pe, (my_pe * n_pes + pe) & 0xffff, comm, &send_status);
109-
MPI_Irecv(O + rbo[pe], (int) (rbs[pe]), FFTW_MPI_TYPE, pe, (pe * n_pes + my_pe) & 0xffff, comm, &recv_status);
108+
MPI_Isend(buf[j&0x1], (int) (sbs[pe]), FFTW_MPI_TYPE, pe, (my_pe * n_pes + pe) & 0xffff, comm, &send_request);
109+
MPI_Irecv(O + rbo[pe], (int) (rbs[pe]), FFTW_MPI_TYPE, pe, (pe * n_pes + my_pe) & 0xffff, comm, &recv_request);
110110
memcpy(buf[(j+1)&0x1], O + sbo[pe2], sbs[pe2] * sizeof(R));
111111
pe = pe2;
112112
//barrier
113-
MPI_Wait(&send_status, MPI_STATUS_IGNORE);
114-
MPI_Wait(&recv_status, MPI_STATUS_IGNORE);
113+
MPI_Wait(&send_request, MPI_STATUS_IGNORE);
114+
MPI_Wait(&recv_request, MPI_STATUS_IGNORE);
115115
}
116116
j++;
117117
}

0 commit comments

Comments
 (0)