From 447c7e4d37e16fc95dc38b1e267d41eed3818ece Mon Sep 17 00:00:00 2001 From: Frank Baker Date: Wed, 11 Apr 2001 17:30:56 -0500 Subject: [svn-r3802] Purpose: Importing UG changes from 1.4 release branch into development branch (1.5) --- doc/html/Chunking.html | 6 +- doc/html/Datasets.html | 8 +-- doc/html/Datatypes.html | 158 ++++++++++++++++++++---------------------------- doc/html/Files.html | 129 ++++++++++++++------------------------- 4 files changed, 117 insertions(+), 184 deletions(-) diff --git a/doc/html/Chunking.html b/doc/html/Chunking.html index 42a0ab6..be80420 100644 --- a/doc/html/Chunking.html +++ b/doc/html/Chunking.html @@ -209,7 +209,7 @@ obvious way is to reduce the number of chunks by choosing a larger chunk size (doubling the chunk size will cut the number of B-tree nodes in half). Another method is to adjust the split ratios for the B-tree by - calling H5Pset_split_ratios(), but this method typically + calling H5Pset_btree_ratios(), but this method typically results in only a slight improvement over the default settings. Finally, the out-degree of each node can be increased by calling H5Pset_istore_k() (increasing the out degree actually @@ -273,11 +273,11 @@ -Last modified: 13 December 1999 +Last modified: 16 February 2001
-Describes HDF5 Release 1.4, February 2001 +Describes HDF5 Release 1.4.1, April 2001 diff --git a/doc/html/Datasets.html b/doc/html/Datasets.html index 20f2cd6..368b97c 100644 --- a/doc/html/Datasets.html +++ b/doc/html/Datasets.html @@ -797,7 +797,7 @@ H5Pset_external (plist, "scan3.data", 0, 16); 17 size[0] = 100; /*size of hyperslab*/ 18 size[1] = 200; 19 file_space = H5Dget_space (dataset); -20 H5Sset_hyperslab (file_space, 2, offset, size); +20 H5Sselect_hyperslab (file_space, H5S_SELECT_SET, offset, NULL, size, NULL); 21 22 /* 23 * Describe the memory data space. @@ -810,7 +810,7 @@ H5Pset_external (plist, "scan3.data", 0, 16); 30 offset[1] = 0; 31 size[0] = 100; /*size of hyperslab*/ 32 size[1] = 200; -33 H5Sset_hyperslab (mem_space, 2, offset, size); +33 H5Sselect_hyperslab (mem_space, H5S_SELECT_SET, offset, NULL, size, NULL); 34 35 /* 36 * Read the dataset. @@ -928,11 +928,11 @@ H5Pset_external (plist, "scan3.data", 0, 16); -Last modified: 7 April 2000 +Last modified: 2 March 2001
-Describes HDF5 Release 1.4, February 2001 +Describes HDF5 Release 1.4.1, April 2001 diff --git a/doc/html/Datatypes.html b/doc/html/Datatypes.html index ffe72f9..9548e07 100644 --- a/doc/html/Datatypes.html +++ b/doc/html/Datatypes.html @@ -608,36 +608,11 @@ respect to the beginning of the containing compound datum is returned by this function. A zero is returned on failure which is also a valid offset, but this function is guaranteed - to succeed if a call to H5Tget_member_dims() + to succeed if a call to H5Tget_member_class() succeeds when called with the same type and membno arguments.

-
int H5Tget_member_dims (hid_t type, int - membno, int dims[4], int - perm[4]) -
Each member can be a small array of up to four dimensions, - making it convenient to describe things like transposition - matrices. The dimensionality of the member is returned (or - negative for failure) and the size in each dimension is - returned through the dims argument. The - perm argument describes how the array's elements are - mapped to the linear address space of memory with respect to - some reference order (the reference order is specified in - natural language documentation which describes the compound - datatype). The application which "invented" the type will - often use the identity permutation and other applications will - use a permutation that causes the elements to be rearranged to - the desired order. Only the first few elements of - dims and perm are initialized according to - the dimensionality of the member. Scalar members have - dimensionality zero. - - The only permutations supported at this - time are the identity permutation and the transpose - permutation (in the 4d case, {0,1,2,3} and {3,2,1,0}). - -

hid_t H5Tget_member_type (hid_t type, int membno)
Each member has its own datatype, a copy of which is @@ -2214,13 +2189,13 @@ reclaiming memory space.
 #include <hdf5.h>
 
-#define FILE   "tvltypes.h5"
+#define FILE   "vltypes.h5"
 #define MAX(X,Y)        ((X)>(Y)?(X):(Y))
 
 /* 1-D dataset with fixed dimensions */
-#define SPACE1_NAME  "Space1"
-#define SPACE1_RANK	1
-#define SPACE1_DIM1	4
+#define SPACE_NAME  "Space"
+#define SPACE_RANK	1
+#define SPACE_DIM	4
 
 void *vltypes_alloc_custom(size_t size, void *info);
 void vltypes_free_custom(void *mem, void *info);
@@ -2235,6 +2210,7 @@ void vltypes_free_custom(void *mem, void *info);
 ****************************************************************/
 void *vltypes_alloc_custom(size_t size, void *info)
 {
+
     void *ret_value=NULL;       /* Pointer to return */
     int *mem_used=(int *)info;  /* Get the pointer to the memory used */
     size_t extra;               /* Extra space needed */
@@ -2245,62 +2221,58 @@ void *vltypes_alloc_custom(size_t size, void *info)
      */
     extra=MAX(sizeof(void *),sizeof(int));
 
-    if((ret_value=malloc(extra+size))!=NULL) {
+    if((ret_value=(void *)malloc(extra+size))!=NULL) {
         *(int *)ret_value=size;
         *mem_used+=size;
     } /* end if */
     ret_value=((unsigned char *)ret_value)+extra;
     return(ret_value);
 }
-
-/****************************************************************
-**
+/******************************************************************
 **  vltypes_free_custom(): VL datatype custom memory
 **      allocation routine.  This routine just uses free to
 **      release the memory and decrements the amount of memory
 **      allocated.
-** 
-****************************************************************/
+** ****************************************************************/
 void vltypes_free_custom(void *_mem, void *info)
-{
+
+{  
     unsigned char *mem;
     int *mem_used=(int *)info;  /* Get the pointer to the memory used */
-    size_t extra;               /* Extra space needed */
-
+    size_t extra;               /* Extra space needed */    
     /*
      *  This weird contortion is required on the DEC Alpha to keep the
-     *  alignment correct. 
-     */
+     *  alignment correct.      
+     */ 
     extra=MAX(sizeof(void *),sizeof(int));
-
-    if(_mem!=NULL) {
+    if(_mem!=NULL) {        
         mem=((unsigned char *)_mem)-extra;
-        *mem_used-=*(int *)mem;
-        free(mem);
+       *mem_used-=*(int *)mem; 
+       free(mem); 
     } /* end if */
 }
 
 int main(void)
-{
-    hvl_t wdata[SPACE1_DIM1];   /* Information to write */
-    hvl_t rdata[SPACE1_DIM1];   /* Information read in */
-    hid_t		fid1;		/* HDF5 File IDs		*/
-    hid_t		dataset;	/* Dataset ID			*/
-    hid_t		sid1;       /* Dataspace ID			*/
-    hid_t		tid1;       /* Datatype ID			*/
+
+{   
+    hvl_t wdata[SPACE_DIM];   /* Information to write */
+    hvl_t rdata[SPACE_DIM];   /* Information read in */
+    hid_t		fid;	   /* HDF5 File IDs */  
+    hid_t		dataset;   /* Dataset ID */
+    hid_t		sid;       /* Dataspace ID */
+    hid_t		tid;       /* Datatype ID	   	 */
     hid_t       xfer_pid;   /* Dataset transfer property list ID */
-    hsize_t		dims1[] = {SPACE1_DIM1};
+    hsize_t		dims[] = {SPACE_DIM};
     uint       i,j;        /* counting variables */
     int         mem_used=0; /* Memory used during allocation */
-    herr_t		ret;		/* Generic return value		*/
-
+    herr_t		ret;		/* Generic return value	 */
 
     /*
      * Allocate and initialize VL data to write 
      */
-    for(i=0; i<SPACE1_DIM1; i++) {
+    for(i=0; i<SPACE_DIM; i++) {
 
-        wdata[i].p=malloc((i+1)*sizeof(unsigned int));
+        wdata[i].p= (unsigned int *)malloc((i+1)*sizeof(unsigned int));
         wdata[i].len=i+1;
         for(j=0; j<(i+1); j++)
             ((unsigned int *)wdata[i].p)[j]=i*10+j;
@@ -2309,65 +2281,67 @@ int main(void)
     /* 
      * Create file. 
      */
-    fid1 = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+    fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
 
     /* 
      * Create dataspace for datasets. 
      */
-    sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+    sid = H5Screate_simple(SPACE_RANK, dims, NULL);
 
     /* 
      * Create a datatype to refer to. 
      */
-    tid1 = H5Tvlen_create (H5T_NATIVE_UINT);
+    tid = H5Tvlen_create (H5T_NATIVE_UINT);
 
     /* 
      * Create a dataset. 
      */
-    dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
+    dataset=H5Dcreate(fid, "Dataset", tid, sid, H5P_DEFAULT);
 
     /* 
      * Write dataset to disk. 
      */
-    ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+    ret=H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
 
     /* 
-     * Change to the custom memory allocation routines for reading VL data 
+     * Change to the custom memory allocation routines for reading 
+     * VL data 
      */
     xfer_pid=H5Pcreate(H5P_DATASET_XFER);
 
-    ret=H5Pset_vlen_mem_manager(xfer_pid,vltypes_alloc_custom,
-                                &mem_used,vltypes_free_custom,&mem_used);
+    ret=H5Pset_vlen_mem_manager(xfer_pid, vltypes_alloc_custom,
+                                &mem_used, vltypes_free_custom, 
+                                &mem_used);
 
     /* 
      * Read dataset from disk. vltypes_alloc_custom and
-     * will be used to manage memory. 
+     * will be used to manage memory.
      */
-    ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,xfer_pid,rdata);
+    ret=H5Dread(dataset, tid, H5S_ALL, H5S_ALL, xfer_pid, rdata);   
 
     /* 
      * Display data read in 
      */
-    for(i=0; i<SPACE1_DIM1; i++) {
-        printf("%d-th element length is %d \n", i, (unsigned) rdata[i].len);
+    for(i=0; i<SPACE_DIM; i++) {
+        printf("%d-th element length is %d \n", i, 
+                                   (unsigned) rdata[i].len);
         for(j=0; j<rdata[i].len; j++) {
-            printf(" %d ",((unsigned int *)rdata[i].p)[j] ); 
-            } 
-        printf("\n");
+            printf(" %d ",((unsigned int *)rdata[i].p)[j] );   
+        } 
+        printf("\n"); 
     } /* end for */
 
     /* 
      * Reclaim the read VL data. vltypes_free_custom will be used 
      * to reclaim the space. 
      */
-    ret=H5Dvlen_reclaim(tid1,sid1,xfer_pid,rdata);
-
+    ret=H5Dvlen_reclaim(tid, sid, xfer_pid, rdata);
 
     /* 
-     * Reclaim the write VL data.  C language free function will be used 
-     * to reclaim space. 
+     * Reclaim the write VL data.  C language free function will be 
+     * used to reclaim space. 
      */
-    ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
+    ret=H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, wdata);
 
     /* 
      * Close Dataset 
@@ -2377,12 +2351,12 @@ int main(void)
     /* 
      * Close datatype 
      */
-    ret = H5Tclose(tid1);
+    ret = H5Tclose(tid);
 
     /* 
      * Close disk dataspace 
      */
-    ret = H5Sclose(sid1);
+    ret = H5Sclose(sid);
     
     /* 
      * Close dataset transfer property list 
@@ -2392,7 +2366,7 @@ int main(void)
     /* 
      * Close file 
      */
-    ret = H5Fclose(fid1);
+    ret = H5Fclose(fid);
 
 } 
       
@@ -2528,9 +2502,10 @@ when they are read in.

10.3 Code Example

-The following example creates an array datatype and creates and writes -a dataset to the HDF5 file. The elements of the dataset have the -array datatype. +The following example creates an array datatype and a dataset +containing elements of the array datatype in an HDF5 file. +It then writes the dataset to the file. +

@@ -2538,12 +2513,7 @@ array datatype.
-/*  
- *  This example creates and writes dataset to the HDF5 file.
- *  Elements of the datasets have an array datatype.
- */
- 
-#include 
+#include <hdf5.h>
 
 #define FILE        "SDS_array_type.h5"
 #define DATASETNAME "IntArray" 
@@ -2569,9 +2539,9 @@ main (void)
     /* 
      * Data  and output buffer initialization. 
      */
-    for (k = 0; k < SPACE_DIM; k++) {
-      for (j = 0; j < ARRAY_DIM1; j++) {
-	for (i = 0; i < ARRAY_DIM2; i++)
+    for (k = 0; k < SPACE_DIM; k++) {
+      for (j = 0; j < ARRAY_DIM1; j++) {
+	for (i = 0; i < ARRAY_DIM2; i++)
                data[k][j][i] = k;
       }
     }     
@@ -3093,11 +3063,11 @@ H5Tregister(H5T_PERS_SOFT, "cus2be",
 
 
 
-Last modified:  9 February 2001
+Last modified:  16 February 2001
 
 
 
-Describes HDF5 Release 1.4, February 2001 +Describes HDF5 Release 1.4.1, April 2001 diff --git a/doc/html/Files.html b/doc/html/Files.html index a217b3b..50d17af 100644 --- a/doc/html/Files.html +++ b/doc/html/Files.html @@ -194,19 +194,17 @@ lseek(), read(), write(), and close(). The lseek64() function is used on operating systems that support it. This driver is enabled and - configured with H5Pset_sec2(), and queried with - H5Pget_sec2(). + configured with H5Pset_fapl_sec2().

Buffered I/O
Local permanent files can be accessed with the functions declared - in the stdio.h header file, namely + in the standard C header file stdio.h, namely fopen(), fseek(), fread(), fwrite(), and fclose(). The fseek64() function is used on operating systems that support it. This driver is enabled and configured with - H5Pset_stdio(), and queried with - H5Pget_stdio(). + H5Pset_fapl_stdio().

Memory I/O @@ -230,8 +228,8 @@ remove the access_mode parameter and have access control specified via the raw data transfer property list of H5Dread() and H5Dwrite().) These parameters are set and queried - with the H5Pset_mpi() and H5Pget_mpi() - calls. + with the H5Pset_fapl_mpi() and + H5Pget_fapl_mpi() calls.

Data Alignment @@ -273,7 +271,7 @@ hid_t file_id; access_plist = H5Pcreate(H5P_FILE_ACCESS); - H5Pset_mpi(access_plist, MPI_COMM_WORLD, MPI_INFO_NULL); + H5Pset_fapl_mpi(access_plist, MPI_COMM_WORLD, MPI_INFO_NULL); /* H5Fopen must be called collectively */ file_id = H5Fopen("test.h5", H5F_ACC_RDWR, access_plist); @@ -307,25 +305,19 @@ buffered again by the lowest layers of the HDF5 library.
-
H5F_driver_t H5Pget_driver (hid_t - access_properties) -
This function returns the constant H5F_LOW_SEC2 if the +
hid_t H5Pget_driver (hid_t access_properties) +
This function returns the constant H5FD_SEC2 if the sec2 driver is defined as the low-level driver for the specified access property list.

-
herr_t H5Pset_sec2 (hid_t access_properties) +
herr_t H5Pset_fapl_sec2 + (hid_t access_properties)
The file access properties are set to use the sec2 driver. Any previously defined driver properties are erased from the property list. Additional parameters may be added to this function in the future. -

-
herr_t H5Pget_sec2 (hid_t access_properties) -
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().

6.2. Buffered Permanent Files

@@ -339,25 +331,19 @@ introduces an additional layer of buffering beneath the HDF5 library.
-
H5F_driver_t H5Pget_driver(hid_t - access_properties) -
This function returns the constant H5F_LOW_STDIO if the +
hid_t H5Pget_driver(hid_t access_properties) +
This function returns the constant H5FD_STDIO if the stdio driver is defined as the low-level driver for the specified access property list.

-
herr_t H5Pset_stdio (hid_t access_properties) +
herr_t H5Pset_fapl_stdio + (hid_t access_properties)
The file access properties are set to use the stdio driver. Any previously defined driver properties are erased from the property list. Additional parameters may be added to this function in the future. -

-
herr_t H5Pget_stdio (hid_t access_properties) -
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().

6.3. Buffered Temporary Files

@@ -371,15 +357,15 @@ file is insignificant and H5Fopen() always fails).
-
H5F_driver_t H5Pget_driver (hid_t - access_properties) -
This function returns the constant H5F_LOW_CORE if the +
hid_t H5Pget_driver (hid_t access_properties) +
This function returns the constant H5FD_CORE if the core driver is defined as the low-level driver for the specified access property list.

-
herr_t H5Pset_core (hid_t access_properties, size_t - block_size) +
herr_t H5Pset_fapl_core (hid_t access_properties, + size_t block_size, + hbool_t backing_store)
The file access properties are set to use the core driver and any previously defined driver properties are erased from the property list. Memory for the file will always be allocated in @@ -387,13 +373,14 @@ be added to this function in the future.

-
herr_t H5Pget_core (hid_t access_properties, size_t - *block_size) +
herr_t H5Pget_fapl_core (hid_t access_properties, + size_t *block_size), + hbool_t *backing_store)
If the file access property list is set to the core driver then this function returns zero and block_size is set to the block size used for the file; otherwise it returns a negative value. In the future, additional arguments may be added to this - function to match those added to H5Pset_core(). + function to match those added to H5Pset_fapl_core().

6.4. Parallel Files

@@ -401,14 +388,13 @@

This driver uses MPI I/O to provide parallel access to a file.

-
H5F_driver_t H5Pget_driver (hid_t - access_properties) -
This function returns the constant H5F_LOW_MPI if the +
hid_t H5Pget_driver (hid_t access_properties) +
This function returns the constant H5FD_MPI if the mpi driver is defined as the low-level driver for the specified access property list.

-
herr_t H5Pset_mpi (hid_t access_properties, MPI_Comm +
herr_t H5Pset_fapl_mpi (hid_t access_properties, MPI_Comm comm, MPI_info info)
The file access properties are set to use the mpi driver and any previously defined driver properties are erased from @@ -416,14 +402,16 @@ function in the future.

-
herr_t H5Pget_mpi (hid_t access_properties, MPI_Comm - *comm, MPI_info *info) +
herr_t H5Pget_fapl_mpi + (hid_t access_properties, + MPI_Comm *comm, + MPI_info *info)
If the file access property list is set to the mpi driver then this function returns zero and comm, and info are set to the values stored in the property list; otherwise the function returns a negative value. In the future, additional arguments may be added to this function to match those - added to H5Pset_mpi(). + added to H5Pset_fapl_mpi().
@@ -469,14 +457,13 @@ or kB respectively.

-
H5F_driver_t H5Pget_driver (hid_t - access_properties) -
This function returns the constant H5F_LOW_FAMILY if +
hid_t H5Pget_driver (hid_t access_properties) +
This function returns the constant H5FD_FAMILY if the family driver is defined as the low-level driver for the specified access property list.

-
herr_t H5Pset_family (hid_t access_properties, +
herr_t H5Pset_fapl_family (hid_t access_properties, hsize_t memb_size, hid_t member_properties)
The file access properties are set to use the family driver and any previously defined driver properties are erased @@ -495,9 +482,9 @@ function in the future.

-
herr_t H5Pget_family (hid_t access_properties, - hsize_t *memb_size, hid_t - *member_properties) +
herr_t H5Pget_fapl_family (hid_t access_properties, + hsize_t *memb_size, + hid_t *member_properties)
If the file access property list is set to the family driver then this function returns zero; otherwise the function returns a negative value. On successful return, @@ -507,7 +494,7 @@ it. If memb_size is non-null then it will contain the logical size in bytes of each family member. In the future, additional arguments may be added to this function to - match those added to H5Pset_family(). + match those added to H5Pset_fapl_family().

6.6. Split Meta/Raw Files

@@ -524,17 +511,16 @@ the sec2 driver.
-
H5F_driver_t H5Pget_driver (hid_t - access_properties) -
This function returns the constant H5F_LOW_SPLIT if +
hid_t H5Pget_driver (hid_t access_properties) +
This function returns the constant H5FD_SPLIT if the split driver is defined as the low-level driver for the specified access property list.

-
herr_t H5Pset_split (hid_t access_properties, - const char *meta_extension, hid_t - meta_properties, const char *raw_extension, hid_t - raw_properties) +
herr_t H5Pset_fapl_split (hid_t access_properties, + const char *meta_extension, + hid_t meta_properties, const char *raw_extension, + hid_t raw_properties)
The file access properties are set to use the split driver and any previously defined driver properties are erased from the property list. The meta file will have a name which is formed by @@ -545,29 +531,6 @@ name and will be accessed according to the raw_properties. Additional parameters may be added to this function in the future. -

-
herr_t H5Pget_split (hid_t access_properties, - size_t meta_ext_size, const char *meta_extension, - hid_t meta_properties, size_t raw_ext_size, const - char *raw_extension, hid_t *raw_properties) -
If the file access property list is set to the split - driver then this function returns zero; otherwise the function - returns a negative value. On successful return, - meta_properties and raw_properties will - point to copies of the meta and raw access property lists - which should be closed by calling H5Pclose() when - the application is finished with them, but if the meta and/or - raw file has no property list then a negative value is - returned for that property list handle. Also, if - meta_extension and/or raw_extension are - non-null pointers, at most meta_ext_size or - raw_ext_size characters of the meta or raw file name - extension will be copied to the specified buffer. If the - actual name is longer than what was requested then the result - will not be null terminated (similar to - strncpy()). In the future, additional arguments - may be added to this function to match those added to - H5Pset_split().
@@ -619,11 +582,11 @@ -Last modified: 9 December 2000 +Last modified: 16 February 2001
-Describes HDF5 Release 1.4, February 2001 +Describes HDF5 Release 1.4.1, April 2001 -- cgit v0.12