X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b73466ada27682d1729f394549479da83ef4a99..e947a76de27ef7ddb85e5e3a0953711e410533f1:/teshsuite/smpi/mpich3-test/pt2pt/bsendfrag.c diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsendfrag.c b/teshsuite/smpi/mpich3-test/pt2pt/bsendfrag.c index 8f22959218..55bf96cedb 100644 --- a/teshsuite/smpi/mpich3-test/pt2pt/bsendfrag.c +++ b/teshsuite/smpi/mpich3-test/pt2pt/bsendfrag.c @@ -18,12 +18,12 @@ different messages are received in different orders"; * Notes on the test. * * To ensure that messages remain in the bsend buffer until received, - * messages are sent with size MSG_SIZE (ints). + * messages are sent with size MSG_SIZE (ints). */ #define MSG_SIZE 17000 -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { int errs = 0; int b1[MSG_SIZE], b2[MSG_SIZE], b3[MSG_SIZE], b4[MSG_SIZE]; @@ -31,91 +31,99 @@ int main( int argc, char *argv[] ) MPI_Comm comm; MPI_Status status; - MTest_Init( &argc, &argv ); + MTest_Init(&argc, &argv); - MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN ); + MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN); comm = MPI_COMM_WORLD; - MPI_Comm_rank( comm, &rank ); - MPI_Comm_size( comm, &size ); + MPI_Comm_rank(comm, &rank); + MPI_Comm_size(comm, &size); if (size < 2) { - errs++; - fprintf( stderr, "At least 2 processes required\n" ); - MPI_Abort( MPI_COMM_WORLD, 1 ); + errs++; + fprintf(stderr, "At least 2 processes required\n"); + MPI_Abort(MPI_COMM_WORLD, 1); } - src = 0; + src = 0; dest = 1; if (rank == src) { - int *buf, bufsize, bsize; - - bufsize = 4 * (MSG_SIZE * sizeof(int) + MPI_BSEND_OVERHEAD); - buf = (int *)malloc( bufsize ); - if (!buf) { - fprintf( stderr, "Could not allocate buffer of %d bytes\n", - bufsize ); - MPI_Abort( MPI_COMM_WORLD, 1 ); - } - MPI_Buffer_attach( buf, bufsize ); - - /* Initialize data */ - for (i=0; i