/****************************************************************************** * FILE: eager_vs_rend.c * DESCRIPTION: * Demonstrates use of eager vs rendevous protocols for IBM's MPI. * To time messages sent with eager protocol: * setenv MP_EAGER_LIMIT 64000 * To time messages sent with rendezvous protocol: * setenv MP_EAGER_LIMIT 1 * LAST REVISED: 2/15/99 Blaise Barney ******************************************************************************/ #include "mpi.h" #include #define EAGERLIMIT 64000 /* Max eager limit under POE */ /* #define NLOOPS 100000 */ #define NLOOPS 100 #define STEP 1000 int main(argc,argv) int argc; char *argv[]; { int numtasks, rank, dest=1, i, tag=111, source=0, size; double start, end; char data[EAGERLIMIT]; MPI_Status status; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD, &numtasks); MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (numtasks != 2) { printf("Please run this test with 2 tasks. Terminating\n"); MPI_Finalize(); } printf ("MPI task %d started...\n", rank); /* Send task */ if (rank == 0) { /* Initialize */ for(i=0; i