1: subSAi ← alloc(BuffSize); |
2: subSAj ← alloc(BuffSize); |
3: tmpOAij ← alloc(BuffSize * 2); |
4: first = last = 0; Pointers to the of buffertmpOAij
|
5: MPI_Recv(i, subSAi, BuffSize); |
6: MPI_Recv(j, subSAj, BuffSize); |
7: whileSAi and SAj are not finished do
|
8: tmpOSAij[last] ← ComputeSubOA(subSAi,subSAj); |
9: ifsubSAi is empty then
|
10: MPI_Recv(i, subSAi, BuffSize); |
11: end if
|
12: ifsubSAj is empty then
|
13: MPI_Recv(j, subSAj, BuffSize); |
14: end if
|
15: handle[last] = MPI_Isend(P−1, tmpOAij[last], BuffSize); |
16: last = (last+1)%2; |
17: iffirst = = lastthen
|
18: MPI_Wait(handle[first]); |
19: first = (first+1)%2; |
20: end if
|
21: end while
|