Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Finish pulling changes from mpich trunk testsuite
[simgrid.git] / teshsuite / smpi / mpich3-test / pt2pt / sendrecv3.c
index 19ced11..4da5c86 100644 (file)
@@ -46,7 +46,7 @@ int main( int argc, char *argv[] )
            int *buf[MAX_NMSGS];
 
            for (i=0; i<nmsg; i++) {
-               buf[i] = (int *)malloc( msgSize );
+               buf[i] = (int *)malloc( msgSize * sizeof(int) );
                if (!buf[i]) {
                    fprintf( stderr, "Unable to allocate %d bytes\n", 
                             msgSize );
@@ -61,11 +61,11 @@ int main( int argc, char *argv[] )
                          MPI_STATUS_IGNORE );
            /* Try to fill up the outgoing message buffers */
            for (i=0; i<nmsg; i++) {
-               MPI_Isend( buf[i], msgSize, MPI_CHAR, partner, testnum, comm,
+               MPI_Isend( buf[i], msgSize, MPI_INT, partner, testnum, comm,
                           &r[i] );
            }
            for (i=0; i<nmsg; i++) {
-               MPI_Recv( buf[i], msgSize, MPI_CHAR, partner, testnum, comm,
+               MPI_Recv( buf[i], msgSize, MPI_INT, partner, testnum, comm,
                          MPI_STATUS_IGNORE );
            }
            MPI_Waitall( nmsg, r, MPI_STATUSES_IGNORE );
@@ -78,12 +78,12 @@ int main( int argc, char *argv[] )
            /* Try to fill up the outgoing message buffers */
            tsend = MPI_Wtime();
            for (i=0; i<nmsg; i++) {
-               MPI_Isend( buf[i], msgSize, MPI_CHAR, partner, testnum, comm,
+               MPI_Isend( buf[i], msgSize, MPI_INT, partner, testnum, comm,
                           &r[i] );
            }
            tsend = MPI_Wtime() - tsend;
            for (i=0; i<nmsg; i++) {
-               MPI_Recv( buf[i], msgSize, MPI_CHAR, partner, testnum, comm,
+               MPI_Recv( buf[i], msgSize, MPI_INT, partner, testnum, comm,
                          MPI_STATUS_IGNORE );
            }
            MPI_Waitall( nmsg, r, MPI_STATUSES_IGNORE );