X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/aac4ba41ea27fe8168bebed009abebd7e5c3f006..4cdc0f888550cbaefe6094ae801230336d005337:/teshsuite/smpi/mpich3-test/rma/putfidx.c diff --git a/teshsuite/smpi/mpich3-test/rma/putfidx.c b/teshsuite/smpi/mpich3-test/rma/putfidx.c index 6a23eb2d7e..8064d4adf5 100644 --- a/teshsuite/smpi/mpich3-test/rma/putfidx.c +++ b/teshsuite/smpi/mpich3-test/rma/putfidx.c @@ -15,111 +15,108 @@ static char MTEST_Descrip[] = "Put with Fence for an indexed datatype"; */ -int CheckMPIErr( int err ); +int CheckMPIErr(int err); -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { - int errs = 0, err; - int i, rank, size, source, dest; - int blksize, totsize; - int *recvBuf = 0, *srcBuf = 0; - MPI_Comm comm; - MPI_Win win; - MPI_Aint extent; - MPI_Datatype originType; - int counts[2]; - int displs[2]; - - MTest_Init( &argc, &argv ); + int errs = 0, err; + int i, rank, size, source, dest; + int blksize, totsize; + int *recvBuf = 0, *srcBuf = 0; + MPI_Comm comm; + MPI_Win win; + MPI_Aint extent; + MPI_Datatype originType; + int counts[2]; + int displs[2]; + + MTest_Init(&argc, &argv); /* Select the communicator and datatypes */ comm = MPI_COMM_WORLD; /* Create the datatype */ - /* One MPI Implementation fails this test with sufficiently large - values of blksize - it appears to convert this type to an - incorrect contiguous move */ + /* One MPI Implementation fails this test with sufficiently large + * values of blksize - it appears to convert this type to an + * incorrect contiguous move */ blksize = 2048; counts[0] = blksize; counts[1] = blksize; displs[0] = 0; displs[1] = blksize + 1; - MPI_Type_indexed( 2, counts, displs, MPI_INT, &originType ); - MPI_Type_commit( &originType ); + MPI_Type_indexed(2, counts, displs, MPI_INT, &originType); + MPI_Type_commit(&originType); totsize = 2 * blksize; /* Determine the sender and receiver */ - MPI_Comm_rank( comm, &rank ); - MPI_Comm_size( comm, &size ); + MPI_Comm_rank(comm, &rank); + MPI_Comm_size(comm, &size); source = 0; - dest = size - 1; - - recvBuf = (int *) malloc( totsize * sizeof(int) ); - srcBuf = (int *) malloc( (totsize + 1) * sizeof(int) ) ; - + dest = size - 1; + + recvBuf = (int *) malloc(totsize * sizeof(int)); + srcBuf = (int *) malloc((totsize + 1) * sizeof(int)); + if (!recvBuf || !srcBuf) { - fprintf( stderr, "Could not allocate buffers\n" ); - MPI_Abort( MPI_COMM_WORLD, 1 ); + fprintf(stderr, "Could not allocate buffers\n"); + MPI_Abort(MPI_COMM_WORLD, 1); } - + /* Initialize the send and recv buffers */ - for (i=0; i