#include "mpi.h" void MPI_recv(void* buf, int count, MPI_Datatype type, int source, int tag, MPI_Comm comm, MPI_Status * status) { int cnt; MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, comm, status); MPI_Get_count(status, type, &cnt); MPI_Recv(buf,cnt,type,source,tag,comm,status); } int MPI_scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { int numtasks,rank,i; int tag=2712; MPI_Status status; MPI_Comm_size(comm,&numtasks); MPI_Comm_rank(comm,&rank); if(rank==root) { for(i=0;i