write(*, 239) np1*np2, np
239 format(' Product is ', i5, ' and should be ', i5)
call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
+ stop
endif
c---------------------------------------------------------------------
240 format(' Layout type specified in inputft.data is
> invalid ')
call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
+ stop
endif
c---------------------------------------------------------------------
write(*, 241)
241 format(' For 0D layout, both np1 and np2 must be 1 ')
call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
+ stop
endif
c---------------------------------------------------------------------
c 4. 1D layout must be 1xN grid
write(*, 242)
242 format(' For 1D layout, np1 must be 1 ')
call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
+ stop
endif
else
write(*, 11) np
11 format(' Only ', i5, ' processors found ')
call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
+ stop
endif
234 format(' No input file inputft.data. Using compiled defaults')
perror("can't allocate send buffer");
fflush(stderr);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
rb = (int *) malloc(size * sizeof(int));
if (!rb) {
fflush(stderr);
free(sb);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
for (i = 0; i < size; ++i) {
sb[i] = rank + 1;
{
fprintf( stderr, "%s, err = %d\n", str, code );
MPI_Abort( MPI_COMM_WORLD, code );
+ exit(code);
}
int test_communicators( void )
{
fprintf( stderr, "%s, err = %d\n", str, code );
MPI_Abort( MPI_COMM_WORLD, code );
+ exit(code);
}
int test_communicators( void )
{
fprintf( stderr, "%s, err = %d\n", str, code );
MPI_Abort( MPI_COMM_WORLD, code );
+ exit(code);
}
int test_attrs( void )
if ((MPI_Aint)attribute_val != (MPI_Aint)world_rank) {
printf( "incorrect attribute value %d\n", *(int*)attribute_val );
MPI_Abort(MPI_COMM_WORLD, 1005 );
+ exit(1005);
}
return MPI_SUCCESS;
}
printf( "dup_comm key_1 not found on %d\n", world_rank );
fflush( stdout );
MPI_Abort(MPI_COMM_WORLD, 3004 );
+ exit(3004);
}
if (value != world_rank) {
printf( "dup_comm key_1 value incorrect: %ld\n", (long)value );
fflush( stdout );
MPI_Abort(MPI_COMM_WORLD, 3005 );
+ exit(3005);
}
MPI_Attr_get(dup_comm, key_3, (void **)&vvalue, &flag );
printf( "dup_comm key_3 found!\n" );
fflush( stdout );
MPI_Abort(MPI_COMM_WORLD, 3008 );
+ exit(3008);
}
MTestPrintfMsg(1, "Keyval_free key=%#x\n", key_1);
MPI_Keyval_free(&key_1 );
if ((MPI_Aint)attribute_val != (MPI_Aint)world_rank) {
printf( "incorrect attribute value %d\n", *(int*)attribute_val );
MPI_Abort(MPI_COMM_WORLD, 1005 );
+ exit(1005);
}
return MPI_SUCCESS;
}
errs++;
printf( "incorrect rank in world comm: %d\n", rank );
MPI_Abort(MPI_COMM_WORLD, 3001 );
+ exit(3001);
}
n = world_size / 2;
errs++;
printf( "incorrect lo group rank: %d\n", rank ); fflush(stdout);
MPI_Abort(MPI_COMM_WORLD, 3002 );
+ exit(3002);
}
else {
/* printf( "lo in\n" );FFLUSH; */
errs++;
printf( "rank : %d incorrect lo comm:\n", rank ); fflush(stdout);
MPI_Abort(MPI_COMM_WORLD, 3003 );
+ exit(3003);
}
}
printf( "dup_comm key_1 not found on %d\n", world_rank );
fflush( stdout );
MPI_Abort(MPI_COMM_WORLD, 3004 );
+ exit(3004);
}
if (value != world_rank) {
(long)value, world_rank );
fflush( stdout );
MPI_Abort(MPI_COMM_WORLD, 3005 );
+ exit(3005);
}
MPI_Attr_get(dup_comm, key_3, (void **)&vvalue, &flag );
printf( "dup_comm key_3 found!\n" );
fflush( stdout );
MPI_Abort(MPI_COMM_WORLD, 3008 );
+ exit(3008);
}
MPI_Keyval_free(&key_1 );
MPI_Keyval_free(&key_3 );
errs++;
printf( "incorrect split rank: %d\n", rank ); fflush(stdout);
MPI_Abort(MPI_COMM_WORLD, 3009 );
+ exit(3009);
}
MPI_Barrier(split_comm );
errs++;
printf( "incorrect ident result: %d\n", result );
MPI_Abort(MPI_COMM_WORLD, 3010 );
+ exit(3010);
}
if (lo_comm != MPI_COMM_NULL) {
errs++;
printf( "incorrect congruent result: %d\n", result );
MPI_Abort(MPI_COMM_WORLD, 3011 );
+ exit(3011);
}
}
errs++;
printf( "incorrect similar result: %d\n", result );
MPI_Abort(MPI_COMM_WORLD, 3012 );
+ exit(3012);
}
if (lo_comm != MPI_COMM_NULL) {
errs++;
printf( "incorrect unequal result: %d\n", result );
MPI_Abort(MPI_COMM_WORLD, 3013 );
+ exit(3013);
}
}
/*
if (!displs) fprintf(stderr,"\tdispls of %zd bytes\n", comm_size * sizeof(int) );
fflush(stderr);
MPI_Abort(MPI_COMM_WORLD, -1);
+ exit(-1);
}
if (!comm_rank) {
if (tmp != (int)tmp) {
fprintf( stderr, "Integer overflow in variable tmp\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
recvcounts[i] = (int) tmp;
if (size < 2) {
fprintf( stderr, "At least 2 processes required\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
/* Set errors return so that we can provide better information
if (count <= 0) {
fprintf( stderr, "Invalid count argument %s\n", argv[1] );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
}
buf = (int *)malloc( max_offset * sizeof(int) );
if (!buf) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
bufout = (int *)malloc( max_offset * sizeof(int) );
if (!bufout) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
initMat( comm, buf );
buf = (int *)malloc( count * 9 * sizeof(int) );
if (!buf) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
bufout = (int *)malloc( count * 9 * sizeof(int) );
if (!bufout) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i < count; i++) {
fprintf( stderr, "Unable to allocated space for buffers (%d)\n",
count );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i<count; i++) {
bufin[i] = i;
errs++;
fprintf( stderr, "Failed to allocate sendbuf and/or recvbuf\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i<count*size; i++)
recvbuf[i] = -1;
if (!sbuf || !rbuf) {
fprintf( stderr, "Could not allocated buffers!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Load up the buffers */
if (!sendcounts || !recvcounts || !rdispls || !sdispls) {
fprintf( stderr, "Could not allocate arg items!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
for (i=0; i<size; i++) {
sendcounts[i] = i;
if (!rbuf) {
fprintf( stderr, "Could not reallocate rbuf!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Load up the buffers */
if (!sendcounts || !recvcounts || !rdispls || !sdispls) {
fprintf( stderr, "Could not allocate arg items!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Get the neighbors */
if (!sbuf || !rbuf) {
fprintf( stderr, "Could not allocate buffers!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Load up the buffers */
if (!sbuf || !rbuf) {
fprintf( stderr, "Could not allocated buffers!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Load up the buffers */
if (!sendcounts || !recvcounts || !rdispls || !sdispls || !sendtypes || !recvtypes) {
fprintf( stderr, "Could not allocate arg items!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Note that process 0 sends no data (sendcounts[0] = 0) */
for (i=0; i<size; i++) {
if (!rbuf) {
fprintf( stderr, "Could not reallocate rbuf!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Load up the buffers */
fprintf(stderr,"Unrecognized argument %s\n",
argv[i]);
MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
}
if ( !sb ) {
perror( "can't allocate send buffer" );
MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
rb = (int *)malloc(size*chunk*sizeof(int));
if ( !rb ) {
perror( "can't allocate recv buffer");
free(sb);
MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
+ exit(EXIT_FAILURE);
}
for ( i=0 ; i < size*chunk ; ++i ) {
sb[i] = rank + 1;
fprintf( stderr, "Number of processors must divide %d\n",
MAX_PROCESSES );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
if ( (rank < participants) ) {
fprintf( stderr, "Number of processors must divide %d\n",
MAX_PROCESSES );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
if ( (rank < participants) ) {
fprintf( stderr, "Number of processors must divide %d\n",
MAX_PROCESSES );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Comm_split(MPI_COMM_WORLD, rank<participants, rank, &test_comm);
fprintf( stderr, "Number of processors must divide %d\n",
MAX_PROCESSES );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
/* while (MAX_PROCESSES % participants) participants--; */
if ( (rank < participants) ) {
if (!sbuf || !rbuf) {
fprintf( stderr, "Could not allocated buffers!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Load up the buffers */
if (!sendcounts || !recvcounts || !rdispls || !sdispls) {
fprintf( stderr, "Could not allocate arg items!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
for (i=0; i<size; i++) {
sendcounts[i] = i;
if (!sbuf || !rbuf) {
fprintf( stderr, "Could not allocated buffers!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Load up the buffers */
if (!sendcounts || !recvcounts || !rdispls || !sdispls || !sendtypes || !recvtypes) {
fprintf( stderr, "Could not allocate arg items!\n" );
MPI_Abort( comm, 1 );
+ exit(1);
}
/* Note that process 0 sends no data (sendcounts[0] = 0) */
for (i=0; i<size; i++) {
if (!(cond_)) { \
fprintf(stderr, "assertion (%s) failed, aborting\n", #cond_); \
MPI_Abort(MPI_COMM_WORLD, 1); \
+ exit(1); \
} \
} while (0)
if (!(cond_)) { \
fprintf(stderr, "assertion (%s) failed, aborting\n", #cond_); \
MPI_Abort(MPI_COMM_WORLD, 1); \
+ exit(1); \
} \
} while (0)
default:
fprintf(stderr, "unexpected value for l->case_num=%d)\n", (l->case_num));
MPI_Abort(comm, 1);
+ exit(1);
break;
}
}
MPI_Type_commit( &mattype );
buf = (int *)malloc( count * size * size * sizeof(int) );
- if (!buf) MPI_Abort( MPI_COMM_WORLD, 1 );
+ if (!buf) {
+ MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
+ }
bufout = (int *)malloc( count * size * size * sizeof(int) );
- if (!bufout) MPI_Abort( MPI_COMM_WORLD, 1 );
+ if (!bufout) {
+ MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
+ }
for (root = 0; root < size; root ++) {
initMat( comm, buf );
MPI_Type_commit( &mattype );
buf = (int *)malloc( count * size * size * sizeof(int) );
- if (!buf) MPI_Abort( MPI_COMM_WORLD, 1 );
+ if (!buf) {
+ MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
+ }
bufout = (int *)malloc( count * size * size * sizeof(int) );
- if (!bufout) MPI_Abort( MPI_COMM_WORLD, 1 );
+ if (!bufout) {
+ MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
+ }
for (root = 0; root < size; root ++) {
initMat( comm, buf );
err++;
fprintf(stderr, "unable to allocate send/recv buffers, aborting");
MPI_Abort(MPI_COMM_WORLD, 1);
+ exit(1);
}
for (i=0; i<size; i++)
sendbuf[i] = rank + i;
fprintf( stderr, "Could not allocate %d ints for recvcounts\n",
size );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
mycount = (1024 * 1024) / size;
for (i=0; i<size; i++)
fprintf( stderr, "Could not allocate %d ints for sendbuf\n",
mycount * size );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
idx = 0;
for (i=0; i<size; i++) {
fprintf( stderr, "Could not allocate %d ints for recvbuf\n",
mycount );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i<mycount; i++) {
recvbuf[i] = -1;
fprintf( stderr, "Could not allocate %d ints for sendbuf\n",
sendcount );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i<sendcount; i++) {
fprintf( stderr, "Could not allocate %d ints for recvbuf\n",
recvcount );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i<recvcount; i++) {
recvbuf[i] = (long long)(-i);
fprintf( stderr, "Could not allocate %d ints for sendbuf\n",
mycount * size );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
idx = 0;
for (i=0; i<size; i++) {
fprintf( stderr, "Could not allocate %d ints for recvbuf\n",
mycount );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Reduce_scatter_block( sendbuf, recvbuf, mycount, MPI_INT, MPI_SUM,
fprintf( stderr, "Could not allocate %d int for recvcounts\n",
size );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i<size; i++)
recvcounts[i] = recvcount;
fprintf( stderr, "Could not allocate %d ints for sendbuf\n",
sendcount );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i<sendcount; i++) {
fprintf( stderr, "Could not allocate %d ints for recvbuf\n",
recvcount );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i<recvcount; i++) {
recvbuf[i] = (long long)(-i);
recvbuf = (double *)malloc( nx * ny * sizeof(double) );
if (!recvbuf) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
sendbuf = 0;
if (myrow == 0 && mycol == 0) {
sendbuf = (double *)malloc( nx * ny * size * sizeof(double) );
if (!sendbuf) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
}
sendcounts = (int *) malloc( size * sizeof(int) );
fprintf( stderr, "Unable to allocated %d words for data\n",
3 * count );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (i=0; i<count*3; i++) {
outVal[i] = -1;
if (size < 2) {
fprintf( stderr, "This test requires at least two processes." );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
source = 0;
if (size < 4) {
fprintf( stderr, "This test requires at least four processes." );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
color = MPI_UNDEFINED;
if (size % 2) {
fprintf(stderr, "this program requires a multiple of 2 number of processes\n");
MPI_Abort(MPI_COMM_WORLD, 1);
+ exit(1);
}
excl = malloc((size / 2) * sizeof(int));
if (size < 2) {
printf("this test requires at least 2 processes\n");
MPI_Abort(MPI_COMM_WORLD, 1);
+ exit(1);
}
#ifdef TEST_IDUP
fprintf( stderr, "%s: errcode = %d, class = %d, msg = %s\n",
str, code, class, msg );
MPI_Abort( MPI_COMM_WORLD, code );
+ exit(code);
}
int main( int argc, char *argv[] )
if (size < 2) {
printf( "Size must be at least 2\n" );
MPI_Abort( MPI_COMM_WORLD, 0 );
+ exit(0);
}
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
if (size < 33) {
printf("ERROR: this test requires at least 33 processes\n");
MPI_Abort(MPI_COMM_WORLD, 1);
- return 1;
+ exit(1);
}
/* group of c0
if (size < 4) {
printf( "This test requires at least 4 processes\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
if (size < 4) {
printf( "This test requires at least 4 processes\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
while (MTestGetIntercomm( &intercomm, &isLeft, 2 )) {
if (size < 2) {
fprintf( stderr, "This test requires at least two processes." );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
while (MTestGetIntercomm( &intercomm, &isLeft, 2 )) {
/* Test 1: Simple, 1-D cyclic decomposition */
if (AllocateGrid( 1, 3*wsize, &srcArray, &destArray ) ) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
/* Simple cyclic with 1-dim global array */
if (PackUnpack( darraytype, srcArray, destArray, 3 )) {
fprintf( stderr, "Error in pack/unpack check\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
/* Now, check for correct data */
for (i=0; i<3; i++) {
/* Test 2: Simple, 1-D cyclic decomposition, with block size=2 */
if (AllocateGrid( 1, 4*wsize, &srcArray, &destArray ) ) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
/* Simple cyclic with 1-dim global array */
if (PackUnpack( darraytype, srcArray, destArray, 4 )) {
fprintf( stderr, "Error in pack/unpack check\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
loc = 0;
/* for each cyclic element */
if (px * py != wsize) {
fprintf( stderr, "An even number of processes is required\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
/* Cyclic/Cyclic */
if (AllocateGrid( 5*px, 7*py, &srcArray, &destArray )) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
/* Simple cyclic/cyclic. Note in C order, the [1] index varies most
if (PackUnpack( darraytype, srcArray, destArray, 5*7 )) {
fprintf( stderr, "Error in pack/unpack check\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
loc = 0;
/* Cyclic(2)/Cyclic(3) */
if (AllocateGrid( 6*px, 4*py, &srcArray, &destArray )) {
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
/* Block cyclic/cyclic. Note in C order, the [1] index varies most
if (PackUnpack( darraytype, srcArray, destArray, 4*6 )) {
fprintf( stderr, "Error in pack/unpack check\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
loc = 0;
fprintf( stderr, "Unable to allocate pack array of size %d\n",
packsize );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
position = 0;
MPI_Pack( (int*)srcArray, 1, darraytype, packArray, packsize, &position,
errs++;
printf( "This test requires at least 2 processes\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
src = 0;
{
fprintf(stderr, "Could not make struct type."), fflush(stderr);
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
memset(s_buf, 0, EL_COUNT*SIZE);
if (size < 2) {
fprintf( stderr, "This test requires at least two processes." );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
source = 0;
buf = (int *)malloc( count * 3 * sizeof(int) );
if (!buf) {
MPI_Abort( comm, 1 );
+ exit(1);
}
for (i=0; i<3*count; i++) buf[i] = -1;
if (rank == source) {
buf = (int *)malloc( count * 3 * sizeof(int) );
if (!buf) {
MPI_Abort( comm, 1 );
+ exit(1);
}
for (i=0; i<3*count; i++) buf[i] = -1;
if (rank == source) {
if (size .lt. 2) then
print *, "Must have at least 2 processes"
call MPI_Abort( 1, MPI_COMM_WORLD, ierr )
+ stop
endif
errs = 0
if (size .lt. 2) then
print *, "Must have at least 2 processes"
call MPI_Abort( 1, MPI_COMM_WORLD, ierr )
+ stop
endif
comm = MPI_COMM_WORLD
"This test requires a comm world with no more than %d processes\n",
MAX_WORLD_SIZE );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
if (size < 4) {
fprintf( stderr, "This test requiers at least 4 processes\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Comm_group( comm, &gworld );
if (!ranks || !ranksout) {
fprintf(stderr, "out of memory\n");
MPI_Abort(MPI_COMM_WORLD, 1);
+ exit(1);
}
/* generate a comm with the rank order reversed */
errs++;
fprintf( stderr, "This test requires at least two processes\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
source = 0;
dest = 1;
errs++;
fprintf( stderr, "At least 2 processes required\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
src = 0;
fprintf( stderr, "Could not allocate buffer of %d bytes\n",
bufsize );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Buffer_attach( buf, bufsize );
fprintf( stderr, "Unable to allocate a buffer of %d bytes\n",
bufsize );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Buffer_attach( buf, bufsize );
if (size < 2) {
fprintf( stderr, "Must run with at least 2 processes\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
fprintf( stderr, "Unable to allocate buffers of size %d\n",
n0 * (int)sizeof(int) );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
memset( buf0, -1, n0 * sizeof(int) );
memset( buf1, -1, n0 * sizeof(int) );
fprintf( stderr, "Unable to allocate buffer %d of size %ld\n",
i, (long)extent );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
}
buf = (int *)malloc( 10 * 30 * sizeof(int) );
if (size != 3) {
fprintf(stderr,"[%d] usage: mpiexec -n 3 %s\n",rank,argv[0]);
MPI_Abort(MPI_COMM_WORLD,1);
+ exit(1);
}
cols = malloc(cnt*sizeof(long long));
if (size < 2) {
printf("this test requires at least 2 processes\n");
MPI_Abort(MPI_COMM_WORLD, 1);
+ exit(1);
}
/* all processes besides ranks 0 & 1 aren't used by this test */
if (!buf) {
fprintf( stderr, "Unable to allocate %d bytes\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Send_init( buf, n, MPI_CHAR, dest, cs+n+1, comm, &req );
MPI_Start( &req );
{
fprintf( stderr, "Unable to allocate %d bytes\n", nn);
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
free(btemp);
if (!buf) {
fprintf( stderr, "Unable to allocate %d bytes\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
bsendbufsize = n + MPI_BSEND_OVERHEAD;
bsendbuf = (char *)malloc( bsendbufsize );
if (!bsendbuf) {
fprintf( stderr, "Unable to allocate %d bytes for bsend\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Buffer_attach( bsendbuf, bsendbufsize );
MPI_Bsend_init( buf, n, MPI_CHAR, dest, cs+n+2, comm, &req );
{
fprintf( stderr, "Unable to allocate %d bytes\n", nn);
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
free(btemp);
if (!buf) {
fprintf( stderr, "Unable to allocate %d bytes\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Rsend_init( buf, n, MPI_CHAR, dest, cs+n+3, comm, &req );
MPI_Start( &req );
{
fprintf( stderr, "Unable to allocate %d bytes\n", n);
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Recv( btemp, n, MPI_CHAR, 0, tag, comm, &status );
free(btemp);
if (!buf) {
fprintf( stderr, "Unable to allocate %d bytes\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Ssend_init( buf, n, MPI_CHAR, dest, cs+n+4, comm, &req );
MPI_Start( &req );
{
fprintf( stderr, "Unable to allocate %d bytes\n", nn);
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
free(btemp);
if (dest > r) r = dest;
fprintf( stderr, "This program requires %d processes\n", r-1 );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
if (rank == src) {
if (!buf) {
fprintf( stderr, "Unable to allocate %d bytes\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MTestPrintfMsg( 1, "(%d) About to create isend and cancel\n",cs );
MPI_Isend( buf, n, MPI_CHAR, dest, cs+n+1, comm, &req );
{
fprintf( stderr, "Unable to allocate %d bytes\n", nn );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
free(btemp);
if (!buf) {
fprintf( stderr, "Unable to allocate %d bytes\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
bsendbufsize = n + MPI_BSEND_OVERHEAD;
bsendbuf = (char *)malloc( bsendbufsize );
if (!bsendbuf) {
fprintf( stderr, "Unable to allocate %d bytes for bsend\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Buffer_attach( bsendbuf, bsendbufsize );
MTestPrintfMsg( 1, "About to create and cancel ibsend\n" );
{
fprintf( stderr, "Unable to allocate %d bytes\n", nn);
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
free(btemp);
if (!buf) {
fprintf( stderr, "Unable to allocate %d bytes\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MTestPrintfMsg( 1, "About to create and cancel irsend\n" );
MPI_Irsend( buf, n, MPI_CHAR, dest, cs+n+3, comm, &req );
{
fprintf( stderr, "Unable to allocate %d bytes\n", n);
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Recv( btemp, n, MPI_CHAR, 0, tag, comm, &status );
free(btemp);
if (!buf) {
fprintf( stderr, "Unable to allocate %d bytes\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MTestPrintfMsg( 1, "About to create and cancel issend\n" );
MPI_Issend( buf, n, MPI_CHAR, dest, cs+n+4, comm, &req );
{
fprintf( stderr, "Unable to allocate %d bytes\n", nn);
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
free(btemp);
if (!buf) {
fprintf( stderr, "Unable to allocate %d bytes\n", n );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
if (rank == source) {
fprintf( stderr, "This program requires a comm_world no larger than %d",
MAXPES );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (size = 1; size <= MYBUFSIZE ; size += size) {
if (size < 2) {
printf( "This test requires at least 2 processes\n" );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
for (testnum=0; msgsizes[testnum] > 0; testnum++) {
fprintf( stderr, "Unable to allocate %d bytes\n",
msgSize );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
}
partner = (rank + 1) % size;
fprintf( stderr, "%s\n", msg );
fflush( stderr );
MPI_Abort( MPI_COMM_WORLD, 1 );
+ exit(1);
}
/* ------------------------------------------------------------------------ */
static void MTestResourceSummary( FILE *fp )