案例:1.使用MPI_Wait()获取的status有什么用
if(rank==0)
MPI_Isend(&buffer0, count, MPI_INT, 1, 0, MPI_COMM_WORLD, &request0);
if(rank==1)
MPI_Recv(&buffer1, count, MPI_INT, 0, 0, MPI_COMM_WORLD);
if(rank==0)
MPI_Wait(&request0, &status);
// Can i use status here to do something?
MPI_Finalize();
案例:2。状态的使用在这里很清楚(只是为了比较而添加)
if(rank==0)
MPI_Ssend(&buffer0, count, MPI_INT, 1, 0, MPI_COMM_WORLD);
if(rank==1)
MPI_Irecv(&buffer1, count, MPI_INT, 0, 0, MPI_COMM_WORLD, &request1);
if(rank==1)
MPI_Wait(&request1, &status);
printf("The source is %d", status.MPI_SOURCE);
MPI_Finalize();