Message Passing
Tasks, in Unix generally separate processes, are complete programs with their own local data.
- Each task has its own ID.
- Tasks communicate by sending and receiving messages.
Widely available message passing libraries:
main(int argc,char **argv)
int rank,size,sdata=100155,rdata=0;
MPI_Comm_rank( MPI_COMM_WORLD, &rank);
MPI_Comm_size( MPI_COMM_WORLD, &size);
MPI_Send(&sdata,1,MPI_INT,1,0,
MPI_Recv(&rdata,1,MPI_INT,1,1,
printf("test succeeds\n");
else printf("test fails\n");
MPI_Recv(&rdata,1,MPI_INT,0,0,
MPI_Send(&rdata,1,MPI_INT,0,1,
Author | Title | Tracks | Home