intmain(intargc,char*argv[]) { structstudentastudent;/* Just used to define MPI_STUDENT*/ inti,j,myrank; MPI_Init(&argc,&argv); MPI_Statusstatus; MPI_DatatypeMPI_STUDENT; MPI_Datatypetype[3]={MPI_CHAR,MPI_CHAR,MPI_INT};/* The "MPI types" of student */ intblocklen[3]={30,10,1};/* The array lengths */ MPI_Aintdisp[3];/* Address displacements */ MPI_Aintstart_address; MPI_Aintaddress; MPI_Get_address(&astudent,&start_address); MPI_Get_address(&astudent.name,&address); disp[0]=address-start_address; MPI_Get_address(&astudent.year,&address); disp[1]=address-start_address; MPI_Get_address(&astudent.exam_grade,&address); disp[2]=address-start_address; /* Address displacements for MPI_STUDENT */ MPI_Type_create_struct(3,blocklen,disp,type,&MPI_STUDENT); MPI_Type_commit(&MPI_STUDENT); /* MPI_STUDENT is now an available MPI datatype */ MPI_Comm_rank(MPI_COMM_WORLD,&myrank); if(myrank==0){ structstudentbstudent;/* Just known to rank 0 */ strncpy(bstudent.name,"Joe Jones",30); strncpy(bstudent.year,"Sr.",10);; bstudent.exam_grade=95; MPI_Send(&bstudent,1,MPI_STUDENT,1,123,MPI_COMM_WORLD); }elseif(myrank==1){ structstudentcstudent;/* Just known to rank 1 */ MPI_Recv(&cstudent,1,MPI_STUDENT,0,123,MPI_COMM_WORLD,&status); /* printf("%s \n",bstudent.name); Error - Not known to rank 1 */ printf("%s \n",cstudent.name); printf("%s \n",cstudent.year); printf("%i \n",cstudent.exam_grade); } MPI_Finalize(); return0; }