hdf images hdf images

This web site is no longer maintained (but will remain online).
Please see The HDF Group's new Support Portal for the latest information.

Writing to a Dataset by Pattern

This is another example of writing data into disconnected locations in a file. Each process writes data from the contiguous buffer into regularly scattered locations in the file.

Each process defines a hyperslab in the file as described below and writes data to it. The C and Fortran 90 examples below result in the same data layout in the file.

Figure a   C Example Figure b   FORTRAN 90 Example

The C and Fortran 90 examples use four processes to write the pattern shown above. Each process defines a hyperslab by:

For example, the offset, count, and stride parameters for Process 2 would look like:

Figure a   C Example Figure b   FORTRAN 90 Example

Below are example programs for writing hyperslabs by pattern in Parallel HDF5:

The following is the output from h5dump for the HDF5 file created in this example:
HDF5 "SDS_pat.h5" {
GROUP "/" {
   DATASET "IntArray" {
      DATATYPE  H5T_STD_I32BE  
      DATASPACE  SIMPLE { ( 8, 4 ) / ( 8, 4 ) } 
      DATA {
         1, 3, 1, 3,
         2, 4, 2, 4,
         1, 3, 1, 3,
         2, 4, 2, 4,
         1, 3, 1, 3,
         2, 4, 2, 4,
         1, 3, 1, 3,
         2, 4, 2, 4
      } 
   } 
} 
} 
The h5dump utility is written in C so the output is in C order.

- - Last modified: 05 July 2016