diff options
Diffstat (limited to 'testpar')
-rw-r--r-- | testpar/t_chunk_alloc.c | 18 | ||||
-rw-r--r-- | testpar/testphdf5.c | 21 | ||||
-rw-r--r-- | testpar/testphdf5.h | 7 |
3 files changed, 14 insertions, 32 deletions
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index 250a63a..4c581f6 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -26,8 +26,7 @@ static int mpi_size, mpi_rank; #define DSET_NAME "ExtendibleArray" #define CHUNK_SIZE 1000 /* #elements per chunk */ -#define CHUNK_FACTOR 2000 /* default dataset size in terms of chunks */ -#define MIN_CHUNK_FACTOR 2 /* dataset size in terms of chunks if mpi_size reaches threshold */ +#define CHUNK_FACTOR 200 /* default dataset size in terms of chunks */ #define CLOSE 1 #define NO_CLOSE 0 @@ -111,10 +110,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_ /* Only MAINPROCESS should create the file. Others just wait. */ if (MAINPROCESS){ - if (mpi_size<PROCS_THRESHOLD) - nchunks=chunk_factor*mpi_size; - else - nchunks=MIN_CHUNK_FACTOR*(mpi_size-PROCS_THRESHOLD)+chunk_factor*PROCS_THRESHOLD; + nchunks=chunk_factor*mpi_size; dims[0]=nchunks*CHUNK_SIZE; /* Create the data space with unlimited dimensions. */ dataspace = H5Screate_simple (1, dims, maxdims); @@ -227,10 +223,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); - if (mpi_size<PROCS_THRESHOLD) - nchunks=chunk_factor*mpi_size; - else - nchunks=MIN_CHUNK_FACTOR*(mpi_size-PROCS_THRESHOLD)+chunk_factor*PROCS_THRESHOLD; + nchunks=chunk_factor*mpi_size; /* Set up MPIO file access property lists */ access_plist = H5Pcreate(H5P_FILE_ACCESS); @@ -361,10 +354,7 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); - if (mpi_size<PROCS_THRESHOLD) - nchunks=chunk_factor*mpi_size; - else - nchunks=MIN_CHUNK_FACTOR*(mpi_size-PROCS_THRESHOLD)+chunk_factor*PROCS_THRESHOLD; + nchunks=chunk_factor*mpi_size; /* Set up MPIO file access property lists */ access_plist = H5Pcreate(H5P_FILE_ACCESS); diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 977d0a3..c88d265 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -24,8 +24,8 @@ #endif /* !PATH_MAX */ /* global variables */ -int dim0 = DIM0; -int dim1 = DIM1; +int dim0; +int dim1; int chunkdim0; int chunkdim1; int nerrors = 0; /* errors count */ @@ -119,8 +119,8 @@ usage(void) printf("\t-f <prefix>\tfilename prefix\n"); printf("\t-2\t\tuse Split-file together with MPIO\n"); printf("\t-p\t\tuse combo MPI-POSIX driver\n"); - printf("\t-d <dim0> <dim1>\tdataset dimensions. Defaults (%d,%d)\n", - DIM0, DIM1); + printf("\t-d <factor0> <factor1>\tdataset dimensions factors. Defaults (%d,%d)\n", + ROW_FACTOR, COL_FACTOR); printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n"); printf("\n"); } @@ -138,13 +138,8 @@ parse_options(int argc, char **argv) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* setup default chunk-size. Make sure sizes are > 0 */ - if (mpi_size < PROCS_THRESHOLD) { - dim0 = ROW_FACTOR*mpi_size; - dim1 = COL_FACTOR*mpi_size; - } else { - dim0 = MIN_ROW_FACTOR*(mpi_size-PROCS_THRESHOLD)+ROW_FACTOR*PROCS_THRESHOLD; - dim1 = MIN_COL_FACTOR*(mpi_size-PROCS_THRESHOLD)+COL_FACTOR*PROCS_THRESHOLD; - } + dim0 = ROW_FACTOR*mpi_size; + dim1 = COL_FACTOR*mpi_size; chunkdim0 = (dim0+9)/10; chunkdim1 = (dim1+9)/10; @@ -192,9 +187,9 @@ parse_options(int argc, char **argv) nerrors++; return(1); } - dim0 = atoi(*(++argv)); + dim0 = atoi(*(++argv))*mpi_size; argc--; - dim1 = atoi(*(++argv)); + dim1 = atoi(*(++argv))*mpi_size; /* set default chunkdim sizes too */ chunkdim0 = (dim0+9)/10; chunkdim1 = (dim1+9)/10; diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 5f37313..24c4432 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -36,11 +36,8 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, /* Constants definitions */ #define DIM0 600 /* Default dataset sizes. */ #define DIM1 1200 /* Values are from a monitor pixel sizes */ -#define PROCS_THRESHOLD 32 /* Threshold for changing dimensions factors */ -#define ROW_FACTOR 20 /* Nominal row factor for dataset size */ -#define COL_FACTOR 40 /* Nominal column factor for dataset size */ -#define MIN_ROW_FACTOR 2 /* Row factor after threshold on processors */ -#define MIN_COL_FACTOR 4 /* Column factor after threshold on processors */ +#define ROW_FACTOR 8 /* Nominal row factor for dataset size */ +#define COL_FACTOR 16 /* Nominal column factor for dataset size */ #define RANK 2 #define DATASETNAME1 "Data1" #define DATASETNAME2 "Data2" |