diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 8 | ||||
-rw-r--r-- | src/H5D.c | 12 | ||||
-rw-r--r-- | src/H5Dpublic.h | 9 | ||||
-rw-r--r-- | src/H5FD.c | 10 | ||||
-rw-r--r-- | src/H5FDdpss.c | 2 | ||||
-rw-r--r-- | src/H5FDfamily.c | 4 | ||||
-rw-r--r-- | src/H5FDmpio.c | 4 | ||||
-rw-r--r-- | src/H5FDmulti.c | 4 | ||||
-rw-r--r-- | src/H5Farray.c | 2 | ||||
-rw-r--r-- | src/H5Fpublic.h | 17 | ||||
-rw-r--r-- | src/H5P.c | 855 | ||||
-rw-r--r-- | src/H5Ppublic.h | 39 | ||||
-rw-r--r-- | src/H5T.c | 2 | ||||
-rw-r--r-- | src/H5Tconv.c | 2 | ||||
-rw-r--r-- | src/H5Tpublic.h | 4 |
15 files changed, 914 insertions, 60 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) diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 1090a40..8a6cf93 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -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 diff --git a/src/H5FDdpss.c b/src/H5FDdpss.c index e5d4247..67889de 100644 --- a/src/H5FDdpss.c +++ b/src/H5FDdpss.c @@ -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"); } diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 048c03b..5266336 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -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; } diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index aa37e90..17d0acb 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -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"); diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 08a8a5c..455039a 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -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); } diff --git a/src/H5Farray.c b/src/H5Farray.c index 6faa42f..2c2a6c9 100644 --- a/src/H5Farray.c +++ b/src/H5Farray.c @@ -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"); } diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 3f0e648..4174f0c 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -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 */ @@ -31,6 +31,21 @@ static char RcsId[] = "@(#)$Revision$"; /* Default file driver - see H5Pget_driver() */ #include <H5FDsec2.h> /* Posix unbuffered I/O file driver */ +#ifdef WANT_H5_V1_2_COMPAT +/* Other predefined file drivers */ +#include <H5FDcore.h> /* Files stored entirely in memory */ +#include <H5FDfamily.h> /* File families */ +#include <H5FDmpio.h> /* Parallel files using MPI-2 I/O */ +#include <H5FDstdio.h> /* Standard C buffered I/O */ +#include <H5FDsrb.h> /* Remote access using SRB */ +#include <H5FDgass.h> /* Remote files using GASS I/O */ +#include <H5FDdpss.h> /* Remote access using Storage Client API */ +#include <H5FDstream.h> /* in-memory files streamed via sockets */ +#include <H5FDmulti.h> /* Usage-partitioned file family */ +#include <H5FDlog.h> /* sec2 driver with I/O logging (for debugging) */ +#endif /* WANT_H5_V1_2_COMPAT */ + + #define PABLO_MASK H5P_mask /* Is the interface initialized? */ @@ -46,7 +61,7 @@ hid_t H5P_NO_CLASS_g = FAIL; hid_t H5P_FILE_CREATE_g = FAIL; hid_t H5P_FILE_ACCESS_g = FAIL; hid_t H5P_DATASET_CREATE_g = FAIL; -hid_t H5P_DATA_XFER_g = FAIL; +hid_t H5P_DATASET_XFER_g = FAIL; hid_t H5P_MOUNT_g = FAIL; /* Local static functions */ @@ -208,7 +223,7 @@ H5P_init_interface(void) HRETURN_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed"); /* Register the file access class */ - if ((H5P_DATA_XFER_g = H5I_register (H5I_GENPROP_CLS, pclass))<0) + if ((H5P_DATASET_XFER_g = H5I_register (H5I_GENPROP_CLS, pclass))<0) HRETURN_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class"); /* Register the dataset creation and data xfer property classes */ @@ -222,11 +237,11 @@ H5P_init_interface(void) HRETURN_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class"); /* Allocate the data xfer class */ - if (NULL==(pclass = H5P_create_class (root_class,"data xfer",H5P_DATA_XFER_HASH_SIZE,1,NULL,NULL,NULL,NULL))) + if (NULL==(pclass = H5P_create_class (root_class,"data xfer",H5P_DATASET_XFER_HASH_SIZE,1,NULL,NULL,NULL,NULL))) HRETURN_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL, "class initialization failed"); /* Register the data xfer class */ - if ((H5P_DATA_XFER_g = H5I_register (H5I_GENPROP_CLS, pclass))<0) + if ((H5P_DATASET_XFER_g = H5I_register (H5I_GENPROP_CLS, pclass))<0) HRETURN_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class"); /* When do the "basic" properties for each of the library classes get added? */ @@ -324,7 +339,7 @@ H5Pcreate(H5P_class_t type) case H5P_DATASET_CREATE: src = &H5D_create_dflt; break; - case H5P_DATA_XFER: + case H5P_DATASET_XFER: src = &H5D_xfer_dflt; break; case H5P_MOUNT: @@ -479,7 +494,7 @@ H5P_close(void *_plist) H5O_reset(H5O_PLINE, &(dc_list->pline)); break; - case H5P_DATA_XFER: + case H5P_DATASET_XFER: if (dx_list->driver_id>=0) { H5FD_dxpl_free(dx_list->driver_id, dx_list->driver_info); H5I_dec_ref(dx_list->driver_id); @@ -683,7 +698,7 @@ H5P_copy (H5P_class_t type, const void *src) size = sizeof(H5D_create_t); break; - case H5P_DATA_XFER: + case H5P_DATASET_XFER: size = sizeof(H5D_xfer_t); break; @@ -747,7 +762,7 @@ H5P_copy (H5P_class_t type, const void *src) } break; - case H5P_DATA_XFER: + case H5P_DATASET_XFER: dx_dst = (H5D_xfer_t*)dst; if (dx_dst->driver_id>=0) { @@ -1696,7 +1711,7 @@ H5Pset_driver(hid_t plist_id, hid_t driver_id, const void *driver_info) fapl->driver_id = driver_id; fapl->driver_info = H5FD_fapl_copy(driver_id, driver_info); - } else if (H5P_DATA_XFER==H5P_get_class(plist_id)) { + } else if (H5P_DATASET_XFER==H5P_get_class(plist_id)) { if (NULL==(dxpl=H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); @@ -1719,6 +1734,97 @@ H5Pset_driver(hid_t plist_id, hid_t driver_id, const void *driver_info) FUNC_LEAVE(SUCCEED); } +#ifdef WANT_H5_V1_2_COMPAT + +/*------------------------------------------------------------------------- + * Function: H5Pget_driver + * + * Purpose: Return the ID of the low-level file driver. PLIST_ID should + * be a file access property list. + * + * Return: Success: A low-level driver ID + * + * Failure: H5F_LOW_ERROR (a negative value) + * + * Programmer: Robb Matzke + * Thursday, February 26, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +H5F_driver_t +H5Pget_driver(hid_t plist_id) +{ + H5F_access_t *plist = NULL; + H5F_driver_t ret_value=H5F_LOW_ERROR; + + FUNC_ENTER (H5Pget_driver, H5F_LOW_ERROR); + H5TRACE1("Fd","i",plist_id); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == (plist=H5I_object (plist_id))) { + HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, H5F_LOW_ERROR, + "not a file access property list"); + } + + if(plist->driver_id==H5FD_SEC2 || plist->driver_id==H5P_DEFAULT) + ret_value=H5F_LOW_SEC2; + else if(plist->driver_id==H5FD_STDIO) + ret_value=H5F_LOW_STDIO; + else if(plist->driver_id==H5FD_MPIO) + ret_value=H5F_LOW_MPIO; + else if(plist->driver_id==H5FD_CORE) + ret_value=H5F_LOW_CORE; + else if(plist->driver_id==H5FD_FAMILY) + ret_value=H5F_LOW_FAMILY; + else if(plist->driver_id==H5FD_MULTI) { /* Need to check if it's a split or multi file */ + H5FD_mem_t mt; + H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; + uintn multi=0; + + /* Get the information from the multi file driver */ + if (H5Pget_fapl_multi(plist_id,memb_map,NULL,NULL,memb_addr,NULL)<0) { + HRETURN_ERROR (H5E_PLIST, H5E_NOTFOUND, FAIL, + "can't get multi file information"); + } + + /* Check whether all of the meta data is in one file & the raw data in another */ + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) { + if(mt==H5FD_MEM_DRAW) { + if(memb_map[mt]!=H5FD_MEM_DRAW) { + multi=1; + break; + } /* end if */ + } /* end if */ + else { + if(memb_map[mt]!=H5FD_MEM_SUPER) { + multi=1; + break; + } /* end if */ + } /* end else */ + } /* end for */ + + /* Check further if things look like a split file currently */ + if(!multi) { + if(memb_addr[H5FD_MEM_SUPER]!=0 || memb_addr[H5FD_MEM_DRAW] != HADDR_MAX/2) + multi=1; + } /* end if */ + + if(multi) + ret_value=H5F_LOW_ERROR; /* v1.2 didn't have multi-file driver */ + else + ret_value=H5F_LOW_SPLIT; + } /* end if */ + else + ret_value=H5F_LOW_ERROR; /* error, or driver unknown to v1.2 */ + + FUNC_LEAVE (ret_value); +} + +#else /* WANT_H5_V1_2_COMPAT */ /*------------------------------------------------------------------------- * Function: H5Pget_driver @@ -1759,7 +1865,7 @@ H5Pget_driver(hid_t plist_id) (fapl=H5I_object(plist_id))) { ret_value = fapl->driver_id; - } else if (H5P_DATA_XFER==H5P_get_class(plist_id) && + } else if (H5P_DATASET_XFER==H5P_get_class(plist_id) && (dxpl=H5I_object(plist_id))) { ret_value = dxpl->driver_id; @@ -1768,11 +1874,12 @@ H5Pget_driver(hid_t plist_id) "not a file access or data transfer property list"); } - if (-2==ret_value) + if (H5P_DEFAULT==ret_value) ret_value = H5FD_SEC2; FUNC_LEAVE(ret_value); } +#endif /* WANT_H5_V1_2_COMPAT */ /*------------------------------------------------------------------------- @@ -1809,7 +1916,7 @@ H5Pget_driver_info(hid_t plist_id) (fapl=H5I_object(plist_id))) { ret_value = fapl->driver_info; - } else if (H5P_DATA_XFER==H5P_get_class(plist_id) && + } else if (H5P_DATASET_XFER==H5P_get_class(plist_id) && (dxpl=H5I_object(plist_id))) { ret_value = dxpl->driver_info; @@ -1821,6 +1928,702 @@ H5Pget_driver_info(hid_t plist_id) FUNC_LEAVE(ret_value); } +#ifdef WANT_H5_V1_2_COMPAT + +/*------------------------------------------------------------------------- + * Function: H5Pset_stdio + * + * Purpose: Set the low level file driver to use the functions declared + * in the stdio.h file: fopen(), fseek() or fseek64(), fread(), + * fwrite(), and fclose(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 19, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_stdio(hid_t plist_id) +{ + FUNC_ENTER (H5Pset_stdio, FAIL); + H5TRACE1("e","i",plist_id); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == H5I_object(plist_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + + FUNC_LEAVE(H5Pset_fapl_stdio(plist_id)); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pget_stdio + * + * Purpose: If the file access property list is set to the stdio driver + * then this function returns zero; otherwise it returns a + * negative value. In the future, additional arguments may be + * added to this function to match those added to H5Pset_stdio(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 26, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_stdio(hid_t plist_id) +{ + herr_t ret_value=FAIL; + + FUNC_ENTER (H5Pget_stdio, FAIL); + H5TRACE1("e","i",plist_id); + + /* Check arguments and test driver */ + if (H5P_FILE_ACCESS==H5P_get_class(plist_id) && + (H5FD_STDIO == H5Pget_driver(plist_id))) { + ret_value=SUCCEED; + } + else { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + + FUNC_LEAVE (ret_value); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pset_sec2 + * + * Purpose: Set the low-level file driver to use the functions declared + * in the unistd.h file: open(), lseek() or lseek64(), read(), + * write(), and close(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 19, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_sec2(hid_t plist_id) +{ + FUNC_ENTER (H5Pset_sec2, FAIL); + H5TRACE1("e","i",plist_id); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == H5I_object(plist_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + + FUNC_LEAVE(H5Pset_fapl_sec2(plist_id)); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pget_sec2 + * + * Purpose: If the file access property list is set to the sec2 driver + * then this function returns zero; otherwise it returns a + * negative value. In the future, additional arguments may be + * added to this function to match those added to H5Pset_sec2(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 26, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_sec2(hid_t plist_id) +{ + herr_t ret_value=FAIL; + + FUNC_ENTER (H5Pget_sec2, FAIL); + H5TRACE1("e","i",plist_id); + + /* Check arguments and test driver */ + if (H5P_FILE_ACCESS==H5P_get_class(plist_id) && + (H5FD_SEC2 == H5Pget_driver(plist_id))) { + ret_value=SUCCEED; + } + else { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + + FUNC_LEAVE (ret_value); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pset_core + * + * Purpose: Set the low-level file driver to use malloc() and free(). + * This driver is restricted to temporary files which are not + * larger than the amount of virtual memory available. The + * INCREMENT argument determines the file block size and memory + * will be allocated in multiples of INCREMENT bytes. A liberal + * INCREMENT results in fewer calls to realloc() and probably + * less memory fragmentation. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 19, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_core(hid_t plist_id, size_t increment) +{ + FUNC_ENTER (H5Pset_core, FAIL); + H5TRACE2("e","iz",plist_id,increment); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == H5I_object(plist_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + if (increment<1) { + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, + "increment must be positive"); + } + + FUNC_LEAVE(H5Pset_fapl_core(plist_id,increment,0)); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pget_core + * + * Purpose: If the file access property list is set to the core driver + * then this function returns zero; otherwise it returns a + * negative value. On success, the block size is returned + * through the INCREMENT argument if it isn't the null pointer. + * In the future, additional arguments may be added to this + * function to match those added to H5Pset_core(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 26, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_core(hid_t plist_id, size_t *increment/*out*/) +{ + herr_t ret_value=FAIL; + + FUNC_ENTER (H5Pget_core, FAIL); + H5TRACE2("e","ix",plist_id,increment); + + /* Check arguments */ + if (H5P_FILE_ACCESS==H5P_get_class(plist_id) && + (H5FD_CORE == H5Pget_driver(plist_id)) && + H5Pget_fapl_core(plist_id,increment,NULL)>=0) { + ret_value=SUCCEED; + } + else { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + + FUNC_LEAVE (ret_value); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pset_split + * + * Purpose: Set the low-level driver to split meta data from raw data, + * storing meta data in one file and raw data in another file. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 19, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +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) +{ + FUNC_ENTER (H5Pset_split, FAIL); + H5TRACE5("e","isisi",plist_id,meta_ext,meta_plist_id,raw_ext,raw_plist_id); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == H5I_object(plist_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + if (H5P_DEFAULT!=meta_plist_id && + (H5P_FILE_ACCESS != H5P_get_class(meta_plist_id) || + NULL == H5I_object(meta_plist_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + if (H5P_DEFAULT!=raw_plist_id && + (H5P_FILE_ACCESS != H5P_get_class(raw_plist_id) || + NULL == H5I_object(raw_plist_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + + /* Set driver */ + FUNC_LEAVE (H5Pset_fapl_split(plist_id,meta_ext,meta_plist_id,raw_ext,raw_plist_id)); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pget_split + * + * Purpose: If the file access property list is set to the sec2 driver + * then this function returns zero; otherwise it returns a + * negative value. On success, at most META_EXT_SIZE characters + * are copied to the META_EXT buffer if non-null and at most + * RAW_EXT_SIZE characters are copied to the RAW_EXT buffer if + * non-null. If the actual extension is larger than the number + * of characters requested then the buffer will not be null + * terminated (that is, behavior like strncpy()). In addition, + * if META_PROPERTIES and/or RAW_PROPERTIES are non-null then + * the file access property list of the meta file and/or raw + * file is copied and its OID returned through these arguments. + * In the future, additional arguments may be added to this + * function to match those added to H5Pset_sec2(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 26, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +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*/) +{ + H5FD_mem_t mt; + H5FD_mem_t _memb_map[H5FD_MEM_NTYPES]; + hid_t _memb_fapl[H5FD_MEM_NTYPES]; + char _memb_name[H5FD_MEM_NTYPES][16]; + char *_memb_name_ptrs[H5FD_MEM_NTYPES]; + haddr_t _memb_addr[H5FD_MEM_NTYPES]; + + FUNC_ENTER (H5Pget_split, FAIL); + H5TRACE7("e","izxxzxx",plist_id,meta_ext_size,meta_ext,meta_properties, + raw_ext_size,raw_ext,raw_properties); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == H5I_object (plist_id)) { + HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + if (H5FD_MULTI != H5Pget_driver(plist_id)) { + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, + "the split driver is not set"); + } + + /* Reset output args for error handling */ + if (meta_ext && meta_ext_size>0) + *meta_ext = '\0'; + if (raw_ext && raw_ext_size>0) + *raw_ext = '\0'; + if (meta_properties) + *meta_properties = FAIL; + if (raw_properties) + *raw_properties = FAIL; + + /* Set up the member extention pointers */ + for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) + _memb_name_ptrs[mt] = &_memb_name[mt][0]; + + /* Get the information from the multi file driver */ + if (H5Pget_fapl_multi(plist_id,_memb_map,_memb_fapl,_memb_name_ptrs,_memb_addr,NULL)<0) { + HRETURN_ERROR (H5E_PLIST, H5E_NOTFOUND, FAIL, + "can't get split file information"); + } + + /* Output arguments */ + if (meta_ext && meta_ext_size>0) { + if (_memb_name[H5FD_MEM_SUPER]) { + HDstrncpy (meta_ext, _memb_name[H5FD_MEM_SUPER], meta_ext_size); + } else { + HDstrncpy (meta_ext, ".meta", meta_ext_size); + } + } + if (raw_ext && raw_ext_size>0) { + if (_memb_name[H5FD_MEM_DRAW]) { + HDstrncpy (raw_ext, _memb_name[H5FD_MEM_DRAW], raw_ext_size); + } else { + HDstrncpy (raw_ext, ".raw", raw_ext_size); + } + } + if (meta_properties) { + *meta_properties = _memb_fapl[H5FD_MEM_SUPER]; + } + if (raw_properties) { + *raw_properties = _memb_fapl[H5FD_MEM_DRAW]; + } + + FUNC_LEAVE (SUCCEED); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pset_family + * + * Purpose: Sets the low-level driver to stripe the hdf5 address space + * across a family of files. The MEMB_SIZE argument indicates + * the size in bytes of each family member and is only + * meaningful when creating new files or opening families that + * have only one member. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 19, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_family(hid_t plist_id, hsize_t memb_size, hid_t memb_plist_id) +{ + FUNC_ENTER (H5Pset_family, FAIL); + H5TRACE3("e","ihi",plist_id,memb_size,memb_plist_id); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == H5I_object(plist_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + if (memb_size && memb_size<1024) { + HRETURN_ERROR (H5E_ARGS, H5E_BADRANGE, FAIL, + "family member size is too small"); + } + if (H5P_DEFAULT!=memb_plist_id && + (H5P_FILE_ACCESS != H5P_get_class(memb_plist_id) || + NULL == H5I_object(memb_plist_id))) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + + /* Set driver */ + FUNC_LEAVE(H5Pset_fapl_family(plist_id,memb_size,memb_plist_id)); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pget_family + * + * Purpose: If the file access property list is set to the family driver + * then this function returns zero; otherwise it returns a + * negative value. On success, if MEMB_PLIST_ID is a non-null + * pointer it will be initialized with the id of an open + * property list: the file access property list for the family + * members. In the future, additional arguments may be added to + * this function to match those added to H5Pset_family(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 26, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_family(hid_t plist_id, hsize_t *memb_size/*out*/, + hid_t *memb_plist_id/*out*/) +{ + FUNC_ENTER (H5Pget_family, FAIL); + H5TRACE3("e","ixx",plist_id,memb_size,memb_plist_id); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == H5I_object (plist_id)) { + HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + if (H5FD_FAMILY == H5Pget_driver(plist_id)) { + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, + "the family driver is not set"); + } + + /* Retrieve args */ + FUNC_LEAVE (H5Pget_fapl_family(plist_id,memb_size,memb_plist_id)); +} + + +#ifdef HAVE_PARALLEL +/*------------------------------------------------------------------------- + * Function: H5Pset_mpi + * + * Signature: herr_t H5Pset_mpi(hid_t plist_id, MPI_Comm comm, MPI_Info info) + * + * Purpose: Store the access mode for MPIO call and the user supplied + * communicator and info in the access property list which can + * then be used to open file. This function is available only + * in the parallel HDF5 library and is not a collective + * function. + * + * Parameters: + * hid_t plist_id + * ID of property list to modify + * MPI_Comm comm + * MPI communicator to be used for file open as defined in + * MPI_FILE_OPEN of MPI-2. This function does not make a + * duplicated communicator. Any modification to comm after + * this function call returns may have undetermined effect + * to the access property list. Users should call this + * function again to setup the property list. + * MPI_Info info + * MPI info object to be used for file open as defined in + * MPI_FILE_OPEN of MPI-2. This function does not make a + * duplicated info. Any modification to info after + * this function call returns may have undetermined effect + * to the access property list. Users should call this + * function again to setup the property list. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Albert Cheng + * Feb 3, 1998 + * + * Modifications: + * + * Robb Matzke, 18 Feb 1998 + * Check all arguments before the property list is updated so we don't + * leave the property list in a bad state if something goes wrong. Also, + * the property list data type changed to allow more generality so all + * the mpi-related stuff is in the `u.mpi' member. The `access_mode' + * will contain only mpi-related flags defined in H5Fpublic.h. + * + * Albert Cheng, Apr 16, 1998 + * Removed the access_mode argument. The access_mode is changed + * to be controlled by data transfer property list during data + * read/write calls. + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_mpi(hid_t plist_id, MPI_Comm comm, MPI_Info info) +{ + FUNC_ENTER(H5Pset_mpi, FAIL); + H5TRACE3("e","iMcMi",plist_id,comm,info); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class(plist_id) || + NULL == H5I_object(plist_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + + /* Set driver */ + FUNC_LEAVE(H5Pset_fapl_mpio(plist_id,comm,info)); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pget_mpi + * + * Purpose: If the file access property list is set to the mpi driver + * then this function returns zero; otherwise it returns a + * negative value. In the future, additional arguments may be + * added to this function to match those added to H5Pset_mpi(). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, February 26, 1998 + * + * Modifications: + * + * Albert Cheng, Apr 16, 1998 + * Removed the access_mode argument. The access_mode is changed + * to be controlled by data transfer property list during data + * read/write calls. + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_mpi(hid_t plist_id, MPI_Comm *comm, MPI_Info *info) +{ + FUNC_ENTER (H5Pget_mpi, FAIL); + H5TRACE3("e","i*Mc*Mi",plist_id,comm,info); + + /* Check arguments */ + if (H5P_FILE_ACCESS != H5P_get_class (plist_id) || + NULL == H5I_object (plist_id)) { + HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + if (H5FD_MPIO == H5Pget_driver(plist_id)) { + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, + "the mpi driver is not set"); + } + + /* Retrieve args */ + FUNC_LEAVE (H5Pget_fapl_mpio(plist_id,comm,info)); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pset_xfer + * + * Signature: herr_t H5Pset_xfer(hid_t plist_id, + * H5D_transfer_t data_xfer_mode) + * + * Purpose: Set the transfer mode of the dataset transfer property list. + * The list can then be used to control the I/O transfer mode + * during dataset accesses. This function is available only + * in the parallel HDF5 library and is not a collective function. + * + * Parameters: + * hid_t plist_id + * ID of a dataset transfer property list + * H5D_transfer_t data_xfer_mode + * Data transfer modes: + * H5D_XFER_INDEPENDENT + * Use independent I/O access. + * H5D_XFER_COLLECTIVE + * Use MPI collective I/O access. + * H5D_XFER_DFLT + * Use default I/O access. Currently, + * independent is the default mode. + * + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Albert Cheng + * April 2, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_xfer(hid_t plist_id, H5D_transfer_t data_xfer_mode) +{ + H5FD_mpio_xfer_t dx_xfer_mode; + + FUNC_ENTER(H5Pset_xfer, FAIL); + H5TRACE2("e","iDt",plist_id,data_xfer_mode); + + /* Check arguments */ + if (H5P_DATASET_XFER != H5P_get_class(plist_id) || + NULL == H5I_object(plist_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a dataset transfer property list"); + } + + switch (data_xfer_mode) { + case H5D_XFER_COLLECTIVE: + dx_xfer_mode = H5FD_MPIO_COLLECTIVE; + break; + + case H5D_XFER_INDEPENDENT: + case H5D_XFER_DFLT: + dx_xfer_mode = H5FD_MPIO_INDEPENDENT; + break; + + default: + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, + "invalid dataset transfer mode"); + } + + FUNC_LEAVE(H5Pset_dxpl_mpio(plist_id,dx_xfer_mode)); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pget_xfer + * + * Purpose: Reads the transfer mode current set in the property list. + * This function is available only in the parallel HDF5 library + * and is not a collective function. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Albert Cheng + * April 2, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_xfer(hid_t plist_id, H5D_transfer_t *data_xfer_mode) +{ + H5FD_mpio_xfer_t dx_xfer_mode; + + FUNC_ENTER (H5Pget_xfer, FAIL); + H5TRACE2("e","i*Dt",plist_id,data_xfer_mode); + + /* Check arguments */ + if (H5P_DATASET_XFER != H5P_get_class(plist_id) || + NULL == H5I_object(plist_id)) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a dataset transfer property list"); + } + + if(data_xfer_mode) { + if(H5Pget_fapl_mpio(plist_id,&dx_xfer_mode)<0) { + HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, + "not a dataset transfer property list"); + } + switch(dx_xfer_mode) { + H5FD_MPIO_INDEPENDENT: + *data_xfer_mode = H5D_XFER_INDEPENDENT; + break; + + H5FD_MPIO_COLLECTIVE: + *data_xfer_mode = H5D_XFER_COLLECTIVE; + break; + } /* end switch */ + } /* end if */ + + FUNC_LEAVE (SUCCEED); +} +#endif /*HAVE_PARALLEL*/ +#endif /* WANT_H5_V1_2_COMPAT */ + /*------------------------------------------------------------------------- * Function: H5Pset_cache @@ -1967,7 +2770,7 @@ H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg) H5TRACE4("e","izxx",plist_id,size,tconv,bkg); /* Check arguments */ - if (H5P_DATA_XFER != H5P_get_class (plist_id) || + if (H5P_DATASET_XFER != H5P_get_class (plist_id) || NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); @@ -2011,7 +2814,7 @@ H5Pget_buffer(hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/) H5TRACE3("z","ixx",plist_id,tconv,bkg); /* Check arguments */ - if (H5P_DATA_XFER != H5P_get_class (plist_id) || + if (H5P_DATASET_XFER != H5P_get_class (plist_id) || NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, 0, "not a dataset transfer property list"); @@ -2059,7 +2862,7 @@ H5Pset_hyper_cache(hid_t plist_id, unsigned cache, unsigned limit) H5TRACE3("e","iIuIu",plist_id,cache,limit); /* Check arguments */ - if (H5P_DATA_XFER != H5P_get_class (plist_id) || + if (H5P_DATASET_XFER != H5P_get_class (plist_id) || NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); @@ -2097,7 +2900,7 @@ H5Pget_hyper_cache(hid_t plist_id, unsigned *cache/*out*/, H5TRACE3("e","ixx",plist_id,cache,limit); /* Check arguments */ - if (H5P_DATA_XFER != H5P_get_class (plist_id) || + if (H5P_DATASET_XFER != H5P_get_class (plist_id) || NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); @@ -2140,7 +2943,7 @@ H5Pset_preserve(hid_t plist_id, hbool_t status) H5TRACE2("e","ib",plist_id,status); /* Check arguments */ - if (H5P_DATA_XFER != H5P_get_class (plist_id) || + if (H5P_DATASET_XFER != H5P_get_class (plist_id) || NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); @@ -2178,7 +2981,7 @@ H5Pget_preserve(hid_t plist_id) H5TRACE1("Is","i",plist_id); /* Check arguments */ - if (H5P_DATA_XFER != H5P_get_class (plist_id) || + if (H5P_DATASET_XFER != H5P_get_class (plist_id) || NULL == (plist = H5I_object (plist_id))) { HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); @@ -2234,7 +3037,7 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, H5TRACE5("e","iZfIuz*[a3]Iu",plist_id,filter,flags,cd_nelmts,cd_values); /* Check arguments */ - if (H5P_DATA_XFER==H5P_get_class(plist_id)) { + if (H5P_DATASET_XFER==H5P_get_class(plist_id)) { HRETURN_ERROR(H5E_PLINE, H5E_UNSUPPORTED, FAIL, "transient pipelines are not supported yet"); } @@ -2298,7 +3101,7 @@ H5Pget_nfilters(hid_t plist_id) FUNC_ENTER(H5Pget_nfilters, FAIL); H5TRACE1("Is","i",plist_id); - if (H5P_DATA_XFER==H5P_get_class(plist_id)) { + if (H5P_DATASET_XFER==H5P_get_class(plist_id)) { HRETURN_ERROR(H5E_PLINE, H5E_UNSUPPORTED, FAIL, "transient pipelines are not supported yet"); } @@ -2350,7 +3153,7 @@ H5Pget_filter(hid_t plist_id, int idx, unsigned int *flags/*out*/, name); /* Check arguments */ - if (H5P_DATA_XFER==H5P_get_class(plist_id)) { + if (H5P_DATASET_XFER==H5P_get_class(plist_id)) { HRETURN_ERROR(H5E_PLINE, H5E_UNSUPPORTED, H5Z_FILTER_ERROR, "transient filters are not supported yet"); } @@ -2445,7 +3248,7 @@ H5Pset_deflate(hid_t plist_id, unsigned level) H5TRACE2("e","iIu",plist_id,level); /* Check arguments */ - if (H5P_DATA_XFER==H5P_get_class(plist_id)) { + if (H5P_DATASET_XFER==H5P_get_class(plist_id)) { HRETURN_ERROR(H5E_PLINE, H5E_UNSUPPORTED, FAIL, "transient filter pipelines are not supported yet"); } @@ -2497,7 +3300,7 @@ H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/, double *middle/*out*/, H5TRACE4("e","ixxx",plist_id,left,middle,right); /* Check arguments */ - if (H5P_DATA_XFER!=H5P_get_class(plist_id) || + if (H5P_DATASET_XFER!=H5P_get_class(plist_id) || NULL==(plist=H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); @@ -2547,7 +3350,7 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, H5TRACE4("e","iddd",plist_id,left,middle,right); /* Check arguments */ - if (H5P_DATA_XFER!=H5P_get_class(plist_id) || + if (H5P_DATASET_XFER!=H5P_get_class(plist_id) || NULL==(plist=H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); @@ -2854,7 +3657,7 @@ H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func, H5TRACE5("e","ixxxx",plist_id,alloc_func,alloc_info,free_func,free_info); /* Check arguments */ - if (H5P_DATA_XFER!=H5P_get_class(plist_id) || + if (H5P_DATASET_XFER!=H5P_get_class(plist_id) || NULL==(plist=H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); @@ -2896,7 +3699,7 @@ H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func/*out*/, H5TRACE5("e","ixxxx",plist_id,alloc_func,alloc_info,free_func,free_info); /* Check arguments */ - if (H5P_DATA_XFER!=H5P_get_class(plist_id) || + if (H5P_DATASET_XFER!=H5P_get_class(plist_id) || NULL==(plist=H5I_object(plist_id))) { HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list"); diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index c0085f1..46e74a6 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -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"); } diff --git a/src/H5Tconv.c b/src/H5Tconv.c index ae1c2dd..1c2eada 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -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"); } diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 4257f3c..1a20382 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -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 */ |