diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-06-10 14:43:15 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-06-10 14:43:15 (GMT) |
commit | ac4c35cca592fc598c5a064fd8f769bbef69bd75 (patch) | |
tree | 6b23aa1ea8834532ca1de25b3fa469bc3d2a8158 /src/H5P.c | |
parent | 27edf86f6ab408352b4b975669d0759aa47bff78 (diff) | |
download | hdf5-ac4c35cca592fc598c5a064fd8f769bbef69bd75.zip hdf5-ac4c35cca592fc598c5a064fd8f769bbef69bd75.tar.gz hdf5-ac4c35cca592fc598c5a064fd8f769bbef69bd75.tar.bz2 |
[svn-r418] ./html/Files.html
./src/H5F.c
./src/HFcore.c
./src/H5Ffamily.c
./src/H5Flow.c
./src/H5Fmpio.c
./src/H5Fprivate.h
./src/H5Fsec2.c
./src/H5Fsplit.c
./src/H5Fstdio.c
./src/H5MF.c
./src/H5P.c
./src/H5Ppublic.h
Added H5Pset_alignment() so that it is now possible to align
file allocation requests on application-specified
boundaries. Any request >= the specified threshold will begin
on an address which is a multiple of the specified
alignment. Defaults are one for threshold and alignment. The
alignment is done on relative addresses, so the size of the
user block can affect the location of the data in the file.
./src/H5D.c
./src/dsets.c
Added a test for, and fixed the data space caching bug in
datasets. Extending a dataset through one handle will cause
all other handles to the same dataset to get the new dataset
size.
./src/H5S.c
./src/H5Sprivate.h
Removed an unused argument from H5S_read() which duplicated
information from the other argument.
./config/linux
Made `--enable-parallel' the default on my system. It used to
be that way before but then I accidently turned it off and
forgot about it.
./src/H5Fmpio.c
Qualified some function arguments with __unused__. Changed a
couple places where NULL was returned on error for herr_t
functions.
./src/H5P.c
Removed unused autos from H5Pset_mpi().
Diffstat (limited to 'src/H5P.c')
-rw-r--r-- | src/H5P.c | 98 |
1 files changed, 96 insertions, 2 deletions
@@ -515,6 +515,102 @@ H5Pget_userblock(hid_t tid, hsize_t *size) FUNC_LEAVE(SUCCEED); } + + +/*------------------------------------------------------------------------- + * Function: H5Pset_alignment + * + * Purpose: Sets the alignment properties of a file access property list + * so that any file object >= THRESHOLD bytes will be aligned on + * an address which is a multiple of ALIGNMENT. The addresses + * are relative to the end of the user block; the alignment is + * calculated by subtracting the user block size from the + * absolute file address and then adjusting the address to be a + * multiple of ALIGNMENT. + * + * Default values for THRESHOLD and ALIGNMENT are one, implying + * no alignment. Generally the default values will result in + * the best performance for single-process access to the file. + * For MPI-IO and other parallel systems, choose an alignment + * which is a multiple of the disk block size. + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Robb Matzke + * Tuesday, June 9, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_alignment (hid_t fapl_id, hsize_t threshold, hsize_t alignment) +{ + H5F_access_t *fapl = NULL; + + FUNC_ENTER (H5Pset_alignment, FAIL); + + /* Check args */ + if (H5P_FILE_ACCESS != H5Pget_class (fapl_id) || + NULL == (fapl = H5I_object (fapl_id))) { + HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + if (alignment<1) { + HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, + "alignment must be positive"); + } + + /* Set values */ + fapl->threshold = threshold; + fapl->alignment = alignment; + + FUNC_LEAVE (SUCCEED); +} + + +/*------------------------------------------------------------------------- + * Function: H5Pget_alignment + * + * Purpose: Returns the current settings for alignment properties from a + * file access property list. The THRESHOLD and/or ALIGNMENT + * pointers may be null pointers. + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Robb Matzke + * Tuesday, June 9, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_alignment (hid_t fapl_id, hsize_t *threshold/*out*/, + hsize_t *alignment/*out*/) +{ + H5F_access_t *fapl = NULL; + + FUNC_ENTER (H5Pget_alignment, FAIL); + + /* Check args */ + if (H5P_FILE_ACCESS != H5Pget_class (fapl_id) || + NULL == (fapl = H5I_object (fapl_id))) { + HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, + "not a file access property list"); + } + + /* Get values */ + if (threshold) *threshold = fapl->threshold; + if (alignment) *alignment = fapl->alignment; + + FUNC_LEAVE (SUCCEED); +} + /*------------------------------------------------------------------------- * Function: H5Pset_sizes @@ -2211,8 +2307,6 @@ herr_t H5Pset_mpi (hid_t tid, MPI_Comm comm, MPI_Info info) { H5F_access_t *tmpl = NULL; - MPI_Comm lcomm; - int mrc; /* MPI return code */ FUNC_ENTER(H5Pset_mpi, FAIL); |