19 Nov
2012
19 Nov
'12
9:36 a.m.
Author: gropp Date: 2012-11-19 09:36:49 -0600 (Mon, 19 Nov 2012) New Revision: 10611 Modified: mpich2/trunk/test/mpi/pt2pt/sendrecv3.c Log: Check for success in memory allocation Modified: mpich2/trunk/test/mpi/pt2pt/sendrecv3.c =================================================================== --- mpich2/trunk/test/mpi/pt2pt/sendrecv3.c 2012-11-14 17:20:14 UTC (rev 10610) +++ mpich2/trunk/test/mpi/pt2pt/sendrecv3.c 2012-11-19 15:36:49 UTC (rev 10611) @@ -46,6 +46,11 @@ for (i=0; i<nmsg; i++) { buf[i] = (int *)malloc( msgSize ); + if (!buf[i]) { + fprintf( stderr, "Unable to allocate %d bytes\n", + msgSize ); + MPI_Abort( MPI_COMM_WORLD, 1 ); + } } partner = (rank + 1) % size;
4996
Age (days ago)
4996
Last active (days ago)
0 comments
1 participants
participants (1)
-
gropp@mcs.anl.gov