X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d0ffc37686edcc803601f76ab51fdfed5fc2f241..21fe278c8460849931b37ccde22e944edec46f71:/teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c b/teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c index cc7cc5acd1..bf89ff1b77 100644 --- a/teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c +++ b/teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c @@ -13,130 +13,131 @@ static char MTEST_Descrip[] = "Test the handling of BSend operations when a detach occurs before the bsend data has been sent."; */ -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { int errs = 0; int rank, size, source, dest; unsigned char *buf, *bufp; - int minsize = 2; + int minsize = 2; int i, msgsize, bufsize, outsize; unsigned char *msg1, *msg2, *msg3; - MPI_Comm comm; - MPI_Status status1, status2, status3; + MPI_Comm comm; + MPI_Status status1, status2, status3; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); - /* The following illustrates the use of the routines to - run through a selection of communicators and datatypes. - Use subsets of these for tests that do not involve combinations - of communicators, datatypes, and counts of datatypes */ + /* The following illustrates the use of the routines to + * run through a selection of communicators and datatypes. + * Use subsets of these for tests that do not involve combinations + * of communicators, datatypes, and counts of datatypes */ msgsize = 128 * 1024; - msg1 = (unsigned char *)malloc( 3 * msgsize ); + msg1 = (unsigned char *) malloc(3 * msgsize); msg2 = msg1 + msgsize; msg3 = msg2 + msgsize; - while (MTestGetIntracommGeneral( &comm, minsize, 1 )) { - if (comm == MPI_COMM_NULL) continue; - /* Determine the sender and receiver */ - MPI_Comm_rank( comm, &rank ); - MPI_Comm_size( comm, &size ); - source = 0; - dest = size - 1; - - /* Here is the test: The sender */ - if (rank == source) { - /* Get a bsend buffer. Make it large enough that the Bsend - internals will (probably) not use a eager send for the data. - Have three such messages */ - bufsize = 3 * (MPI_BSEND_OVERHEAD + msgsize); - buf = (unsigned char *)malloc( bufsize ); - if (!buf) { - fprintf( stderr, "Unable to allocate a buffer of %d bytes\n", - bufsize ); - MPI_Abort( MPI_COMM_WORLD, 1 ); - } - - MPI_Buffer_attach( buf, bufsize ); - - /* Initialize the buffers */ - for (i=0; i