From 12f8879c407478ab7cb7c60e1c37554cf370c175 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 13 Sep 2002 11:57:46 -0500 Subject: [svn-r5926] Purpose: API name change Description: Change all "space time" references to "alloc time", including API functions and macro definitions, etc. Platforms tested: FreeBSD 4.6 (sleipnir) w/C++ Solaris 2.7 (arabica) w/FORTRAN IRIX64 6.5 (modi4) w/parallel & FORTRAN --- release_docs/RELEASE.txt | 5 +++- src/H5D.c | 76 ++++++++++++++++++++++++------------------------ src/H5Dprivate.h | 6 ++-- src/H5Dpublic.h | 14 ++++----- src/H5Ofill.c | 8 ++--- src/H5Oprivate.h | 2 +- src/H5Pdcpl.c | 24 ++++++++------- src/H5Ppublic.h | 4 +-- test/dsets.c | 4 +-- test/fillval.c | 38 ++++++++++++------------ test/tmisc.c | 48 +++++++++++++++--------------- testpar/t_mdset.c | 2 +- 12 files changed, 118 insertions(+), 113 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index eedb385..eaf75f5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -221,10 +221,13 @@ Documentation New Features ============ + * Changed "H5P[set|get]_space_time" functions to "H5P[set|get]_alloc_time" + Unify all symbolic names for these functions to use "alloc time" instead + of other names. QAK - 2002/09/13 * Added "H5D_SPACE_ALLOC_INCR" setting to H5D_SPACE_ALLOC_EARLY and H5D_SPACE_ALLOC_LATE for H5Dset_space_time(). This allows chunked datasets to be incrementally allocated as in the 1.4.x branch. - QAK - 2007/08/27 + QAK - 2002/08/27 * Compact dataset is added to the library. The data will be stored in the header message of dataset layout. Space allocation time has to be EARLY. No hyperslab is supported for parallel collective write. There diff --git a/src/H5D.c b/src/H5D.c index 0a3b78c..b532221 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -66,7 +66,7 @@ typedef enum { H5D_ALLOC_OPEN, /* Dataset is being opened */ H5D_ALLOC_EXTEND, /* Dataset's dataspace is being extended */ H5D_ALLOC_WRITE /* Dataset is being extended */ -} H5D_alloc_time_t; +} H5D_time_alloc_t; /* Interface initialization */ static int interface_initialize_g = 0; @@ -74,7 +74,7 @@ static int interface_initialize_g = 0; /* Local functions */ static herr_t H5D_init_interface(void); -static herr_t H5D_alloc_storage (H5F_t *f, H5D_t *dset,H5D_alloc_time_t alloc_time); +static herr_t H5D_alloc_storage (H5F_t *f, H5D_t *dset,H5D_time_alloc_t time_alloc); static herr_t H5D_init_storage(H5D_t *dataset); H5D_t * H5D_new(hid_t dcpl_id); static herr_t H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, @@ -193,7 +193,7 @@ H5D_init_interface(void) int chunk_ndims = H5D_CRT_CHUNK_DIM_DEF; hsize_t chunk_size[32] = H5D_CRT_CHUNK_SIZE_DEF; H5O_fill_t fill = H5D_CRT_FILL_VALUE_DEF; - H5D_space_time_t space_time = H5D_CRT_SPACE_TIME_DEF; + H5D_alloc_time_t alloc_time = H5D_CRT_ALLOC_TIME_DEF; H5D_fill_time_t fill_time = H5D_CRT_FILL_TIME_DEF; H5O_efl_t efl = H5D_CRT_EXT_FILE_LIST_DEF; H5O_pline_t pline = H5D_CRT_DATA_PIPELINE_DEF; @@ -318,7 +318,7 @@ H5D_init_interface(void) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class"); /* Register the space allocation time property */ - if(H5P_register(crt_pclass, H5D_CRT_SPACE_TIME_NAME, H5D_CRT_SPACE_TIME_SIZE, &space_time, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + if(H5P_register(crt_pclass, H5D_CRT_ALLOC_TIME_NAME, H5D_CRT_ALLOC_TIME_SIZE, &alloc_time, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class"); /* Register the fill value writing time property */ @@ -1524,10 +1524,10 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, H5D_layout_t dcpl_layout; int chunk_ndims = 0; hsize_t chunk_size[32]={0}; - H5D_space_time_t space_time; + H5D_alloc_time_t alloc_time; H5D_fill_time_t fill_time; H5O_fill_t fill_prop={NULL,0,NULL}; - H5O_fill_new_t fill={NULL, 0, NULL, H5D_SPACE_ALLOC_LATE, H5D_FILL_TIME_ALLOC, TRUE}; + H5O_fill_new_t fill={NULL, 0, NULL, H5D_ALLOC_TIME_LATE, H5D_FILL_TIME_ALLOC, TRUE}; H5D_fill_value_t fill_status; H5P_genplist_t *plist; /* Property list */ H5P_genplist_t *new_plist; /* New Property list */ @@ -1550,22 +1550,22 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve layout"); if(dcpl_pline.nfilters > 0 && H5D_CHUNKED != dcpl_layout) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "filters can only be used with chunked layout"); - if(H5P_get(plist, H5D_CRT_SPACE_TIME_NAME, &space_time) < 0) + if(H5P_get(plist, H5D_CRT_ALLOC_TIME_NAME, &alloc_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve space allocation time"); - /* Check if the space_time is the default and set it accordingly */ - if(space_time==H5D_SPACE_ALLOC_DEFAULT) { + /* Check if the alloc_time is the default and set it accordingly */ + if(alloc_time==H5D_ALLOC_TIME_DEFAULT) { switch(dcpl_layout) { case H5D_COMPACT: - space_time=H5D_SPACE_ALLOC_EARLY; + alloc_time=H5D_ALLOC_TIME_EARLY; break; case H5D_CONTIGUOUS: - space_time=H5D_SPACE_ALLOC_LATE; + alloc_time=H5D_ALLOC_TIME_LATE; break; case H5D_CHUNKED: - space_time=H5D_SPACE_ALLOC_INCR; + alloc_time=H5D_ALLOC_TIME_INCR; break; default: @@ -1574,7 +1574,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, } /* end if */ /* Don't allow compact datasets to allocate space later */ - if(dcpl_layout==H5D_COMPACT && space_time!=H5D_SPACE_ALLOC_EARLY) + if(dcpl_layout==H5D_COMPACT && alloc_time!=H5D_ALLOC_TIME_EARLY) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "compact dataset doesn't support late space allocation"); /* What file is the dataset being added to? */ @@ -1587,7 +1587,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, /* Check if this dataset is going into a parallel file and set space allocation time */ if(IS_H5FD_MPIO(f) || IS_H5FD_MPIPOSIX(f)) - space_time=H5D_SPACE_ALLOC_EARLY; + alloc_time=H5D_ALLOC_TIME_EARLY; if(H5P_get(plist, H5D_CRT_FILL_TIME_NAME, &fill_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve fill time"); @@ -1615,8 +1615,8 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, if (NULL == (new_plist = H5I_object(new_dset->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "can't get dataset creation property list"); - /* Set the space_time for the dataset, in case the default was used */ - if(H5P_set(new_plist, H5D_CRT_SPACE_TIME_NAME, &space_time) < 0) + /* Set the alloc_time for the dataset, in case the default was used */ + if(H5P_set(new_plist, H5D_CRT_ALLOC_TIME_NAME, &alloc_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "can't set allocation time"); if(H5P_get(new_plist, H5D_CRT_CHUNK_DIM_NAME, &chunk_ndims) < 0) @@ -1721,7 +1721,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, /* Retrieve properties of fill value and others. Copy them into new fill * value struct. Convert the fill value to the dataset type and write * the message */ - if(H5P_get(new_plist, H5D_CRT_SPACE_TIME_NAME, &space_time) < 0) + if(H5P_get(new_plist, H5D_CRT_ALLOC_TIME_NAME, &alloc_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve space allocation time"); if(H5P_get(new_plist, H5D_CRT_FILL_TIME_NAME, &fill_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve fill time"); @@ -1742,7 +1742,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, } else { HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "unable to determine if fill value is defined"); } /* end else */ - fill.space_time = space_time; + fill.alloc_time = alloc_time; fill.fill_time = fill_time; if(fill.fill_defined == FALSE && fill_time != H5D_FILL_TIME_NEVER) @@ -1787,7 +1787,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type, /* * Allocate storage if space allocate time is early; otherwise delay allocation until later. */ - if(space_time==H5D_SPACE_ALLOC_EARLY) + if(alloc_time==H5D_ALLOC_TIME_EARLY) if (H5D_alloc_storage(f, new_dset,H5D_ALLOC_CREATE)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize storage"); @@ -1968,7 +1968,7 @@ H5D_open_oid(H5G_entry_t *ent) { H5D_t *dataset = NULL; /*new dataset struct */ H5D_t *ret_value = NULL; /*return value */ - H5O_fill_new_t fill = {NULL, 0, NULL, H5D_SPACE_ALLOC_LATE, H5D_FILL_TIME_ALLOC, TRUE}; + H5O_fill_new_t fill = {NULL, 0, NULL, H5D_ALLOC_TIME_LATE, H5D_FILL_TIME_ALLOC, TRUE}; H5O_fill_t fill_prop = {NULL, 0, NULL}; H5O_pline_t pline; /* I/O pipeline information */ H5O_efl_t efl; /* External file information */ @@ -2069,15 +2069,15 @@ H5D_open_oid(H5G_entry_t *ent) /* Set the space allocation time appropriately, based on the type of dataset storage */ switch (dataset->layout.type) { case H5D_COMPACT: - fill.space_time=H5D_SPACE_ALLOC_EARLY; + fill.alloc_time=H5D_ALLOC_TIME_EARLY; break; case H5D_CONTIGUOUS: - fill.space_time=H5D_SPACE_ALLOC_LATE; + fill.alloc_time=H5D_ALLOC_TIME_LATE; break; case H5D_CHUNKED: - fill.space_time=H5D_SPACE_ALLOC_INCR; + fill.alloc_time=H5D_ALLOC_TIME_INCR; break; default: @@ -2103,13 +2103,13 @@ H5D_open_oid(H5G_entry_t *ent) /* Set fill value properties */ if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, &fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set fill value"); - if(H5P_set(plist, H5D_CRT_SPACE_TIME_NAME, &fill.space_time) < 0) + if(H5P_set(plist, H5D_CRT_ALLOC_TIME_NAME, &fill.alloc_time) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set fill value"); if(H5P_set(plist, H5D_CRT_FILL_TIME_NAME, &fill.fill_time) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set fill value"); /* Get the external file list message, which might not exist. Space is - * also undefined when space allocate time is H5D_SPACE_ALLOC_LATE. */ + * also undefined when space allocate time is H5D_ALLOC_TIME_LATE. */ if( !H5F_addr_defined(dataset->layout.addr)) { HDmemset(&efl,0,sizeof(H5O_efl_t)); if(NULL != H5O_read(&(dataset->ent), H5O_EFL, 0, &efl)) @@ -2712,7 +2712,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, H5O_efl_t efl; /* External File List info */ H5O_fill_t fill; /* Fill value info */ H5D_fill_time_t fill_time; /* When to write the fill values */ - H5D_space_time_t space_time; /* When to allocate raw data space */ + H5D_alloc_time_t alloc_time; /* When to allocate raw data space */ H5P_genplist_t *dx_plist=NULL; /* Data transfer property list */ H5P_genplist_t *dc_plist; /* Dataset creation roperty list */ unsigned sconv_flags=0; /* Flags for the space conversion */ @@ -2808,7 +2808,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve fill time"); if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve external file list"); - if(H5P_get(dc_plist, H5D_CRT_SPACE_TIME_NAME, &space_time) < 0) + if(H5P_get(dc_plist, H5D_CRT_ALLOC_TIME_NAME, &alloc_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve space allocation time"); /* Allocate data space and initialize it if it hasn't been. */ @@ -3091,7 +3091,7 @@ H5D_extend (H5D_t *dataset, const hsize_t *size) { int changed; /* Flag to indicate that the dataspace was successfully extended */ H5S_t *space = NULL; /* Dataset's dataspace */ - H5D_space_time_t space_time; /* When to allocate raw data space */ + H5D_alloc_time_t alloc_time; /* When to allocate raw data space */ H5P_genplist_t *plist; /* Property list */ herr_t ret_value=SUCCEED; /* Return value */ @@ -3104,7 +3104,7 @@ H5D_extend (H5D_t *dataset, const hsize_t *size) /* Get the dataset creation property list */ if (NULL == (plist = H5I_object(dataset->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - if(H5P_get(plist, H5D_CRT_SPACE_TIME_NAME, &space_time) < 0) + if(H5P_get(plist, H5D_CRT_ALLOC_TIME_NAME, &alloc_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve space allocation time"); /* @@ -3125,7 +3125,7 @@ H5D_extend (H5D_t *dataset, const hsize_t *size) HGOTO_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace"); /* Allocate space for the new parts of the dataset, if appropriate */ - if(space_time==H5D_SPACE_ALLOC_EARLY) + if(alloc_time==H5D_ALLOC_TIME_EARLY) if (H5D_alloc_storage(dataset->ent.file, dataset, H5D_ALLOC_EXTEND)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value"); } /* end if */ @@ -3240,12 +3240,12 @@ H5D_get_file (const H5D_t *dset) *------------------------------------------------------------------------- */ static herr_t -H5D_alloc_storage (H5F_t *f, H5D_t *dset/*in,out*/, H5D_alloc_time_t alloc_time) +H5D_alloc_storage (H5F_t *f, H5D_t *dset/*in,out*/, H5D_time_alloc_t time_alloc) { H5P_genplist_t *plist; /* Dataset's creation property list */ H5O_efl_t efl; /* External File List info */ H5D_fill_time_t fill_time; /* When to write fill values */ - H5D_space_time_t space_time; /* When to allocate raw data space */ + H5D_alloc_time_t alloc_time; /* When to allocate raw data space */ struct H5O_layout_t *layout; /* The dataset's layout information */ hsize_t nbytes; /* The number of bytes in the dataset */ unsigned space_allocated=0; /* Flag to indicate that space was allocated */ @@ -3272,7 +3272,7 @@ H5D_alloc_storage (H5F_t *f, H5D_t *dset/*in,out*/, H5D_alloc_time_t alloc_time) /* Get properties needed */ if(H5P_get(plist, H5D_CRT_FILL_TIME_NAME, &fill_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve fill time"); - if(H5P_get(plist, H5D_CRT_SPACE_TIME_NAME, &space_time) < 0) + if(H5P_get(plist, H5D_CRT_ALLOC_TIME_NAME, &alloc_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve space allocation time"); /* Get a pointer to the dataset's layout information */ @@ -3325,7 +3325,7 @@ H5D_alloc_storage (H5F_t *f, H5D_t *dset/*in,out*/, H5D_alloc_time_t alloc_time) /* If we are filling the dataset on allocation, do that now */ if(fill_time==H5D_FILL_TIME_ALLOC - && !(space_time==H5D_SPACE_ALLOC_INCR && alloc_time==H5D_ALLOC_WRITE)) { + && !(alloc_time==H5D_ALLOC_TIME_INCR && time_alloc==H5D_ALLOC_WRITE)) { if(H5D_init_storage(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value"); } /* end if */ @@ -3333,7 +3333,7 @@ H5D_alloc_storage (H5F_t *f, H5D_t *dset/*in,out*/, H5D_alloc_time_t alloc_time) /* Also update header message for layout with new address * (this is only for forward compatibility). */ - if(space_allocated && alloc_time!=H5D_ALLOC_CREATE) + if(space_allocated && time_alloc!=H5D_ALLOC_CREATE) if (H5O_modify (&(dset->ent), H5O_LAYOUT, 0, H5O_FLAG_CONSTANT, &(dset->layout)) < 0) HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout message"); } /* end if */ @@ -4086,7 +4086,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size) herr_t ret_value = SUCCEED; /* Return value */ H5S_t *space = NULL; H5P_genplist_t *plist; - H5D_space_time_t space_time; /* When to allocate raw data space */ + H5D_alloc_time_t alloc_time; /* When to allocate raw data space */ int u; unsigned shrink = 0; /* Flag to indicate a dimension has shrank */ unsigned expand = 0; /* Flag to indicate a dimension has grown */ @@ -4131,7 +4131,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size) /* Get the dataset creation property list */ if(NULL == (plist = H5I_object(dset->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dset creation property list"); - if(H5P_get(plist, H5D_CRT_SPACE_TIME_NAME, &space_time) < 0) + if(H5P_get(plist, H5D_CRT_ALLOC_TIME_NAME, &alloc_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve space allocation time"); /*------------------------------------------------------------------------- @@ -4143,7 +4143,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace"); /* Allocate space for the new parts of the dataset, if appropriate */ - if(expand && space_time==H5D_SPACE_ALLOC_EARLY) + if(expand && alloc_time==H5D_ALLOC_TIME_EARLY) if(H5D_alloc_storage(dset->ent.file, dset, H5D_ALLOC_EXTEND) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset storage"); diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index d1d0a02..0787c5b 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -61,9 +61,9 @@ #define H5D_CRT_FILL_VALUE_SIZE sizeof(H5O_fill_t) #define H5D_CRT_FILL_VALUE_DEF {NULL, 0, NULL} /* Definitions for space allocation time */ -#define H5D_CRT_SPACE_TIME_NAME "space_time" -#define H5D_CRT_SPACE_TIME_SIZE sizeof(H5D_space_time_t) -#define H5D_CRT_SPACE_TIME_DEF H5D_SPACE_ALLOC_DEFAULT +#define H5D_CRT_ALLOC_TIME_NAME "alloc_time" +#define H5D_CRT_ALLOC_TIME_SIZE sizeof(H5D_alloc_time_t) +#define H5D_CRT_ALLOC_TIME_DEF H5D_ALLOC_TIME_DEFAULT /* Definitions for time of fill value writing */ #define H5D_CRT_FILL_TIME_NAME "fill_time" #define H5D_CRT_FILL_TIME_SIZE sizeof(H5D_fill_time_t) diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 3cad621..cf01aae 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -31,13 +31,13 @@ typedef enum H5D_layout_t { } H5D_layout_t; /* Values for the space allocation time property */ -typedef enum H5D_space_time_t { - H5D_SPACE_ALLOC_ERROR =-1, - H5D_SPACE_ALLOC_DEFAULT =0, - H5D_SPACE_ALLOC_EARLY =1, - H5D_SPACE_ALLOC_LATE =2, - H5D_SPACE_ALLOC_INCR =3 -} H5D_space_time_t; +typedef enum H5D_alloc_time_t { + H5D_ALLOC_TIME_ERROR =-1, + H5D_ALLOC_TIME_DEFAULT =0, + H5D_ALLOC_TIME_EARLY =1, + H5D_ALLOC_TIME_LATE =2, + H5D_ALLOC_TIME_INCR =3 +} H5D_alloc_time_t; /* Values for the status of space allocation */ typedef enum H5D_space_status_t { diff --git a/src/H5Ofill.c b/src/H5Ofill.c index ebf9753..dd734b9 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -113,7 +113,7 @@ H5O_fill_new_decode(H5F_t UNUSED *f, const uint8_t *p, HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for fill value message"); /* Space allocation time */ - mesg->space_time = (H5D_space_time_t)*p++; + mesg->alloc_time = (H5D_alloc_time_t)*p++; /* Fill value write time */ mesg->fill_time = (H5D_fill_time_t)*p++; @@ -227,7 +227,7 @@ H5O_fill_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) /* Version */ *p++ = H5O_FILL_VERSION; /* Space allocation time */ - *p++ = mesg->space_time; + *p++ = mesg->alloc_time; /* Fill value writing time */ *p++ = mesg->fill_time; /* Whether fill value is defined */ @@ -329,7 +329,7 @@ H5O_fill_new_copy(const void *_mesg, void *_dest) } /* Copy three fill value attributes */ - dest->space_time = mesg->space_time; + dest->alloc_time = mesg->alloc_time; dest->fill_time = mesg->fill_time; dest->fill_defined = mesg->fill_defined; @@ -520,7 +520,7 @@ H5O_fill_new_reset(void *_mesg) H5T_close(mesg->type); mesg->type = NULL; } - mesg->space_time = (H5D_space_time_t)0; + mesg->alloc_time = (H5D_alloc_time_t)0; mesg->fill_time = (H5D_fill_time_t)0; mesg->fill_defined = (H5D_fill_value_t)0; diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 8c66bcc..f7b8d9a 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -161,7 +161,7 @@ typedef struct H5O_fill_new_t { H5T_t *type; /*type. Null implies same as dataset */ ssize_t size; /*number of bytes in the fill value */ void *buf; /*the fill value */ - H5D_space_time_t space_time; /* time to allocate space */ + H5D_alloc_time_t alloc_time; /* time to allocate space */ H5D_fill_time_t fill_time; /* time to write fill value */ htri_t fill_defined; /* whether fill value is defined */ } H5O_fill_new_t; diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 4c3d6a1..7e995ef 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -1022,10 +1022,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_space_time + * Function: H5Pset_alloc_time * * Purpose: Set space allocation time for dataset during creation. - * Valid values are H5D_EARLY, H5D_LATE. + * Valid values are H5D_ALLOC_TIME_DEFAULT, H5D_ALLOC_TIME_EARLY, + * H5D_ALLOC_TIME_LATE, H5D_ALLOC_TIME_INCR * * Return: Non-negative on success/Negative on failure * @@ -1038,12 +1039,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pset_space_time(hid_t plist_id, H5D_space_time_t alloc_time) +H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_space_time, FAIL); + FUNC_ENTER_API(H5Pset_alloc_time, FAIL); H5TRACE2("e","iDs",plist_id,alloc_time); /* Get the property list structure */ @@ -1051,7 +1052,7 @@ H5Pset_space_time(hid_t plist_id, H5D_space_time_t alloc_time) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Set values */ - if(H5P_set(plist, H5D_CRT_SPACE_TIME_NAME, &alloc_time) < 0) + if(H5P_set(plist, H5D_CRT_ALLOC_TIME_NAME, &alloc_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set space allocation time"); done: @@ -1060,10 +1061,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_space_time + * Function: H5Pget_alloc_time * - * Purpose: Get space allocation time for dataset creation. Valid - * values are H5D_EARLY, H5D_LATE. + * Purpose: Get space allocation time for dataset creation. + * Valid values are H5D_ALLOC_TIME_DEFAULT, H5D_ALLOC_TIME_EARLY, + * H5D_ALLOC_TIME_LATE, H5D_ALLOC_TIME_INCR * * Return: Non-negative on success/Negative on failure * @@ -1076,12 +1078,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_space_time(hid_t plist_id, H5D_space_time_t *alloc_time/*out*/) +H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_space_time, FAIL); + FUNC_ENTER_API(H5Pget_alloc_time, FAIL); H5TRACE2("e","ix",plist_id,alloc_time); /* Get the property list structure */ @@ -1089,7 +1091,7 @@ H5Pget_space_time(hid_t plist_id, H5D_space_time_t *alloc_time/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); /* Get values */ - if(!alloc_time || H5P_get(plist, H5D_CRT_SPACE_TIME_NAME, alloc_time) < 0) + if(!alloc_time || H5P_get(plist, H5D_CRT_ALLOC_TIME_NAME, alloc_time) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get space allocation time"); done: diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 1aeda30..9692ae4 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -231,9 +231,9 @@ __DLL__ herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, __DLL__ herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/); __DLL__ herr_t H5Pfill_value_defined(hid_t plist, H5D_fill_value_t *status); -__DLL__ herr_t H5Pset_space_time(hid_t plist_id, H5D_space_time_t +__DLL__ herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time); -__DLL__ herr_t H5Pget_space_time(hid_t plist_id, H5D_space_time_t +__DLL__ herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time/*out*/); __DLL__ herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); __DLL__ herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t diff --git a/test/dsets.c b/test/dsets.c index be52ed2..7442c50 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -167,7 +167,7 @@ test_create(hid_t file) assert(create_parms >= 0); status = H5Pset_layout(create_parms, H5D_COMPACT); assert(status >= 0); - status = H5Pset_space_time(create_parms, H5D_SPACE_ALLOC_EARLY); + status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); assert(status >= 0); dataset = H5Dcreate(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE, @@ -318,7 +318,7 @@ test_compact_io(void) assert(plist >= 0); status = H5Pset_layout(plist, H5D_COMPACT); assert(status >= 0); - status = H5Pset_space_time(plist, H5D_SPACE_ALLOC_EARLY); + status = H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY); assert(status >= 0); /* Create and write to a compact dataset */ diff --git a/test/fillval.c b/test/fillval.c index fd63464..8f8dcaf 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -234,7 +234,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) long rd_l, fill_l = 0x4321; char filename[1024]; H5D_space_status_t allocation; - H5D_space_time_t alloc_time; + H5D_alloc_time_t alloc_time; H5D_fill_time_t fill_time; comp_datatype rd_c, fill_ctype; @@ -266,7 +266,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) /* I. Test cases for late space allocation except compact dataset */ if(H5D_COMPACT!=layout) { - if(H5Pset_space_time(dcpl, H5D_SPACE_ALLOC_LATE) < 0) goto error; + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error; if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; /* 1. Compound datatype test */ @@ -325,7 +325,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) } else if (H5D_COMPACT==layout) { if (H5Pset_layout(dcpl, H5D_COMPACT)<0) goto error; } - if(H5Pset_space_time(dcpl, H5D_SPACE_ALLOC_EARLY) < 0) goto error; + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error; /* 1. Compound datatype test */ if(H5Pget_fill_value(dcpl, comp_type_id, &fill_ctype)<0) goto error; @@ -418,11 +418,11 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; } #endif - if(H5Pget_space_time(dcpl, &alloc_time)<0) goto error; + if(H5Pget_alloc_time(dcpl, &alloc_time)<0) goto error; if(H5Pget_fill_time(dcpl, &fill_time)<0) goto error; - if(alloc_time != H5D_SPACE_ALLOC_LATE) { + if(alloc_time != H5D_ALLOC_TIME_LATE) { H5_FAILED(); - puts(" Got non-H5D_SPACE_ALLOC_LATE space allocation time."); + puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); printf(" Got %d\n", alloc_time); } if(fill_time != H5D_FILL_TIME_ALLOC) { @@ -443,11 +443,11 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) goto error; } if ((dcpl=H5Dget_create_plist(dset4))<0) goto error; - if(H5Pget_space_time(dcpl, &alloc_time)<0) goto error; + if(H5Pget_alloc_time(dcpl, &alloc_time)<0) goto error; if(H5Pget_fill_time(dcpl, &fill_time)<0) goto error; - if(alloc_time != H5D_SPACE_ALLOC_LATE) { + if(alloc_time != H5D_ALLOC_TIME_LATE) { H5_FAILED(); - puts(" Got non-H5D_SPACE_ALLOC_LATE space allocation time."); + puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time."); printf(" Got %d\n", alloc_time); } if(fill_time != H5D_FILL_TIME_NEVER) { @@ -484,10 +484,10 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) printf(" Got %d\n", allocation); goto error; } - if(H5Pget_space_time(dcpl, &alloc_time)<0) goto error; - if(alloc_time != H5D_SPACE_ALLOC_EARLY) { + if(H5Pget_alloc_time(dcpl, &alloc_time)<0) goto error; + if(alloc_time != H5D_ALLOC_TIME_EARLY) { H5_FAILED(); - puts(" Got non-H5D_SPACE_ALLOC_EARLY space allocation time."); + puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); printf(" Got %d\n", alloc_time); } if(H5Pget_fill_time(dcpl, &fill_time)<0) goto error; @@ -516,10 +516,10 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) printf(" Got %ld, set %ld\n", rd_l, fill_l); goto error; } - if(H5Pget_space_time(dcpl, &alloc_time)<0) goto error; - if(alloc_time != H5D_SPACE_ALLOC_EARLY) { + if(H5Pget_alloc_time(dcpl, &alloc_time)<0) goto error; + if(alloc_time != H5D_ALLOC_TIME_EARLY) { H5_FAILED(); - puts(" Got non-H5D_SPACE_ALLOC_EARLY space allocation time."); + puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time."); printf(" Got %d\n", alloc_time); } if(H5Pget_fill_time(dcpl, &fill_time)<0) goto error; @@ -878,9 +878,9 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) if ((ctype_id=create_compound_type())<0) goto error; - /* I. Test H5D_SPACE_ALLOC_LATE space allocation cases */ + /* I. Test H5D_ALLOC_TIME_LATE space allocation cases */ if(H5D_COMPACT != layout) { - if(H5Pset_space_time(dcpl, H5D_SPACE_ALLOC_LATE) < 0) goto error; + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error; /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; @@ -931,8 +931,8 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) } - /* II. Test H5D_SPACE_ALLOC_EARLY space allocation cases */ - if(H5Pset_space_time(dcpl, H5D_SPACE_ALLOC_EARLY) < 0) goto error; + /* II. Test H5D_ALLOC_TIME_EARLY space allocation cases */ + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error; /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; diff --git a/test/tmisc.c b/test/tmisc.c index 1e1e613..da31f43 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -1124,8 +1124,8 @@ test_misc8(void) CHECK(ret, FAIL, "H5Pset_layout"); /* Set the space allocation time to early */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_EARLY); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation early */ did = H5Dcreate(fid, MISC8_DSETNAME1, H5T_NATIVE_INT, sid, dcpl); @@ -1142,8 +1142,8 @@ test_misc8(void) #ifndef H5_HAVE_PARALLEL /* Set the space allocation time to late */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_LATE); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation late */ did = H5Dcreate(fid, MISC8_DSETNAME2, H5T_NATIVE_INT, sid, dcpl); @@ -1167,8 +1167,8 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dclose"); /* Set the space allocation time to incremental */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_INCR); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation late */ did = H5Dcreate(fid, MISC8_DSETNAME3, H5T_NATIVE_INT, sid, dcpl); @@ -1197,8 +1197,8 @@ test_misc8(void) CHECK(ret, FAIL, "H5Pset_layout"); /* Set the space allocation time to late */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_LATE); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation late */ /* Should fail */ @@ -1206,8 +1206,8 @@ test_misc8(void) VERIFY(did, FAIL, "H5Dcreate"); /* Set the space allocation time to incremental */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_INCR); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation incremental */ /* Should fail */ @@ -1215,8 +1215,8 @@ test_misc8(void) VERIFY(did, FAIL, "H5Dcreate"); /* Set the space allocation time to early */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_EARLY); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation early */ did = H5Dcreate(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, dcpl); @@ -1238,8 +1238,8 @@ test_misc8(void) CHECK(ret, FAIL, "H5Pset_layout"); /* Set the space allocation time to early */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_EARLY); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Use chunked storage for this dataset */ ret = H5Pset_chunk(dcpl,rank,chunk_dims); @@ -1260,8 +1260,8 @@ test_misc8(void) #ifndef H5_HAVE_PARALLEL /* Set the space allocation time to late */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_LATE); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Use chunked storage for this dataset */ ret = H5Pset_chunk(dcpl,rank,chunk_dims); @@ -1289,8 +1289,8 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dclose"); /* Set the space allocation time to incremental */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_INCR); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation incremental */ did = H5Dcreate(fid, MISC8_DSETNAME7, H5T_NATIVE_INT, sid, dcpl); @@ -1339,8 +1339,8 @@ test_misc8(void) #endif /* H5_HAVE_PARALLEL */ /* Set the space allocation time to early */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_EARLY); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Use compression as well as chunking for these datasets */ #ifdef H5_HAVE_COMPRESSION @@ -1377,8 +1377,8 @@ test_misc8(void) #ifndef H5_HAVE_PARALLEL /* Set the space allocation time to late */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_LATE); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation late */ did = H5Dcreate(fid, MISC8_DSETNAME9, H5T_NATIVE_INT, sid, dcpl); @@ -1447,8 +1447,8 @@ test_misc8(void) CHECK(ret, FAIL, "H5Dclose"); /* Set the space allocation time to incremental */ - ret = H5Pset_space_time(dcpl,H5D_SPACE_ALLOC_INCR); - CHECK(ret, FAIL, "H5Pset_space_time"); + ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation incremental */ did = H5Dcreate(fid, MISC8_DSETNAME10, H5T_NATIVE_INT, sid, dcpl); diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 1272e42..dae0e0f 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -129,7 +129,7 @@ void compact_dataset(char *filename) VRFY((dcpl>=0), "dataset creation property list succeeded"); ret=H5Pset_layout(dcpl, H5D_COMPACT); VRFY((dcpl >= 0), "set property list for compact dataset"); - ret=H5Pset_space_time(dcpl, H5D_SPACE_ALLOC_EARLY); + ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); VRFY((ret >= 0), "set space allocation time for compact dataset"); dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl); -- cgit v0.12