/* */ #include #include #include "mpi.h" #include #include #include #include int main(int argc, char *argv[]) { MPI_Status status; /* MPI status */ int mpierr; /* MPI function return code */ int rank; /* Process rank within MPI_COMM_WORLD */ int tag0=41; /* MPI message tag */ int n_bytes=1024*1024; int n_loops=2; unsigned char* send_buff; unsigned char* recv_buff; int i, j, count; float fraction, randval; struct timeval tp; if ( argc > 2 ) { n_loops = atoi(argv[2]); n_loops = n_loops < 1 ? 10 : n_loops; } if ( argc > 1 ) { n_bytes = atoi(argv[1]); n_bytes = n_bytes < 1 ? 32768 : n_bytes; } send_buff = (unsigned char *) valloc(n_bytes); recv_buff = (unsigned char *) valloc(n_bytes); /* seed the random number generator */ gettimeofday (&tp, NULL); srand (tp.tv_usec); for ( i=0; i