Name: H5Pset_fapl_direct
Signature:
herr_t H5Pset_fapl_direct( hid_t fapl_id, size_t alignment, size_t block_size, size_t cbuf_size )

Purpose:
Sets up use of the direct I/O driver.

Description:
H5Pset_fapl_direct sets the file access property list, fapl_id, to use the direct I/O driver, H5FD_DIRECT. With this driver, data is written to or read from the file synchronously without being cached by the system.

File systems usually require the data address in memory, the file address, and the size of the data to be aligned. The HDF5 Library’s direct I/O driver is able to handle unaligned data, though that will consume some additional memory resources and may slow performance. To get better performance, use the system function posix_memalign to align the data buffer in memory and the HDF5 function H5Pset_alignment to align the data in the file. Be aware, however, that aligned data I/O may cause the HDF5 file to be bigger than the actual data size would otherwise require because the alignment may leave some holes in the file.

alignment specifies the required alignment boundary in memory.

block_size specifies the file system block size. A value of 0 (zero) means to use HDF5 Library’s default value of 4KB.

cbuf_size specifies the copy buffer size.

Note:
On an SGI Altix Linux 2.6 system, the memory alignment must be a multiple of 512 bytes, and the file system block size is 4KB. The maximum size for the copy buffer has to be a multiple of the file system block size. The HDF5 Library’s default maximum copy buffer size is 16MB. This copy buffer is used by the library’s internal algorithm to copy data in fragments between an application’s unaligned buffer and the file. The buffer’s size may affect I/O performance.

Parameters:
hid_t fapl_id IN: File access property list identifier
size_t alignment IN: Required memory alignment boundary
size_t block_size     IN: File system block size
size_t cbuf_size IN: Copy buffer size

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Fortran90 Interface: h5pset_fapl_direct_f
SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, &
                                hdferr)
  IMPLICIT NONE  
  INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier
  INTEGER(SIZE_T), INTENT(IN) :: alignment 	  
                                        ! Required memory alignment boundary
  INTEGER(SIZE_T), INTENT(IN) :: block_size     
                                        ! File system block size
  INTEGER(SIZE_T), INTENT(IN) :: cbuf_size 	  
                                        ! Copy buffer size
  INTEGER, INTENT(OUT) :: hdferr        ! Error code
                                        ! 0 on success and -1 on failure
END SUBROUTINE H5Pset_fapl_direct_f 
    

History:
Release     C
1.8.0 Function introduced in this release.