[svn-r1417] t_mpi.c:

Changed it to skip the test instead of aborting when there is not
    enough processes to do the test.  Also corrected an error in the
    error reporting printf statement.
t_dset.c:
testphdf5.c:
testphdf5.h:
    Added option for specifying chunk dimensions.
This commit is contained in:
Albert Cheng 1999-07-02 19:27:36 -05:00
parent 8ecbdd7050
commit 1b20703c20
4 changed files with 40 additions and 7 deletions

View File

@ -842,8 +842,8 @@ extend_writeInd(char *filename)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* setup chunk-size. Make sure sizes are > 0 */
chunk_dims[0] = (dim0+9)/10;
chunk_dims[1] = (dim1+9)/10;
chunk_dims[0] = chunkdim0;
chunk_dims[1] = chunkdim1;
/* allocate memory for data buffer */
data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE));

View File

@ -45,7 +45,12 @@ test_mpio_overlap_writes(char *filename[])
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* Need at least 2 processes */
VRFY((mpi_size >= 2), "Has at least 2 processes");
if (mpi_size < 2) {
if (MAINPROCESS)
printf("Need at least 2 processes to run MPIO test.\n");
printf(" -SKIP- \n");
return;
}
/* splits processes 0 to n-2 into one comm. and the last one into another */
color = ((mpi_rank < (mpi_size - 1)) ? 0 : 1);
@ -112,9 +117,11 @@ test_mpio_overlap_writes(char *filename[])
&mpi_stat);
VRFY((mrc==MPI_SUCCESS), "");
for (i=0; i<stride; i++){
if (buf[i] != ((mpi_off+i) & 0x7f))
printf("proc %d: found data error at [%d], expect %d, got %d\n",
mpi_rank, mpi_off+i, mpi_off & 0x7f, buf[0]);
char expected;
expected = (mpi_off+i) & 0x7f;
if (buf[i] != expected)
printf("proc %d: found data error at [%ld], expect %d, got %d\n",
mpi_rank, mpi_off+i, expected, buf[i]);
}
}

View File

@ -9,10 +9,13 @@
/* global variables */
int dim0 = DIM0;
int dim1 = DIM1;
int chunkdim0;
int chunkdim1;
int nerrors = 0; /* errors count */
int verbose = 0; /* verbose, default as no. */
#ifdef POOMA_ARCH
/* For the PFS of TFLOPS */
char *fileprefix = "pfs:/pfs_grande/multi/tmp_1/";
#else
char *fileprefix = NULL; /* file prefix, default as NULL */
@ -89,6 +92,7 @@ usage(void)
printf("\t-v\t\tverbose on\n");
printf("\t-f <prefix>\tfilename prefix\n");
printf("\t-d <dim0> <dim1>\tdataset dimensions\n");
printf("\t-c <dim0> <dim1>\tdataset chunk dimensions\n");
printf("\tDefault: do write then read with dimensions %dx%d\n",
DIM0, DIM1);
printf("\n");
@ -106,6 +110,10 @@ parse_options(int argc, char **argv)
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
/* setup default chunk-size. Make sure sizes are > 0 */
chunkdim0 = (dim0+9)/10;
chunkdim1 = (dim1+9)/10;
while (--argc){
if (**(++argv) != '-'){
break;
@ -135,6 +143,18 @@ parse_options(int argc, char **argv)
dim0 = atoi(*(++argv));
argc--;
dim1 = atoi(*(++argv));
/* set default chunkdim sizes too */
chunkdim0 = (dim0+9)/10;
chunkdim1 = (dim1+9)/10;
break;
case 'c': /* chunk dimensions */
if (--argc < 2){
nerrors++;
return(1);
}
chunkdim0 = atoi(*(++argv));
argc--;
chunkdim1 = atoi(*(++argv));
break;
case 'h': /* print help message--return with nerrors set */
return(1);
@ -144,12 +164,17 @@ parse_options(int argc, char **argv)
}
} /*while*/
/* check validity of dimension sizes */
/* check validity of dimension and chunk sizes */
if (dim0 <= 0 || dim1 <= 0){
printf("Illegal dim sizes (%d, %d)\n", dim0, dim1);
nerrors++;
return(1);
}
if (chunkdim0 <= 0 || chunkdim1 <= 0){
printf("Illegal chunkdim sizes (%d, %d)\n", chunkdim0, chunkdim1);
nerrors++;
return(1);
}
/* Make sure datasets can be divided into equal portions by the processes */
if ((dim0 % mpi_size) || (dim1 % mpi_size)){

View File

@ -64,6 +64,7 @@ typedef int DATATYPE;
/* shared global variables */
extern int dim0, dim1; /* Dataset dimensions */
extern int chunkdim0, chunkdim1; /* Chunk dimensions */
extern int nerrors; /* errors count */
extern int verbose; /* verbose, default as no. */
extern herr_t (*old_func)(void*); /* previous error handler */