HDFql Reference Manual v2.6.0

6.8.9SET ALIGNMENT

Syntax

SET ALIGNMENT {[THRESHOLD {threshold_value | DEFAULT}] [ALIGNMENT {alignment_value | DEFAULT}] | DEFAULT}

Description

Set the alignment48 for accessing HDF5 files so that any object whose size (in bytes) is equal to or greater than threshold_value will be aligned on an address that is a multiple of alignment_value. The address is relative to the end of the user-defined block of data, which is calculated by subtracting the size of this block of data (in bytes) from the absolute file address and then adjusting it to a multiple of alignment_value. In general, in a non-MPI environment, the default values will result in the best performance when accessing the file. In an MPI environment, an alignment that is a multiple of the disk block size should be specified.

Parameter(s)

threshold_value – optional integer that specifies the threshold value for aligning any HDF5 object whose size (in bytes) is equal to or greater than this value. If threshold_value is specified, it must be equal to or greater than zero (otherwise an error is raised). If its value is equal to zero, all objects are aligned independently of their sizes (in bytes). In case the keyword DEFAULT is specified, its value is 1 (i.e. default value defined by the HDF5 library). In case the keyword THRESHOLD is not specified, its current value remains intact.

alignment_value – optional integer that specifies the alignment value for aligning HDF5 objects. If alignment_value is specified, it must be equal to or greater than one (otherwise an error is raised). In case the keyword DEFAULT is specified, its value is 1 (i.e. default value defined by the HDF5 library). In case the keyword ALIGNMENT is not specified, its current value remains intact.

Return

Nothing

Example(s)

# set alignment threshold and alignment values to 1523 and 262144, respectively 
SET ALIGNMENT THRESHOLD 1523 ALIGNMENT 262144 

# use (i.e. open) an HDF5 file named "my_file0.h5" with alignment threshold and alignment values of 1523 and 262144, respectively
USE FILE my_file0.h5

# use (i.e. open) an HDF5 file named "my_file1.h5" with an alignment threshold value of 3046 
USE FILE my_file1.h5 ALIGNMENT THRESHOLD 3046 

# set alignment threshold and alignment values to default values for subsequent usage (i.e. creating or opening HDF5 files)
SET ALIGNMENT DEFAULT 

# use (i.e. open) an HDF5 file named "my_file2.h5" with alignment threshold and alignment values of 1 and 1, respectively
USE FILE my_file2.h5

Notes

  1. By default (i.e. upon initialization of the HDFql library), the alignment parameters threshold and alignment are both set to 1 (i.e. no alignment is performed). ↩