diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2000-10-09 18:23:20 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2000-10-09 18:23:20 (GMT) |
commit | 61ab6a6b46adc58142e26c88e0196dfbb3efb9bc (patch) | |
tree | edf6be36bca36a7efab3b815cb7040517a459304 /testpar/t_dset.c | |
parent | a40a5bfeec79f10ada9f3ecfeebac0cc4b8d545f (diff) | |
download | hdf5-61ab6a6b46adc58142e26c88e0196dfbb3efb9bc.zip hdf5-61ab6a6b46adc58142e26c88e0196dfbb3efb9bc.tar.gz hdf5-61ab6a6b46adc58142e26c88e0196dfbb3efb9bc.tar.bz2 |
[svn-r2641] Purpose:
Added features
Description:
There were no automatic tests for transfering zero elements.
Solution:
t_dset.c:
Added two new patterns of ZROW (zero rows for process 0)
and ZCOL(zero columns for process 0).
ZROW test was added but it failed because the current library
does not accept it. Not compiled in now. Need to fix the
library before turning it back on again and also to add the
ZCOL test.
t_mdset.c:
Added statement to show progress. Also the MPI_Barrier() call
get processes synchornoized. It eliminates the racing condition
but this is not a permenant solution. The library code needs to
be fixed.
testphdf5.c:
Added a bunch of MPI_Type_XXX debug code. Added the -md
option to skip the multiple datasets tests. Changed the cosmitic
appearance of the banner messages.
testphdf5.h:
When an error is detected, the old way was to call MPI_Finalize()
before exiting. This sometimes hangs because some processes
may be waiting for a message of a different tag. Changed to
call MPI_Abort() for now so that the whole MPI job would
abort rather than hanging due resource limits exceeded.
Added the definition of ZROW and ZCOL.
Platforms tested:
Modi4 -64.
Diffstat (limited to 'testpar/t_dset.c')
-rw-r--r-- | testpar/t_dset.c | 54 |
1 files changed, 47 insertions, 7 deletions
diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 1bbc1a4..d2fb067 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -23,6 +23,10 @@ * Setup the dimensions of the hyperslab. * Two modes--by rows or by columns. * Assume dimension rank is 2. + * BYROW divide into slabs of rows + * BYCOL divide into blocks of columns + * ZROW same as BYROW except process 0 gets 0 rows + * ZCOL same as BYCOL except process 0 gets 0 columns */ void slab_set(int mpi_rank, int mpi_size, hssize_t start[], hsize_t count[], @@ -51,15 +55,32 @@ if (verbose) printf("slab_set BYROW\n"); count[1] = 1; start[0] = 0; start[1] = mpi_rank*block[1]; -#ifdef DISABLED - /* change the above macro to #ifndef if you want to test */ - /* zero elements access. */ - printf("set to size 0\n"); - if (!(mpi_rank % 3)) - block[1]=0; -#endif if (verbose) printf("slab_set BYCOL\n"); break; + case ZROW: + /* Similar to BYROW except process 0 gets 0 row */ + block[0] = (mpi_rank ? dim0/mpi_size : 0); + block[1] = dim1; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = (mpi_rank? mpi_rank*block[0] : 0); + start[1] = 0; +if (verbose) printf("slab_set ZROW\n"); + break; + case ZCOL: + /* Similar to BYCOL except process 0 gets 0 column */ + block[0] = dim0; + block[1] = (mpi_rank ? dim1/mpi_size : 0); + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = (mpi_rank? mpi_rank*block[1] : 0); +if (verbose) printf("slab_set ZCOL\n"); + break; default: /* Unknown mode. Set it to cover the whole dataset. */ printf("unknown slab_set mode (%d)\n", mode); @@ -551,10 +572,29 @@ dataset_writeAll(char *filename) VRFY((ret >= 0), "H5Pcreate xfer succeeded"); /* write data collectively */ + MESG("writeAll by Row"); ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); +#ifdef NEWSTUFF +printf("doing ZROW write\n"); + /* setup dimensions again to writeAll with zero rows for process 0 */ + slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW); + ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + /* need to make mem_dataspace to match for process 0 */ + if (MAINPROCESS){ + ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded"); + } + MESG("writeAll by Zero Row"); + ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded"); +#endif + + /* release all temporary handles. */ /* Could have used them for dataset2 but it is cleaner */ /* to create them again.*/ |