/****************************************************************************** * FILE: mpi_bug5.c * DESCRIPTION: * * AUTHOR: Blaise Barney * LAST REVISED: 01/24/09 ******************************************************************************/ #include "mpi.h" #include #include #define MSGSIZE 2000 int main (int argc, char *argv[]) { int numtasks, rank, i, tag=111, dest=1, source=0, count=0; char data[MSGSIZE]; double start, end, result; MPI_Status status; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD, &numtasks); MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (rank == 0) { printf ("mpi_bug5 has started...\n"); if (numtasks > 2) printf("INFO: Number of tasks= %d. Only using 2 tasks.\n", numtasks); } /******************************* Send task **********************************/ if (rank == 0) { /* Initialize send data */ for(i=0; i