/**************************************************************************** * FILE: persist2.c * DESCRIPTION: * This code conducts timing tests on messages sent between two processes * using a non-blocking receive and a non-blocking send - for comparison with * persist.c * AUTHOR: 01/09/99 Blaise Barney * LAST REVISED: ******************************************************************************/ #include "mpi.h" #include /* Modify these to change timing scenario */ #define TRIALS 10 #define STEPS 20 #define MAX_MSGSIZE 1048576 /* 2^STEPS */ #define REPS 1000 #define MAXPOINTS 10000 int numtasks, rank, tag=999, n, i, j, k, msgsizes[MAXPOINTS]; double mbytes, tbytes, results[MAXPOINTS], ttime, t1, t2; char sbuff[MAX_MSGSIZE], rbuff[MAX_MSGSIZE]; MPI_Status stats[2]; MPI_Request reqs[2]; int main(argc,argv) int argc; char *argv[]; { MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD, &numtasks); MPI_Comm_rank(MPI_COMM_WORLD, &rank); /**************************** task 0 ***********************************/ if (rank == 0) { /* Initializations */ n=1; for (i=0; i<=STEPS; i++) { msgsizes[i] = n; results[i] = 0.0; n=n*2; } for (i=0; i