/****************************************************************************** * FILE: unsafe.c * DESCRIPTION: * This simple program is unsafe when run under IBM's MPI because its * successful execution depends upon system buffer space. It uses a message * size which by default, is sent in eager mode and requires buffering on the * receive side. The receive process has more work to do than the send process, * and eventually, the incoming messages exhaust its buffer space. * To run this program, use the default settings for MP_EAGER_LIMIT and * MP_BUFFER_MEM. When IP communications (MP_EUILIB=ip) are used, it will * fail within a few seconds. If US communications (MP_EUILIB=us) are used, * it will fail when MP_CSS_INTERRUPT is set to "yes". * LAST REVISED: 2/15/99 Blaise Barney ******************************************************************************/ #include "mpi.h" #include #define EAGERSIZE 4096 /* Default eager size for 2 tasks */ int main(argc,argv) int argc; char *argv[]; { int numtasks, rank, i, tag=111, dest=1, source=0, count=0; char data[EAGERSIZE]; 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 (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 send data */ for(i=0; i