MPI
main(int argc, char *argv[])
{ char msg[25] ; int myid, err, np, tag=99; MPI_Status status ;
err = MPI_Init(&argc, &argv) ; /* MPI start*/
{ fprintf(stderror, "error in MPI init\n") ;
MPI_Comm_size(MPI_COMM_WORLD, &np) ; /* proc num*/
MPI_Comm_rank(MPI_COMM_WORLD, &myid) ;
if (myid == 0) /* process 0 */
{ strcpy(msg, “Message to be printed”) ;
MPI_Send(msg, strlen(msg)+1,MPI_CHAR,1,tag, MPI_COM_WORLD);
else if (myid == 1) /* process 1 */
MPI_Recv(msg, 25, MPI_CHAR,0, tag, MPI_COM_WORLD, &status) ;