Name: H5Pset_fapl_multi
Signature:
herr_t H5Pset_fapl_multi( hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_fapl, const char * const *memb_name, const haddr_t *memb_addr, hbool_t relax )
Purpose:
Sets up use of the multi-file driver.
Description:
H5Pset_fapl_multi sets the file access property list fapl_id to use the multi-file driver.

The multi-file driver enables different types of HDF5 data and metadata to be written to separate files. These files are viewed by the HDF5 library and the application as a single virtual HDF5 file with a single HDF5 file address space. The types of data that can be broken out into separate files include raw data, the superblock, B-tree data, global heap data, local heap data, and object headers. At the programmer's discretion, two or more types of data can be written to the same file while other types of data are written to separate files.

The array memb_map maps memory usage types to other memory usage types and is the mechanism that allows the caller to specify how many files are created. The array contains H5FD_MEM_NTYPES entries, which are either the value H5FD_MEM_DEFAULT or a memory usage type. The number of unique values determines the number of files that are opened.

The array memb_fapl contains a property list for each memory usage type that will be associated with a file.

The array memb_name should be a name generator (a printf-style format with a %s which will be replaced with the name passed to H5FDopen, usually from H5Fcreate or H5Fopen).

The array memb_addr specifies the offsets within the virtual address space, from 0 (zero) to HADDR_MAX, at which each type of data storage begins.

If relax is set to TRUE (or 1), then opening an existing file for read-only access will not fail if some file members are missing. This allows a file to be accessed in a limited sense if just the meta data is available.

Default values for each of the optional arguments are as follows:

memb_map
The default member map contains the value H5FD_MEM_DEFAULT for each element.
memb_fapl
The default value is H5P_DEFAULT for each element.
memb_name
The default string is   %s-X.h5   where   X   is one of the following letters: s    for H5FD_MEM_SUPER
b    for H5FD_MEM_BTREE
r    for H5FD_MEM_DRAW
g    for H5FD_MEM_GHEAP
l    for H5FD_MEM_LHEAP
o    for H5FD_MEM_OHDR
memb_addr
The default value is HADDR_UNDEF for each element.
Parameters:
Returns:
Returns a non-negative value if successful. Otherwise returns a negative value.
Example:
The following code sample sets up a multi-file access property list that partitions data into meta and raw files, each being one-half of the address:
                  H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
                  hid_t memb_fapl[H5FD_MEM_NTYPES];
                  const char *memb[H5FD_MEM_NTYPES];
                  haddr_t memb_addr[H5FD_MEM_NTYPES];
 
                  // The mapping...
                  for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
                     memb_map[mt] = H5FD_MEM_SUPER;
                  }
                  memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
 
                  // Member information
                  memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
                  memb_name[H5FD_MEM_SUPER] = "%s.meta";
                  memb_addr[H5FD_MEM_SUPER] = 0;
 
                  memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
                  memb_name[H5FD_MEM_DRAW] = "%s.raw";
                  memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2;
 
                  hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
                  H5Pset_fapl_multi(fapl, memb_map, memb_fapl,
                                  memb_name, memb_addr, TRUE);
        
Fortran90 Interface: h5pset_fapl_multi_f
SUBROUTINE h5pset_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name,
                               memb_addr, relax, hdferr) 
  IMPLICIT NONE
  INTEGER(HID_T),INTENT(IN)  :: prp_id     ! Property list identifier

  INTEGER,DIMENSION(0:H5FD_MEM_NTYPES_F-1),INTENT(IN)          :: memb_map
  INTEGER(HID_T),DIMENSION(0:H5FD_MEM_NTYPES_F-1),INTENT(IN)   :: memb_fapl
  CHARACTER(LEN=*),DIMENSION(0:H5FD_MEM_NTYPES_F-1),INTENT(IN) :: memb_name
  REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN)           :: memb_addr
              ! Numbers in the interval [0,1) (e.g. 0.0 0.1 0.5 0.2 0.3 0.4)
              ! real address in the file will be calculated as X*HADDR_MAX
  LOGICAL, INTENT(IN)  :: relax
  INTEGER, INTENT(OUT) :: hdferr           ! Error code
                                           ! 0 on success and -1 on failure
END SUBROUTINE h5pset_fapl_multi_f
	
History: