From 98dfa67e89bb99f3baee80a1364e4f3555b03abd Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 6 Oct 2003 10:17:09 -0500 Subject: [svn-r7551] Purpose: Bug/feature fix. Description: Relax restriction on parallel writing to compact datasets to allow partial I/O. Updates to reference manual mentioning the issues involved are delayed until reference manual 'lock' is removed later this week. Platforms tested: FreeBSD 4.9 (sleipnir) too minor to require h5committest --- release_docs/RELEASE.txt | 1 + src/H5Dio.c | 8 -------- testpar/t_mdset.c | 26 ++------------------------ 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 67f5957..0cbdfa7 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -76,6 +76,7 @@ Bug Fixes since HDF5-1.6.0 release Library ------- + - Allow partial parallel writing to compact datasets. QAK - 2003/10/06 - Correctly create reference to shared datatype in attribute, instead of making a copy of the shared datatype in the attribute. QAK - 2003/10/01 diff --git a/src/H5Dio.c b/src/H5Dio.c index 55e66fc..ff374ea 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -785,14 +785,6 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, if (doing_mpio && xfer_mode==H5FD_MPIO_COLLECTIVE && !IS_H5FD_MPI(dataset->ent.file)) HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPIO driver only") - /* If dataset is compact, collective access is only allowed when file space - * selection is H5S_ALL */ - if(doing_mpio && xfer_mode==H5FD_MPIO_COLLECTIVE - && dataset->layout.type==H5D_COMPACT) { - if(H5S_get_select_type(file_space) != H5S_SEL_ALL) - HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access to compact dataset doesn't support partial access") - } - /* Set the "parallel I/O possible" flag, for H5S_find() */ if (H5S_mpi_opt_types_g && IS_H5FD_MPIO(dataset->ent.file)) { /* Only collective write should call this since it eventually diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 3d40307..3bbad86 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -105,15 +105,13 @@ void multiple_dset_write(char *filename, int ndatasets) } /* Example of using PHDF5 to create, write, and read compact dataset. - * Hyperslab is prohibited for write. */ void compact_dataset(char *filename) { int i, j, mpi_size, mpi_rank, err_num=0; hbool_t use_gpfs = FALSE; - hid_t iof, plist, dcpl, dxpl, dataset, memspace, filespace; - hssize_t chunk_origin [DIM]; - hsize_t chunk_dims [DIM], file_dims [DIM]; + hid_t iof, plist, dcpl, dxpl, dataset, filespace; + hsize_t file_dims [DIM]={SIZE,SIZE}; hsize_t count[DIM]={1,1}; double outme [SIZE][SIZE], inme[SIZE][SIZE]; char dname[]="dataset"; @@ -127,11 +125,7 @@ void compact_dataset(char *filename) plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); - /* decide the hyperslab according to process number. */ - get_slab(chunk_origin, chunk_dims, count, file_dims); - /* Define data space */ - memspace = H5Screate_simple (DIM, chunk_dims, NULL); filespace = H5Screate_simple (DIM, file_dims, NULL); /* Create a compact dataset */ @@ -145,27 +139,12 @@ void compact_dataset(char *filename) dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl); VRFY((dataset >= 0), "H5Dcreate succeeded"); - /* Define hyperslab */ - ret = H5Sselect_hyperslab (filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); - VRFY((ret>=0), "mdata hyperslab selection"); - /* set up the collective transfer properties list */ dxpl = H5Pcreate (H5P_DATASET_XFER); VRFY((dxpl >= 0), ""); ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pcreate xfer succeeded"); - /* calculate data to write */ - for (i = 0; i < SIZE; i++) - for (j = 0; j < SIZE; j++) - outme [i][j] = (i+j)*1000 + mpi_rank; - - /* Test hyperslab writing. Supposed to fail */ - H5E_BEGIN_TRY { - ret=H5Dwrite(dataset, H5T_NATIVE_DOUBLE, memspace, filespace, dxpl, outme); - } H5E_END_TRY; - VRFY((ret < 0), "H5Dwrite hyperslab write failed as expected"); - /* Recalculate data to write. Each process writes the same data. */ for (i = 0; i < SIZE; i++) for (j = 0; j < SIZE; j++) @@ -178,7 +157,6 @@ void compact_dataset(char *filename) H5Pclose (plist); H5Dclose (dataset); H5Sclose (filespace); - H5Sclose (memspace); H5Fclose (iof); /* Open the file and dataset, read and compare the data. */ -- cgit v0.12