/* 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,