/**************************************************************************** * FILE: poe_bandwidth.c * DESCRIPTION: * This code conducts timing tests on messages sent between two processes. * It sends/receives N roundtrips of incrementally sized messages * from start size J to finish size K by increment I. * AUTHOR: 10/09/98 Blaise Barney * LAST REVISED: ******************************************************************************/ #include "mpi.h" #include #include #include #define MAXSIZE 1000000 #define task0 0 #define task1 1 #define tag0 0 #define tag1 1 int numtasks,rank,n,i,rndtrps,mbytes,startsize,finishsize,incr; float tbytes,ttime; char c[MAXSIZE],host0[35], host1[35]; struct timeval tv1, tv2; MPI_Status Stat; 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 == task0) { gethostname(host0,&n); MPI_Recv(&host1, 35, MPI_CHAR, task1, tag1, MPI_COMM_WORLD, &Stat); for (i=0; i