next up previous index
Next: Create a File Family Up: Property Lists Previous: Property Lists

Modifying Property Lists

In this section I'm going to show you how to create desired property lists and how to pass them to functions. The procedure is fairly simple and consists of two steps basically:

1.
Create a default property list for a given operation by calling function  H5Pcreate.
2.
Modify the property list generated above by calling a specific property list modification function.
For example, in order to create a file with 64-bit objects offsets and lengths you would do as follows (this example is taken from the HDF5 Tutorial at NCSA):
   hid_t create_plist;
   hid_t file_id;

   [...]

   create_plist = H5Pcreate(H5P_FILE_CREATE);
   H5Pset_sizes(create_plist, 8, 8);

   file_id = H5Fcreate("test.h5", H5F_ACC_TRUNC,
                        create_plist, H5P_DEFAULT);

   [...]

   H5Fclose(file_id);
Here we create the default property list with H5Pcreate, which is invoked with the H5P_FILE_CREATE specifier, first, and then modify the list by calling function  H5Pset_sizes, which takes the property list identifier as its first argument, byte-size of object offsets as its second argument and byte-size of object lengths as its third argument. Once we have the list to our liking, we can use it in the call to H5Fcreate.

It is OK to call more than one list modification function, if you need more features, of course.

In the next couple of sub-sections, I am going to discuss various examples of using property lists, as applied to accessing files, creating datasets and then writing and reading them. MPI-IO/HDF5 examples will be shown here too.


next up previous index
Next: Create a File Family Up: Property Lists Previous: Property Lists
Zdzislaw Meglicki
2004-04-29