summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_dset.c4
-rw-r--r--testpar/t_mpi.c15
-rw-r--r--testpar/testphdf5.c27
-rw-r--r--testpar/testphdf5.h1
4 files changed, 40 insertions, 7 deletions
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 6dfdaca..81c6030 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -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));
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 0d6d390..dbcfada 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -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]);
}
}
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index afbc9fb..184c9a5 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -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)){
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h
index a8a6daf..dd4db92 100644
--- a/testpar/testphdf5.h
+++ b/testpar/testphdf5.h
@@ -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 */