2
0
mirror of https://github.com/HDFGroup/hdf5.git synced 2025-04-24 17:51:25 +08:00

[svn-r3005] Purpose:

Backward compatibility code
Description:
    Add in code to allow the library to emulate the v1.2 API and behavior.
Platforms tested:
    FreeBSD 4.2 (hawkwind)
This commit is contained in:
Quincey Koziol 2000-11-27 18:01:48 -05:00
parent e7b7e14a88
commit 0726621eaa
26 changed files with 993 additions and 77 deletions

@ -1949,8 +1949,8 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case H5P_DATASET_CREATE:
fprintf(out, "H5P_DATASET_CREATE");
break;
case H5P_DATA_XFER:
fprintf(out, "H5P_DATA_XFER");
case H5P_DATASET_XFER:
fprintf(out, "H5P_DATASET_XFER");
break;
case H5P_MOUNT:
fprintf(out, "H5P_MOUNT");
@ -2112,8 +2112,8 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case H5P_DATASET_CREATE:
fprintf (out, "H5P_DATASET_CREATE");
break;
case H5P_DATA_XFER:
fprintf (out, "H5P_DATA_XFER");
case H5P_DATASET_XFER:
fprintf (out, "H5P_DATASET_XFER");
break;
default:
fprintf (out, "%ld", (long)plist_class);

@ -704,7 +704,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
"selection+offset not within extent");
}
}
if (H5P_DEFAULT != plist_id && H5P_DATA_XFER != H5P_get_class(plist_id)) {
if (H5P_DEFAULT != plist_id && H5P_DATASET_XFER != H5P_get_class(plist_id)) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
if (!buf) {
@ -799,7 +799,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
"selection+offset not within extent");
}
}
if (H5P_DEFAULT != plist_id && H5P_DATA_XFER != H5P_get_class(plist_id)) {
if (H5P_DEFAULT != plist_id && H5P_DATASET_XFER != H5P_get_class(plist_id)) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
if (!buf) {
@ -1608,7 +1608,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else if (H5P_DATA_XFER != H5P_get_class(dxpl_id) ||
} else if (H5P_DATASET_XFER != H5P_get_class(dxpl_id) ||
NULL == (xfer_parms = H5I_object(dxpl_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
@ -2068,7 +2068,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else if (H5P_DATA_XFER != H5P_get_class(dxpl_id) ||
} else if (H5P_DATASET_XFER != H5P_get_class(dxpl_id) ||
NULL == (xfer_parms = H5I_object(dxpl_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
@ -2931,7 +2931,7 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf)
if (H5P_DEFAULT == plist_id) {
HDmemcpy(&tmp_xfer_parms,&H5D_xfer_dflt,sizeof(H5D_xfer_t));
xfer_parms = &tmp_xfer_parms;
} else if (H5P_DATA_XFER != H5P_get_class(plist_id) ||
} else if (H5P_DATASET_XFER != H5P_get_class(plist_id) ||
NULL == (xfer_parms = H5I_object(plist_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
@ -3099,7 +3099,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "no temporary buffers available");
/* Change to the custom memory allocation routines for reading VL data */
if((vlen_bufsize.xfer_pid=H5Pcreate(H5P_DATA_XFER))<0)
if((vlen_bufsize.xfer_pid=H5Pcreate(H5P_DATASET_XFER))<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "no dataset xfer plists available");
if(H5Pset_vlen_mem_manager(vlen_bufsize.xfer_pid,H5D_vlen_get_buf_size_alloc,&vlen_bufsize,NULL,NULL)<0)

@ -31,6 +31,15 @@ typedef enum H5D_layout_t {
H5D_NLAYOUTS = 3 /*this one must be last! */
} H5D_layout_t;
#if defined(WANT_H5_V1_2_COMPAT) || defined(H5_WANT_H5_V1_2_COMPAT)
/* Values for the data transfer property */
typedef enum H5D_transfer_t {
H5D_XFER_INDEPENDENT, /*Independent data transfer */
H5D_XFER_COLLECTIVE, /*Collective data transfer */
H5D_XFER_DFLT /*default data transfer mode */
} H5D_transfer_t;
#endif /* WANT_H5_V1_2_COMPAT */
/* Define the operator function pointer for H5Diterate() */
typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, hsize_t ndim,
hssize_t *point, void *operator_data);

@ -302,7 +302,7 @@ H5FD_get_class(hid_t id)
ret_value = H5FD_get_class(fapl->driver_id);
break;
case H5P_DATA_XFER:
case H5P_DATASET_XFER:
if (NULL==(dxpl=H5I_object(id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL,
"not a data transfer property list");
@ -1821,7 +1821,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer");
}
if (H5P_DEFAULT!=dxpl_id &&
(H5P_DATA_XFER!=H5P_get_class(dxpl_id) ||
(H5P_DATASET_XFER!=H5P_get_class(dxpl_id) ||
NULL==H5I_object(dxpl_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"not a data transfer property list");
@ -1866,7 +1866,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si
FUNC_ENTER(H5FD_read, FAIL);
assert(file && file->cls);
assert(H5P_DEFAULT==dxpl_id ||
(H5P_DATA_XFER==H5P_get_class(dxpl_id) || H5I_object(dxpl_id)));
(H5P_DATASET_XFER==H5P_get_class(dxpl_id) || H5I_object(dxpl_id)));
assert(buf);
#ifndef H5_HAVE_PARALLEL
@ -1977,7 +1977,7 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer");
}
if (H5P_DEFAULT!=dxpl_id &&
(H5P_DATA_XFER!=H5P_get_class(dxpl_id) ||
(H5P_DATASET_XFER!=H5P_get_class(dxpl_id) ||
NULL==H5I_object(dxpl_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"not a data transfer property list");
@ -2026,7 +2026,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t s
FUNC_ENTER(H5FD_write, FAIL);
assert(file && file->cls);
assert(H5P_DEFAULT==dxpl_id ||
(H5P_DATA_XFER==H5P_get_class(dxpl_id) && H5I_object(dxpl_id)));
(H5P_DATASET_XFER==H5P_get_class(dxpl_id) && H5I_object(dxpl_id)));
assert(buf);
#ifndef H5_HAVE_PARALLEL

@ -565,7 +565,7 @@ H5FD_dpss_read (H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t ad
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dxpl_id) {
xfer_parms = &H5F_xfer_dflt;
} else if (H5P_DATA_XFER != H5P_get_class (dxpl_id) ||
} else if (H5P_DATASET_XFER != H5P_get_class (dxpl_id) ||
NULL == (xfer_parms = H5I_object (dxpl_id))) {
HRETURN_ERROR (H5E_PLIST, H5E_BADTYPE, FAIL, "not a xfer");
}

@ -831,7 +831,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hs
if (H5P_DEFAULT!=dxpl_id && H5FD_FAMILY==H5Pget_driver(dxpl_id)) {
H5FD_family_dxpl_t *dx = H5Pget_driver_info(dxpl_id);
assert(H5P_DATA_XFER==H5Pget_class(dxpl_id));
assert(H5P_DATASET_XFER==H5Pget_class(dxpl_id));
assert(dx);
memb_dxpl_id = dx->memb_dxpl_id;
}
@ -894,7 +894,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, h
if (H5P_DEFAULT!=dxpl_id && H5FD_FAMILY==H5Pget_driver(dxpl_id)) {
H5FD_family_dxpl_t *dx = H5Pget_driver_info(dxpl_id);
assert(H5P_DATA_XFER==H5Pget_class(dxpl_id));
assert(H5P_DATASET_XFER==H5Pget_class(dxpl_id));
assert(dx);
memb_dxpl_id = dx->memb_dxpl_id;
}

@ -341,7 +341,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode)
H5TRACE2("e","iDt",dxpl_id,xfer_mode);
/* Check arguments */
if (H5P_DATA_XFER!=H5Pget_class(dxpl_id))
if (H5P_DATASET_XFER!=H5Pget_class(dxpl_id))
HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
if (H5FD_MPIO_INDEPENDENT!=xfer_mode &&
H5FD_MPIO_COLLECTIVE!=xfer_mode)
@ -384,7 +384,7 @@ H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode/*out*/)
FUNC_ENTER(H5Pget_dxpl_mpio, FAIL);
H5TRACE2("e","ix",dxpl_id,xfer_mode);
if (H5P_DATA_XFER!=H5Pget_class(dxpl_id))
if (H5P_DATASET_XFER!=H5Pget_class(dxpl_id))
HRETURN_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
if (H5FD_MPIO!=H5Pget_driver(dxpl_id))
HRETURN_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");

@ -539,13 +539,13 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
H5Eclear();
/* Check arguments */
if (H5P_DATA_XFER!=H5Pget_class(dxpl_id))
if (H5P_DATASET_XFER!=H5Pget_class(dxpl_id))
H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
if (!memb_dxpl)
H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1);
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
if (H5P_DEFAULT!=memb_dxpl[mt] &&
H5P_DATA_XFER!=H5Pget_class(memb_dxpl[mt]))
H5P_DATASET_XFER!=H5Pget_class(memb_dxpl[mt]))
H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
}

@ -282,7 +282,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else if (H5P_DATA_XFER != H5P_get_class (dxpl_id) ||
} else if (H5P_DATASET_XFER != H5P_get_class (dxpl_id) ||
NULL == (xfer_parms = H5I_object (dxpl_id))) {
HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}

@ -47,6 +47,23 @@
#define H5F_MPIO_DEBUG_KEY "H5F_mpio_debug_key"
#endif
#if defined(WANT_H5_V1_2_COMPAT) || defined(H5_WANT_H5_V1_2_COMPAT)
/*
* Low-level file drivers. These values are returned by H5Pget_file_driver()
* and are set by the various H5Pset_...() functions that set file driver
* properties.
*/
typedef enum H5F_driver_t {
H5F_LOW_ERROR = -1, /*error return value */
H5F_LOW_STDIO = 0, /*use functions declared in stdio.h */
H5F_LOW_SEC2 = 1, /*use functions declared in unistd.h */
H5F_LOW_MPIO = 2, /*use indep or collective MPI-IO */
H5F_LOW_CORE = 3, /*use malloc() and free() */
H5F_LOW_SPLIT = 4, /*separate meta data from raw data */
H5F_LOW_FAMILY = 5 /*split addr space over many files */
} H5F_driver_t;
#endif /* WANT_H5_V1_2_COMPAT */
/* The difference between a single file and a set of mounted files */
typedef enum H5F_scope_t {
H5F_SCOPE_LOCAL = 0, /*specified file handle only */

855
src/H5P.c

File diff suppressed because it is too large Load Diff

@ -34,15 +34,16 @@ typedef enum H5P_class_t {
H5P_FILE_CREATE = 0, /*file creation properties */
H5P_FILE_ACCESS = 1, /*file access properties */
H5P_DATASET_CREATE = 2, /*dataset creation properties */
H5P_DATA_XFER = 3, /*data transfer properties */
H5P_DATASET_XFER = 3, /*data transfer properties */
H5P_MOUNT = 4, /*file mounting properties */
H5P_NCLASSES = 5 /*this must be last! */
} H5P_class_t;
/* Alias for the previous H5P_DATASER_XFER property list */
/* This should eventually be publicly decommisioned - 10/6/99 - QAK */
#define H5P_DATASET_XFER H5P_DATA_XFER
#if defined(WANT_H5_V1_2_COMPAT) || defined(H5_WANT_H5_V1_2_COMPAT)
/* Alias for the previous H5P_DATA_XFER property list */
#define H5P_DATA_XFER H5P_DATASET_XFER
#endif /* WANT_H5_V1_2_COMPAT */
/* Define property list class callback function pointer types */
typedef herr_t (*H5P_cls_create_func_t)(hid_t prop_id, void *create_data);
@ -72,15 +73,15 @@ extern "C" {
#define H5P_FILE_ACCESS_HASH_SIZE 17
#define H5P_DATASET_CREATE_NEW (H5open(), H5P_DATASET_CREATE_g)
#define H5P_DATASET_CREATE_HASH_SIZE 17
#define H5P_DATA_XFER_NEW (H5open(), H5P_DATA_XFER_g)
#define H5P_DATA_XFER_HASH_SIZE 17
#define H5P_DATASET_XFER_NEW (H5open(), H5P_DATASET_XFER_g)
#define H5P_DATASET_XFER_HASH_SIZE 17
#define H5P_MOUNT_NEW (H5open(), H5P_MOUNT_g)
#define H5P_MOUNT_HASH_SIZE 17
__DLLVAR__ hid_t H5P_NO_CLASS_g;
__DLLVAR__ hid_t H5P_FILE_CREATE_g;
__DLLVAR__ hid_t H5P_FILE_ACCESS_g;
__DLLVAR__ hid_t H5P_DATASET_CREATE_g;
__DLLVAR__ hid_t H5P_DATA_XFER_g;
__DLLVAR__ hid_t H5P_DATASET_XFER_g;
__DLLVAR__ hid_t H5P_MOUNT_g;
/* Public functions */
@ -143,7 +144,31 @@ __DLL__ herr_t H5Pget_external(hid_t plist_id, int idx, size_t name_size,
hsize_t *size/*out*/);
__DLL__ herr_t H5Pset_driver(hid_t plist_id, hid_t driver_id,
const void *driver_info);
#if defined(WANT_H5_V1_2_COMPAT) || defined(H5_WANT_H5_V1_2_COMPAT)
__DLL__ H5F_driver_t H5Pget_driver(hid_t plist_id);
__DLL__ herr_t H5Pset_stdio(hid_t plist_id);
__DLL__ herr_t H5Pget_stdio(hid_t plist_id);
__DLL__ herr_t H5Pset_sec2(hid_t plist_id);
__DLL__ herr_t H5Pget_sec2(hid_t plist_id);
__DLL__ herr_t H5Pset_core(hid_t plist_id, size_t increment);
__DLL__ herr_t H5Pget_core(hid_t plist_id, size_t *increment/*out*/);
__DLL__ herr_t H5Pset_split(hid_t plist_id, const char *meta_ext, hid_t meta_plist_id,
const char *raw_ext, hid_t raw_plist_id);
__DLL__ herr_t H5Pget_split(hid_t plist_id, size_t meta_ext_size, char *meta_ext/*out*/,
hid_t *meta_properties/*out*/, size_t raw_ext_size,
char *raw_ext/*out*/, hid_t *raw_properties/*out*/);
__DLL__ herr_t H5Pset_family(hid_t plist_id, hsize_t memb_size, hid_t memb_plist_id);
__DLL__ herr_t H5Pget_family(hid_t plist_id, hsize_t *memb_size/*out*/,
hid_t *memb_plist_id/*out*/);
#ifdef HAVE_PARALLEL
__DLL__ herr_t H5Pset_mpi(hid_t plist_id, MPI_Comm comm, MPI_Info info);
__DLL__ herr_t H5Pget_mpi(hid_t plist_id, MPI_Comm *comm, MPI_Info *info);
__DLL__ herr_t H5Pset_xfer(hid_t plist_id, H5D_transfer_t data_xfer_mode);
__DLL__ herr_t H5Pget_xfer(hid_t plist_id, H5D_transfer_t *data_xfer_mode);
#endif /*HAVE_PARALLEL*/
#else /* WANT_H5_V1_2_COMPAT */
__DLL__ hid_t H5Pget_driver(hid_t plist_id);
#endif /* WANT_H5_V1_2_COMPAT */
__DLL__ void *H5Pget_driver_info(hid_t plist_id);
__DLL__ herr_t H5Pset_buffer(hid_t plist_id, size_t size, void *tconv,
void *bkg);

@ -4538,7 +4538,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf,
/* Check args */
if (H5I_DATATYPE!=H5I_get_type(src_id) || NULL==(src=H5I_object(src_id)) ||
H5I_DATATYPE!=H5I_get_type(dst_id) || NULL==(dst=H5I_object(dst_id)) ||
(H5P_DEFAULT!=plist_id && H5P_DATA_XFER!=H5P_get_class(plist_id))) {
(H5P_DEFAULT!=plist_id && H5P_DATASET_XFER!=H5P_get_class(plist_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
}

@ -1829,7 +1829,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dset_xfer_plist) {
xfer_parms = &H5D_xfer_dflt;
} else if (H5P_DATA_XFER != H5P_get_class(dset_xfer_plist) ||
} else if (H5P_DATASET_XFER != H5P_get_class(dset_xfer_plist) ||
NULL == (xfer_parms = H5I_object(dset_xfer_plist))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}

@ -458,7 +458,7 @@ __DLL__ htri_t H5Tcommitted(hid_t type_id);
/* Operations defined on compound data types */
__DLL__ herr_t H5Tinsert(hid_t parent_id, const char *name, size_t offset,
hid_t member_id);
#ifdef WANT_H5_V1_2_COMPAT
#if defined(WANT_H5_V1_2_COMPAT) || defined(H5_WANT_H5_V1_2_COMPAT)
__DLL__ herr_t H5Tinsert_array(hid_t parent_id, const char *name,
size_t offset, int ndims, const size_t dim[],
const int *perm, hid_t member_id);
@ -506,7 +506,7 @@ __DLL__ H5T_str_t H5Tget_strpad(hid_t type_id);
__DLL__ int H5Tget_nmembers(hid_t type_id);
__DLL__ char *H5Tget_member_name(hid_t type_id, int membno);
__DLL__ size_t H5Tget_member_offset(hid_t type_id, int membno);
#ifdef WANT_H5_V1_2_COMPAT
#if defined(WANT_H5_V1_2_COMPAT) || defined(H5_WANT_H5_V1_2_COMPAT)
__DLL__ int H5Tget_member_dims(hid_t type_id, int membno, size_t dims[]/*out*/,
int perm[]/*out*/);
#endif /* WANT_H5_V1_2_COMPAT */

@ -120,7 +120,11 @@ enough_room(hid_t fapl)
for (i=0; i<NELMTS(fd); i++) fd[i] = -1;
/* Get file name template */
#ifdef H5_WANT_H5_V1_2_COMPAT
assert(H5F_LOW_FAMILY==H5Pget_driver(fapl));
#else /* H5_WANT_H5_V1_2_COMPAT */
assert(H5FD_FAMILY==H5Pget_driver(fapl));
#endif /* H5_WANT_H5_V1_2_COMPAT */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
/* Create files */
@ -366,7 +370,11 @@ main (void)
fapl = h5_fileaccess();
/* The file driver must be the family driver */
#ifdef H5_WANT_H5_V1_2_COMPAT
if (H5F_LOW_FAMILY!=H5Pget_driver(fapl)) {
#else /* H5_WANT_H5_V1_2_COMPAT */
if (H5FD_FAMILY!=H5Pget_driver(fapl)) {
#endif /* H5_WANT_H5_V1_2_COMPAT */
printf("Changing file drivers to the family driver, %lu bytes each\n",
(unsigned long)FAMILY_SIZE);
if (H5Pset_fapl_family(fapl, FAMILY_SIZE, H5P_DEFAULT)<0) goto error;

@ -157,7 +157,7 @@ main (int argc, char *argv[])
if ((space = H5Screate_simple (2, dim, NULL))<0) goto error;
/* Create xfer properties to preserve initialized data */
if ((PRESERVE = H5Pcreate (H5P_DATA_XFER))<0) goto error;
if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto error;
if (H5Pset_preserve (PRESERVE, 1)<0) goto error;
/*

@ -180,7 +180,7 @@ test_simple_io(hid_t file)
/* Create a small conversion buffer to test strip mining */
tconv_buf = malloc (1000);
xfer = H5Pcreate (H5P_DATA_XFER);
xfer = H5Pcreate (H5P_DATASET_XFER);
assert (xfer>=0);
if (H5Pset_buffer (xfer, 1000, tconv_buf, NULL)<0) goto error;
@ -366,7 +366,7 @@ test_compression(hid_t file)
* Create a small conversion buffer to test strip mining. We
* might as well test all we can!
*/
if ((xfer = H5Pcreate (H5P_DATA_XFER))<0) goto error;
if ((xfer = H5Pcreate (H5P_DATASET_XFER))<0) goto error;
tconv_buf = malloc (1000);
if (H5Pset_buffer (xfer, 1000, tconv_buf, NULL)<0) goto error;

@ -119,7 +119,9 @@ h5_cleanup(const char *base_name[], hid_t fapl)
char temp[2048];
int i, j;
int retval=0;
#ifndef H5_WANT_H5_V1_2_COMPAT
hid_t driver;
#endif /* H5_WANT_H5_V1_2_COMPAT */
if (!getenv("HDF5_NOCLEANUP")) {
for (i=0; base_name[i]; i++) {
@ -128,6 +130,31 @@ h5_cleanup(const char *base_name[], hid_t fapl)
continue;
}
#ifdef H5_WANT_H5_V1_2_COMPAT
switch (H5Pget_driver(fapl)) {
case H5F_LOW_CORE:
break; /*nothing to remove*/
case H5F_LOW_SPLIT:
HDsnprintf(temp, sizeof temp, "%s.raw", filename);
remove(temp);
HDsnprintf(temp, sizeof temp, "%s.meta", filename);
remove(temp);
break;
case H5F_LOW_FAMILY:
for (j=0; /*void*/; j++) {
HDsnprintf(temp, sizeof temp, filename, j);
if (access(temp, F_OK)<0) break;
remove(temp);
}
break;
default:
remove(filename);
break;
}
#else /* H5_WANT_H5_V1_2_COMPAT */
driver = H5Pget_driver(fapl);
if (H5FD_FAMILY==driver) {
for (j=0; /*void*/; j++) {
@ -148,6 +175,7 @@ h5_cleanup(const char *base_name[], hid_t fapl)
} else {
remove(filename);
}
#endif /* H5_WANT_H5_V1_2_COMPAT */
}
retval=1;
}
@ -229,10 +257,15 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
{
const char *prefix=NULL;
const char *suffix=".h5"; /* suffix has default */
#ifdef H5_WANT_H5_V1_2_COMPAT
H5F_driver_t driver;
#else /* H5_WANT_H5_V1_2_COMPAT */
hid_t driver;
#endif /* H5_WANT_H5_V1_2_COMPAT */
if (!base_name || !fullname || size<1) return NULL;
#ifndef H5_WANT_H5_V1_2_COMPAT
/* figure out the suffix */
if (H5P_DEFAULT!=fapl){
if ((driver=H5Pget_driver(fapl))<0) return NULL;
@ -262,6 +295,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
if (!prefix) prefix = HDF5_PREFIX;
#endif
}
#endif /* H5_WANT_H5_V1_2_COMPAT */
/* Prepend the prefix value to the base name */
@ -275,6 +309,22 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
strcpy(fullname, base_name);
}
#ifdef H5_WANT_H5_V1_2_COMPAT
/* Append a suffix */
if ((driver=H5Pget_driver(fapl))<0) return NULL;
switch (driver) {
case H5F_LOW_SPLIT:
case H5F_LOW_CORE:
suffix = NULL;
break;
case H5F_LOW_FAMILY:
suffix = "%05d.h5";
break;
default:
suffix = ".h5";
break;
}
#endif /* H5_WANT_H5_V1_2_COMPAT */
/* Append a suffix */
if (suffix) {
if (strlen(fullname)+strlen(suffix)>=size) return NULL;

@ -562,7 +562,11 @@ main(int argc, char *argv[])
* For testing file families, fool the library into thinking it already
* allocated a whole bunch of data.
*/
#ifdef H5_WANT_H5_V1_2_COMPAT
if (H5F_LOW_FAMILY!=H5Pget_driver(fapl)) {
#else /* H5_WANT_H5_V1_2_COMPAT */
if (H5FD_FAMILY==H5Pget_driver(fapl)) {
#endif /* H5_WANT_H5_V1_2_COMPAT */
haddr_t addr;
addr = 8 * ((uint64_t)1<<30); /*8 GB */
if (H5FDset_eoa(f->shared->lf, addr)<0) {

@ -199,7 +199,7 @@ test(fill_t fill_style, const double splits[],
}
if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
if (H5Pset_chunk(dcpl, 1, ch_size)<0) goto error;
if ((xfer=H5Pcreate(H5P_DATA_XFER))<0) goto error;
if ((xfer=H5Pcreate(H5P_DATASET_XFER))<0) goto error;
if (H5Pset_btree_ratios(xfer, splits[0], splits[1], splits[2])<0) {
goto error;
}
@ -335,7 +335,7 @@ main(int argc, char *argv[])
/* Default split ratios */
H5Eset_auto(display_error_cb, NULL);
if ((xfer=H5Pcreate(H5P_DATA_XFER))<0) goto error;
if ((xfer=H5Pcreate(H5P_DATASET_XFER))<0) goto error;
if (H5Pget_btree_ratios(xfer, splits+0, splits+1, splits+2)<0) {
goto error;
}

@ -1197,7 +1197,7 @@ test_array_vlen_atomic(void)
CHECK(ret, FAIL, "H5Tclose");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATA_XFER);
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_array_alloc_custom,&mem_used,test_array_free_custom,&mem_used);
@ -1447,7 +1447,7 @@ test_array_vlen_array(void)
CHECK(ret, FAIL, "H5Tclose");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATA_XFER);
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_array_alloc_custom,&mem_used,test_array_free_custom,&mem_used);

@ -2120,7 +2120,7 @@ test_select_hyper_union(void)
dataset=H5Dcreate(fid1,"Dataset4",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate");
xfer = H5Pcreate (H5P_DATA_XFER);
xfer = H5Pcreate (H5P_DATASET_XFER);
CHECK(xfer, FAIL, "H5Pcreate");
ret = H5Pset_hyper_cache(xfer,0,1);

@ -154,7 +154,7 @@ test_vlstrings_basic(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL string */
xfer_pid=H5Pcreate(H5P_DATA_XFER);
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vlstr_alloc_custom,&mem_used,test_vlstr_free_custom,&mem_used);

@ -153,7 +153,7 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATA_XFER);
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@ -293,7 +293,7 @@ test_vltypes_vlen_compound(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATA_XFER);
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@ -445,7 +445,7 @@ test_vltypes_compound_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATA_XFER);
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@ -662,7 +662,7 @@ test_vltypes_vlen_vlen_atomic(void)
CHECK(dataset, FAIL, "H5Dopen");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATA_XFER);
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);

@ -566,7 +566,7 @@ dataset_writeAll(char *filename)
}
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATA_XFER);
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "");
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
@ -629,7 +629,7 @@ printf("writeAll by some with zero row\n");
}
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATA_XFER);
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "");
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
@ -779,7 +779,7 @@ dataset_readAll(char *filename)
}
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATA_XFER);
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "");
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
@ -841,7 +841,7 @@ printf("readAll by some with zero col\n");
}
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATA_XFER);
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "");
ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");