hdf5/test/tfile.c

1903 lines
60 KiB
C
Raw Normal View History

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1997-07-31 05:17:56 +08:00
/***********************************************************
*
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
* Test program: tfile
1997-07-31 05:17:56 +08:00
*
* Test the low-level file I/O features.
*
*************************************************************/
#include "hdf5.h"
#include "testhdf5.h"
1997-07-31 05:17:56 +08:00
#include "H5Bprivate.h"
#include "H5Pprivate.h"
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
#define F1_USERBLOCK_SIZE (hsize_t)0
[svn-r1572] Changes since 19990810 ---------------------- ./MANIFEST ./src/H5FDmulti.c [NEW] ./src/H5FDmulti.h [NEW] ./src/Makefile.in ./src/hdf5.h The split driver was reimplemented as a more general "multi" driver which is capable of splitting data into multiple files like the family driver except the partioning is done by memory usage type instead of address. The H5Pset_fapl_split() function just calls H5Pset_fapl_multi() with arguments which prepare to split the address space into two files: meta and raw data. This is the first version. I plan to allow the open() call to relax a bit which would allow one to open an hdf5 file when only the meta-data file is present. This would allow a very large file to be split and stored on tape and the relatively small meta file to be mirrored on disk to allow limited browsing of the file (any request for raw data would fail). ./src/H5private.h ./src/H5F.c ./src/H5FD.c ./src/H5FDprivate.h ./src/H5FDpublic.h ./src/H5FDcore.c ./src/H5FDfamily.c ./src/H5FDmpio.c ./src/H5FDsec2.c Added the ability for a file driver to store information in the superblock which would be needed if the file were opened again later for reading. The format is driver-defined which allows users to extend it however they like. ./doc/html/H5.format.html Added information about the new driver information block of the superblock. This is where file drivers store information they need in order to reopen the file later. ./src/H5F.c ./src/H5Fprivate.h ./src/H5FD.c ./src/H5FDprivate.h ./src/H5FDpublic.h ./src/H5FDcore.c ./src/H5FDfamily.c ./src/H5FDmpio.c ./src/H5FDsec2.c ./src/H5Fistore.c ./src/H5R.c The file access properties and the file access property list were decoupled, which allows the property list to more cleanly contain properties for various levels of the file and which allows the property list to be modified more cleanly when opening files. ./src/H5.c ./src/H5FDpublic.h Removed H5FD_MEM_META and H5FD_MEM_GROUP since they're never used. ./src/H5D.c Changed the way we detect the MPIO driver in all these special cases. ./src/H5F.c ./src/H5Rpublic.h ./test/tfile.c The default file sizeof(offset) was changed to be a function of haddr_t instead of hsize_t. THE H5RPUBLIC.H DEFINITIONS WILL HAVE PROBLEMS IF THE USER CREATES A FILE WITH NON-DEFAULT OFFSET AND SIZE SIZES! ./src/H5F.c Fixed an uninitialized memory access bug in file closing related to the VFL. ./src/H5T.c ./src/H5Tpublic.h Added an H5T_NATIVE_HADDR predefined datatype which corresponds to the `haddr_t' type. ./test/Makefile.in Reformatted long lines. ./test/big.c ./test/cmpd_dset.c ./test/dsets.c ./test/dtypes.c ./test/extend.c ./test/external.c Removed the H5F_ACC_DEBUG flag from file creation/open calls. ./test/big.c Plugged a memory leak. ./test/h5test.c Added support for the `multi' driver. Removed #warning about not having the stdio driver. Plans are to not implement it since the sec2 driver serves the same purpose and testing didn't show any difference in execution times between the two.
1999-08-18 03:12:59 +08:00
#define F1_OFFSET_SIZE sizeof(haddr_t)
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
#define F1_LENGTH_SIZE sizeof(hsize_t)
#define F1_SYM_LEAF_K 4
#define F1_SYM_INTERN_K 16
#define FILE1 "tfile1.h5"
#define F2_USERBLOCK_SIZE (hsize_t)512
#define F2_OFFSET_SIZE 8
#define F2_LENGTH_SIZE 8
#define F2_SYM_LEAF_K 8
#define F2_SYM_INTERN_K 32
#define F2_RANK 2
#define F2_DIM0 4
#define F2_DIM1 6
#define F2_DSET "dset"
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
#define FILE2 "tfile2.h5"
#define F3_USERBLOCK_SIZE (hsize_t)0
#define F3_OFFSET_SIZE F2_OFFSET_SIZE
#define F3_LENGTH_SIZE F2_LENGTH_SIZE
#define F3_SYM_LEAF_K F2_SYM_LEAF_K
#define F3_SYM_INTERN_K F2_SYM_INTERN_K
#define FILE3 "tfile3.h5"
1997-07-31 05:17:56 +08:00
#define GRP_NAME "/group"
2003-11-01 02:48:42 +08:00
#define DSET_NAME "dataset"
2003-10-30 01:04:58 +08:00
#define ATTR_NAME "attr"
#define TYPE_NAME "type"
2003-10-30 01:04:58 +08:00
#define FILE4 "tfile4.h5"
#define OBJ_ID_COUNT_0 0
#define OBJ_ID_COUNT_1 1
#define OBJ_ID_COUNT_2 2
#define OBJ_ID_COUNT_3 3
#define OBJ_ID_COUNT_4 4
#define OBJ_ID_COUNT_6 6
#define OBJ_ID_COUNT_8 8
#define GROUP1 "Group1"
#define DSET1 "Dataset1"
#define DSET2 "/Group1/Dataset2"
#define TESTA_GROUPNAME "group"
#define TESTA_DSETNAME "dataset"
#define TESTA_ATTRNAME "attribute"
#define TESTA_DTYPENAME "compound"
#define TESTA_NAME_BUF_SIZE 64
#define TESTA_RANK 2
#define TESTA_NX 4
#define TESTA_NY 5
static void
create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *);
static void
test_obj_count_and_id(hid_t, hid_t, hid_t, hid_t, hid_t, hid_t);
static void
2003-11-01 02:48:42 +08:00
check_file_id(hid_t, hid_t);
1997-07-31 05:17:56 +08:00
/****************************************************************
**
** test_file_create(): Low-level file creation I/O test routine.
**
1997-07-31 05:17:56 +08:00
****************************************************************/
static void
test_file_create(void)
1997-07-31 05:17:56 +08:00
{
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
hid_t fid1, fid2, fid3; /* HDF5 File IDs */
hid_t tmpl1, tmpl2; /*file creation templates */
hsize_t ublock; /*sizeof userblock */
size_t parm; /*file-creation parameters */
size_t parm2; /*file-creation parameters */
unsigned iparm;
unsigned iparm2;
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
herr_t ret; /*generic return value */
1997-07-31 05:17:56 +08:00
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Creation I/O\n"));
1997-07-31 05:17:56 +08:00
/* First ensure the file does not exist */
HDremove(FILE1);
/* Try opening a non-existant file */
fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
VERIFY(fid1, FAIL, "H5Fopen");
/* Test create with various sequences of H5F_ACC_EXCL and */
/* H5F_ACC_TRUNC flags */
/* Create with H5F_ACC_EXCL */
fid1 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fcreate");
[svn-r1568] Changes since 19990730 ---------------------- This extensive change is the virtual file layer implementation. I've ported and tested the sec2, family, and core drivers and only ported the mpio driver (Albert will test it). So if you need MPIO I would recommend sticking with the previous version for a while. You will get a few compile warnings about split and stdio drivers not being implemented and possibly tracing information not inserted in some of the drivers. You can safely ignore them but I plan to fix them. I'm still working on the split driver because I just realized that it needs a part of the VFL that isn't written yet. Documentation is being updated also because there were some minor changes (mostly just name changes). It should be available on my web site later this week. ./MANIFEST ./src/Makefile.in ./src/hdf5.h ./src/H5Flow.c [REMOVED] ./src/H5Fstdio.c [REMOVED] ./src/H5Fsec2.c [REMOVED] ./src/H5Fsplit.c [REMOVED] ./src/H5Fmpio.c [REMOVED] ./src/H5Ffamily.c [REMOVED] ./src/H5Fcore.c [REMOVED] ./src/H5MFpublic.h [REMOVED] ./src/H5FD.c [NEW] ./src/H5FDcore.c [NEW] ./src/H5FDcore.h [NEW] ./src/H5FDfamily.c [NEW] ./src/H5FDfamily.h [NEW] ./src/H5FDmpio.c [NEW] ./src/H5FDmpio.h [NEW] ./src/H5FDprivate.h [NEW] ./src/H5FDpublic.h [NEW] ./src/H5FDsec2.c [NEW] ./src/H5FDsec2.h [NEW] Removed/added files for virtual file layer. ./bin/trace ./src/H5.c Removed unused public datatypes and added new VFL public datatypes. Changed an error message. ./config/BlankForm ./config/dec-flags ./config/gnu-flags ./config/hpux10.20 ./config/hpux9.03 ./config/irix5.x ./config/irix6.x ./config/solaris2.x ./config/unicosmk Removed the H5F_OPT_SEEK and H5F_LOW_DFLT constants from the configuration since they're no longer applicable. The default file driver is always the sec2 driver and it always optimizes calls to lseek() or lseek64(). ./config/depend.in C preprocessor errors generated during automatic dependency building are sent to /dev/null to prevent them from appearing twice in the make output. ./src/H5AC.c ./src/H5B.c ./src/H5D.c ./src/H5F.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Oshared.c ./src/H5T.c ./src/H5detect.c ./test/ohdr.c Changed H5F_ADDR_UNDEF to HADDR_UNDEF to be more consistent with the `haddr_t' datatype which is now a public type. ./src/H5D.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5Tconv.c ./test/cmpd_dset.c ./test/dsets.c ./test/overhead.c ./test/tselect.c ./test/tvltypes.c The H5P_DATASET_XFER constant was changed to H5P_DATA_XFER because the properties apply to all types of I/O operations, not just datasets. ./src/H5B.c ./src/H5Bprivate.h ./src/H5D.c ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5R.c ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Smpio.c ./src/H5Spoint.c ./src/H5Sprivate.h ./test/big.c ./test/h5test.c ./test/istore.c ./testpar/t_dset.c ./testpar/t_file.c ./tools/h5debug.c ./tools/h5ls.c Modified to work with the virtual file layer by calling H5FD_* functions instead of H5F_low_* functions and by passing file access and data transfer properties by object ID instead of pointer. Changed H5D_transfer_t to H5FD_mpio_xfer_t since the COLLECTIVE vs. INDEPENDENT transfer mode is specific to the MPIO file driver. Moved MPIO-specific stuff into the MPIO driver. ./src/H5B.c ./src/H5D.c ./src/H5Fprivate.h The H5F_mpio_* private functions were renamed and placed in the H5FDmpio driver except those which appeared in H5Smpio.c. ./src/H5E.c ./src/H5Epublic.h Added major error number H5E_VFL for virtual file layer related errors. ./src/H5F.c ./src/H5Fprivate.h Changed the logic that controls whether the boot block is written. Instead of assuming that the first call to write the boot block is only to allocate space, I've added a function argument which makes this explicit. Changed the way files are compared so that a driver-defined comparison function can be called. Files which belong to different drivers are always considered different. Removed H5F_driver_t since file drivers are now identified by object ID instead of a special non-user-extendible datatype. Removed all the hard-coded low-level file properties which have been replaced by the various file drivers. ./src/H5I.c ./src/H5Iprivate.h Added the H5I_inc_ref() which was removed a few months ago since we finally have a use for it. ./src/H5Ipublic.h Added the H5I_VFL object ID type to identify file drivers in the virtual file layer. ./src/H5MF.c ./src/H5MFprivate.h Moved all the allocation/deallocation code into the virtual file layer which allows file drivers to override much of it. ./src/H5P.c ./src/H5Ppublic.h Moved file driver-specific code into the various file driver files. The H5Pcopy() and H5Pclose() functions make calls into the virtual file driver to manage the memory for driver-specific file access and data transfer properties. ./src/H5private.h ./src/H5public.h The `haddr_t' type is now public. ./test/tfile.c Added a few more comments.
1999-08-11 04:21:32 +08:00
/*
* try to create the same file with H5F_ACC_TRUNC. This should fail
* because fid1 is the same file and is currently open.
*/
#ifndef H5_HAVE_FILE_VERSIONS
fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(fid2, FAIL, "H5Fcreate");
#endif /*H5_DONT_HAVE_FILE_VERSIONS*/
[svn-r1568] Changes since 19990730 ---------------------- This extensive change is the virtual file layer implementation. I've ported and tested the sec2, family, and core drivers and only ported the mpio driver (Albert will test it). So if you need MPIO I would recommend sticking with the previous version for a while. You will get a few compile warnings about split and stdio drivers not being implemented and possibly tracing information not inserted in some of the drivers. You can safely ignore them but I plan to fix them. I'm still working on the split driver because I just realized that it needs a part of the VFL that isn't written yet. Documentation is being updated also because there were some minor changes (mostly just name changes). It should be available on my web site later this week. ./MANIFEST ./src/Makefile.in ./src/hdf5.h ./src/H5Flow.c [REMOVED] ./src/H5Fstdio.c [REMOVED] ./src/H5Fsec2.c [REMOVED] ./src/H5Fsplit.c [REMOVED] ./src/H5Fmpio.c [REMOVED] ./src/H5Ffamily.c [REMOVED] ./src/H5Fcore.c [REMOVED] ./src/H5MFpublic.h [REMOVED] ./src/H5FD.c [NEW] ./src/H5FDcore.c [NEW] ./src/H5FDcore.h [NEW] ./src/H5FDfamily.c [NEW] ./src/H5FDfamily.h [NEW] ./src/H5FDmpio.c [NEW] ./src/H5FDmpio.h [NEW] ./src/H5FDprivate.h [NEW] ./src/H5FDpublic.h [NEW] ./src/H5FDsec2.c [NEW] ./src/H5FDsec2.h [NEW] Removed/added files for virtual file layer. ./bin/trace ./src/H5.c Removed unused public datatypes and added new VFL public datatypes. Changed an error message. ./config/BlankForm ./config/dec-flags ./config/gnu-flags ./config/hpux10.20 ./config/hpux9.03 ./config/irix5.x ./config/irix6.x ./config/solaris2.x ./config/unicosmk Removed the H5F_OPT_SEEK and H5F_LOW_DFLT constants from the configuration since they're no longer applicable. The default file driver is always the sec2 driver and it always optimizes calls to lseek() or lseek64(). ./config/depend.in C preprocessor errors generated during automatic dependency building are sent to /dev/null to prevent them from appearing twice in the make output. ./src/H5AC.c ./src/H5B.c ./src/H5D.c ./src/H5F.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Oshared.c ./src/H5T.c ./src/H5detect.c ./test/ohdr.c Changed H5F_ADDR_UNDEF to HADDR_UNDEF to be more consistent with the `haddr_t' datatype which is now a public type. ./src/H5D.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5Tconv.c ./test/cmpd_dset.c ./test/dsets.c ./test/overhead.c ./test/tselect.c ./test/tvltypes.c The H5P_DATASET_XFER constant was changed to H5P_DATA_XFER because the properties apply to all types of I/O operations, not just datasets. ./src/H5B.c ./src/H5Bprivate.h ./src/H5D.c ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5R.c ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Smpio.c ./src/H5Spoint.c ./src/H5Sprivate.h ./test/big.c ./test/h5test.c ./test/istore.c ./testpar/t_dset.c ./testpar/t_file.c ./tools/h5debug.c ./tools/h5ls.c Modified to work with the virtual file layer by calling H5FD_* functions instead of H5F_low_* functions and by passing file access and data transfer properties by object ID instead of pointer. Changed H5D_transfer_t to H5FD_mpio_xfer_t since the COLLECTIVE vs. INDEPENDENT transfer mode is specific to the MPIO file driver. Moved MPIO-specific stuff into the MPIO driver. ./src/H5B.c ./src/H5D.c ./src/H5Fprivate.h The H5F_mpio_* private functions were renamed and placed in the H5FDmpio driver except those which appeared in H5Smpio.c. ./src/H5E.c ./src/H5Epublic.h Added major error number H5E_VFL for virtual file layer related errors. ./src/H5F.c ./src/H5Fprivate.h Changed the logic that controls whether the boot block is written. Instead of assuming that the first call to write the boot block is only to allocate space, I've added a function argument which makes this explicit. Changed the way files are compared so that a driver-defined comparison function can be called. Files which belong to different drivers are always considered different. Removed H5F_driver_t since file drivers are now identified by object ID instead of a special non-user-extendible datatype. Removed all the hard-coded low-level file properties which have been replaced by the various file drivers. ./src/H5I.c ./src/H5Iprivate.h Added the H5I_inc_ref() which was removed a few months ago since we finally have a use for it. ./src/H5Ipublic.h Added the H5I_VFL object ID type to identify file drivers in the virtual file layer. ./src/H5MF.c ./src/H5MFprivate.h Moved all the allocation/deallocation code into the virtual file layer which allows file drivers to override much of it. ./src/H5P.c ./src/H5Ppublic.h Moved file driver-specific code into the various file driver files. The H5Pcopy() and H5Pclose() functions make calls into the virtual file driver to manage the memory for driver-specific file access and data transfer properties. ./src/H5private.h ./src/H5public.h The `haddr_t' type is now public. ./test/tfile.c Added a few more comments.
1999-08-11 04:21:32 +08:00
/* Close all files */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
#ifndef H5_HAVE_FILE_VERSIONS
[svn-r1568] Changes since 19990730 ---------------------- This extensive change is the virtual file layer implementation. I've ported and tested the sec2, family, and core drivers and only ported the mpio driver (Albert will test it). So if you need MPIO I would recommend sticking with the previous version for a while. You will get a few compile warnings about split and stdio drivers not being implemented and possibly tracing information not inserted in some of the drivers. You can safely ignore them but I plan to fix them. I'm still working on the split driver because I just realized that it needs a part of the VFL that isn't written yet. Documentation is being updated also because there were some minor changes (mostly just name changes). It should be available on my web site later this week. ./MANIFEST ./src/Makefile.in ./src/hdf5.h ./src/H5Flow.c [REMOVED] ./src/H5Fstdio.c [REMOVED] ./src/H5Fsec2.c [REMOVED] ./src/H5Fsplit.c [REMOVED] ./src/H5Fmpio.c [REMOVED] ./src/H5Ffamily.c [REMOVED] ./src/H5Fcore.c [REMOVED] ./src/H5MFpublic.h [REMOVED] ./src/H5FD.c [NEW] ./src/H5FDcore.c [NEW] ./src/H5FDcore.h [NEW] ./src/H5FDfamily.c [NEW] ./src/H5FDfamily.h [NEW] ./src/H5FDmpio.c [NEW] ./src/H5FDmpio.h [NEW] ./src/H5FDprivate.h [NEW] ./src/H5FDpublic.h [NEW] ./src/H5FDsec2.c [NEW] ./src/H5FDsec2.h [NEW] Removed/added files for virtual file layer. ./bin/trace ./src/H5.c Removed unused public datatypes and added new VFL public datatypes. Changed an error message. ./config/BlankForm ./config/dec-flags ./config/gnu-flags ./config/hpux10.20 ./config/hpux9.03 ./config/irix5.x ./config/irix6.x ./config/solaris2.x ./config/unicosmk Removed the H5F_OPT_SEEK and H5F_LOW_DFLT constants from the configuration since they're no longer applicable. The default file driver is always the sec2 driver and it always optimizes calls to lseek() or lseek64(). ./config/depend.in C preprocessor errors generated during automatic dependency building are sent to /dev/null to prevent them from appearing twice in the make output. ./src/H5AC.c ./src/H5B.c ./src/H5D.c ./src/H5F.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Oshared.c ./src/H5T.c ./src/H5detect.c ./test/ohdr.c Changed H5F_ADDR_UNDEF to HADDR_UNDEF to be more consistent with the `haddr_t' datatype which is now a public type. ./src/H5D.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5Tconv.c ./test/cmpd_dset.c ./test/dsets.c ./test/overhead.c ./test/tselect.c ./test/tvltypes.c The H5P_DATASET_XFER constant was changed to H5P_DATA_XFER because the properties apply to all types of I/O operations, not just datasets. ./src/H5B.c ./src/H5Bprivate.h ./src/H5D.c ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5R.c ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Smpio.c ./src/H5Spoint.c ./src/H5Sprivate.h ./test/big.c ./test/h5test.c ./test/istore.c ./testpar/t_dset.c ./testpar/t_file.c ./tools/h5debug.c ./tools/h5ls.c Modified to work with the virtual file layer by calling H5FD_* functions instead of H5F_low_* functions and by passing file access and data transfer properties by object ID instead of pointer. Changed H5D_transfer_t to H5FD_mpio_xfer_t since the COLLECTIVE vs. INDEPENDENT transfer mode is specific to the MPIO file driver. Moved MPIO-specific stuff into the MPIO driver. ./src/H5B.c ./src/H5D.c ./src/H5Fprivate.h The H5F_mpio_* private functions were renamed and placed in the H5FDmpio driver except those which appeared in H5Smpio.c. ./src/H5E.c ./src/H5Epublic.h Added major error number H5E_VFL for virtual file layer related errors. ./src/H5F.c ./src/H5Fprivate.h Changed the logic that controls whether the boot block is written. Instead of assuming that the first call to write the boot block is only to allocate space, I've added a function argument which makes this explicit. Changed the way files are compared so that a driver-defined comparison function can be called. Files which belong to different drivers are always considered different. Removed H5F_driver_t since file drivers are now identified by object ID instead of a special non-user-extendible datatype. Removed all the hard-coded low-level file properties which have been replaced by the various file drivers. ./src/H5I.c ./src/H5Iprivate.h Added the H5I_inc_ref() which was removed a few months ago since we finally have a use for it. ./src/H5Ipublic.h Added the H5I_VFL object ID type to identify file drivers in the virtual file layer. ./src/H5MF.c ./src/H5MFprivate.h Moved all the allocation/deallocation code into the virtual file layer which allows file drivers to override much of it. ./src/H5P.c ./src/H5Ppublic.h Moved file driver-specific code into the various file driver files. The H5Pcopy() and H5Pclose() functions make calls into the virtual file driver to manage the memory for driver-specific file access and data transfer properties. ./src/H5private.h ./src/H5public.h The `haddr_t' type is now public. ./test/tfile.c Added a few more comments.
1999-08-11 04:21:32 +08:00
ret = H5Fclose(fid2);
VERIFY(ret, FAIL, "H5Fclose"); /*file should not have been open */
#endif /*H5_HAVE_FILE_VERSIONS*/
[svn-r1568] Changes since 19990730 ---------------------- This extensive change is the virtual file layer implementation. I've ported and tested the sec2, family, and core drivers and only ported the mpio driver (Albert will test it). So if you need MPIO I would recommend sticking with the previous version for a while. You will get a few compile warnings about split and stdio drivers not being implemented and possibly tracing information not inserted in some of the drivers. You can safely ignore them but I plan to fix them. I'm still working on the split driver because I just realized that it needs a part of the VFL that isn't written yet. Documentation is being updated also because there were some minor changes (mostly just name changes). It should be available on my web site later this week. ./MANIFEST ./src/Makefile.in ./src/hdf5.h ./src/H5Flow.c [REMOVED] ./src/H5Fstdio.c [REMOVED] ./src/H5Fsec2.c [REMOVED] ./src/H5Fsplit.c [REMOVED] ./src/H5Fmpio.c [REMOVED] ./src/H5Ffamily.c [REMOVED] ./src/H5Fcore.c [REMOVED] ./src/H5MFpublic.h [REMOVED] ./src/H5FD.c [NEW] ./src/H5FDcore.c [NEW] ./src/H5FDcore.h [NEW] ./src/H5FDfamily.c [NEW] ./src/H5FDfamily.h [NEW] ./src/H5FDmpio.c [NEW] ./src/H5FDmpio.h [NEW] ./src/H5FDprivate.h [NEW] ./src/H5FDpublic.h [NEW] ./src/H5FDsec2.c [NEW] ./src/H5FDsec2.h [NEW] Removed/added files for virtual file layer. ./bin/trace ./src/H5.c Removed unused public datatypes and added new VFL public datatypes. Changed an error message. ./config/BlankForm ./config/dec-flags ./config/gnu-flags ./config/hpux10.20 ./config/hpux9.03 ./config/irix5.x ./config/irix6.x ./config/solaris2.x ./config/unicosmk Removed the H5F_OPT_SEEK and H5F_LOW_DFLT constants from the configuration since they're no longer applicable. The default file driver is always the sec2 driver and it always optimizes calls to lseek() or lseek64(). ./config/depend.in C preprocessor errors generated during automatic dependency building are sent to /dev/null to prevent them from appearing twice in the make output. ./src/H5AC.c ./src/H5B.c ./src/H5D.c ./src/H5F.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Oshared.c ./src/H5T.c ./src/H5detect.c ./test/ohdr.c Changed H5F_ADDR_UNDEF to HADDR_UNDEF to be more consistent with the `haddr_t' datatype which is now a public type. ./src/H5D.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5Tconv.c ./test/cmpd_dset.c ./test/dsets.c ./test/overhead.c ./test/tselect.c ./test/tvltypes.c The H5P_DATASET_XFER constant was changed to H5P_DATA_XFER because the properties apply to all types of I/O operations, not just datasets. ./src/H5B.c ./src/H5Bprivate.h ./src/H5D.c ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5R.c ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Smpio.c ./src/H5Spoint.c ./src/H5Sprivate.h ./test/big.c ./test/h5test.c ./test/istore.c ./testpar/t_dset.c ./testpar/t_file.c ./tools/h5debug.c ./tools/h5ls.c Modified to work with the virtual file layer by calling H5FD_* functions instead of H5F_low_* functions and by passing file access and data transfer properties by object ID instead of pointer. Changed H5D_transfer_t to H5FD_mpio_xfer_t since the COLLECTIVE vs. INDEPENDENT transfer mode is specific to the MPIO file driver. Moved MPIO-specific stuff into the MPIO driver. ./src/H5B.c ./src/H5D.c ./src/H5Fprivate.h The H5F_mpio_* private functions were renamed and placed in the H5FDmpio driver except those which appeared in H5Smpio.c. ./src/H5E.c ./src/H5Epublic.h Added major error number H5E_VFL for virtual file layer related errors. ./src/H5F.c ./src/H5Fprivate.h Changed the logic that controls whether the boot block is written. Instead of assuming that the first call to write the boot block is only to allocate space, I've added a function argument which makes this explicit. Changed the way files are compared so that a driver-defined comparison function can be called. Files which belong to different drivers are always considered different. Removed H5F_driver_t since file drivers are now identified by object ID instead of a special non-user-extendible datatype. Removed all the hard-coded low-level file properties which have been replaced by the various file drivers. ./src/H5I.c ./src/H5Iprivate.h Added the H5I_inc_ref() which was removed a few months ago since we finally have a use for it. ./src/H5Ipublic.h Added the H5I_VFL object ID type to identify file drivers in the virtual file layer. ./src/H5MF.c ./src/H5MFprivate.h Moved all the allocation/deallocation code into the virtual file layer which allows file drivers to override much of it. ./src/H5P.c ./src/H5Ppublic.h Moved file driver-specific code into the various file driver files. The H5Pcopy() and H5Pclose() functions make calls into the virtual file driver to manage the memory for driver-specific file access and data transfer properties. ./src/H5private.h ./src/H5public.h The `haddr_t' type is now public. ./test/tfile.c Added a few more comments.
1999-08-11 04:21:32 +08:00
/*
* Try again with H5F_ACC_EXCL. This should fail because the file already
* exists from the previous steps.
*/
fid1 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(fid1, FAIL, "H5Fcreate");
[svn-r1568] Changes since 19990730 ---------------------- This extensive change is the virtual file layer implementation. I've ported and tested the sec2, family, and core drivers and only ported the mpio driver (Albert will test it). So if you need MPIO I would recommend sticking with the previous version for a while. You will get a few compile warnings about split and stdio drivers not being implemented and possibly tracing information not inserted in some of the drivers. You can safely ignore them but I plan to fix them. I'm still working on the split driver because I just realized that it needs a part of the VFL that isn't written yet. Documentation is being updated also because there were some minor changes (mostly just name changes). It should be available on my web site later this week. ./MANIFEST ./src/Makefile.in ./src/hdf5.h ./src/H5Flow.c [REMOVED] ./src/H5Fstdio.c [REMOVED] ./src/H5Fsec2.c [REMOVED] ./src/H5Fsplit.c [REMOVED] ./src/H5Fmpio.c [REMOVED] ./src/H5Ffamily.c [REMOVED] ./src/H5Fcore.c [REMOVED] ./src/H5MFpublic.h [REMOVED] ./src/H5FD.c [NEW] ./src/H5FDcore.c [NEW] ./src/H5FDcore.h [NEW] ./src/H5FDfamily.c [NEW] ./src/H5FDfamily.h [NEW] ./src/H5FDmpio.c [NEW] ./src/H5FDmpio.h [NEW] ./src/H5FDprivate.h [NEW] ./src/H5FDpublic.h [NEW] ./src/H5FDsec2.c [NEW] ./src/H5FDsec2.h [NEW] Removed/added files for virtual file layer. ./bin/trace ./src/H5.c Removed unused public datatypes and added new VFL public datatypes. Changed an error message. ./config/BlankForm ./config/dec-flags ./config/gnu-flags ./config/hpux10.20 ./config/hpux9.03 ./config/irix5.x ./config/irix6.x ./config/solaris2.x ./config/unicosmk Removed the H5F_OPT_SEEK and H5F_LOW_DFLT constants from the configuration since they're no longer applicable. The default file driver is always the sec2 driver and it always optimizes calls to lseek() or lseek64(). ./config/depend.in C preprocessor errors generated during automatic dependency building are sent to /dev/null to prevent them from appearing twice in the make output. ./src/H5AC.c ./src/H5B.c ./src/H5D.c ./src/H5F.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Oshared.c ./src/H5T.c ./src/H5detect.c ./test/ohdr.c Changed H5F_ADDR_UNDEF to HADDR_UNDEF to be more consistent with the `haddr_t' datatype which is now a public type. ./src/H5D.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5Tconv.c ./test/cmpd_dset.c ./test/dsets.c ./test/overhead.c ./test/tselect.c ./test/tvltypes.c The H5P_DATASET_XFER constant was changed to H5P_DATA_XFER because the properties apply to all types of I/O operations, not just datasets. ./src/H5B.c ./src/H5Bprivate.h ./src/H5D.c ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5R.c ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Smpio.c ./src/H5Spoint.c ./src/H5Sprivate.h ./test/big.c ./test/h5test.c ./test/istore.c ./testpar/t_dset.c ./testpar/t_file.c ./tools/h5debug.c ./tools/h5ls.c Modified to work with the virtual file layer by calling H5FD_* functions instead of H5F_low_* functions and by passing file access and data transfer properties by object ID instead of pointer. Changed H5D_transfer_t to H5FD_mpio_xfer_t since the COLLECTIVE vs. INDEPENDENT transfer mode is specific to the MPIO file driver. Moved MPIO-specific stuff into the MPIO driver. ./src/H5B.c ./src/H5D.c ./src/H5Fprivate.h The H5F_mpio_* private functions were renamed and placed in the H5FDmpio driver except those which appeared in H5Smpio.c. ./src/H5E.c ./src/H5Epublic.h Added major error number H5E_VFL for virtual file layer related errors. ./src/H5F.c ./src/H5Fprivate.h Changed the logic that controls whether the boot block is written. Instead of assuming that the first call to write the boot block is only to allocate space, I've added a function argument which makes this explicit. Changed the way files are compared so that a driver-defined comparison function can be called. Files which belong to different drivers are always considered different. Removed H5F_driver_t since file drivers are now identified by object ID instead of a special non-user-extendible datatype. Removed all the hard-coded low-level file properties which have been replaced by the various file drivers. ./src/H5I.c ./src/H5Iprivate.h Added the H5I_inc_ref() which was removed a few months ago since we finally have a use for it. ./src/H5Ipublic.h Added the H5I_VFL object ID type to identify file drivers in the virtual file layer. ./src/H5MF.c ./src/H5MFprivate.h Moved all the allocation/deallocation code into the virtual file layer which allows file drivers to override much of it. ./src/H5P.c ./src/H5Ppublic.h Moved file driver-specific code into the various file driver files. The H5Pcopy() and H5Pclose() functions make calls into the virtual file driver to manage the memory for driver-specific file access and data transfer properties. ./src/H5private.h ./src/H5public.h The `haddr_t' type is now public. ./test/tfile.c Added a few more comments.
1999-08-11 04:21:32 +08:00
/* Test create with H5F_ACC_TRUNC. This will truncate the existing file. */
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fcreate");
1997-07-31 05:17:56 +08:00
#ifndef H5_HAVE_FILE_VERSIONS
[svn-r1568] Changes since 19990730 ---------------------- This extensive change is the virtual file layer implementation. I've ported and tested the sec2, family, and core drivers and only ported the mpio driver (Albert will test it). So if you need MPIO I would recommend sticking with the previous version for a while. You will get a few compile warnings about split and stdio drivers not being implemented and possibly tracing information not inserted in some of the drivers. You can safely ignore them but I plan to fix them. I'm still working on the split driver because I just realized that it needs a part of the VFL that isn't written yet. Documentation is being updated also because there were some minor changes (mostly just name changes). It should be available on my web site later this week. ./MANIFEST ./src/Makefile.in ./src/hdf5.h ./src/H5Flow.c [REMOVED] ./src/H5Fstdio.c [REMOVED] ./src/H5Fsec2.c [REMOVED] ./src/H5Fsplit.c [REMOVED] ./src/H5Fmpio.c [REMOVED] ./src/H5Ffamily.c [REMOVED] ./src/H5Fcore.c [REMOVED] ./src/H5MFpublic.h [REMOVED] ./src/H5FD.c [NEW] ./src/H5FDcore.c [NEW] ./src/H5FDcore.h [NEW] ./src/H5FDfamily.c [NEW] ./src/H5FDfamily.h [NEW] ./src/H5FDmpio.c [NEW] ./src/H5FDmpio.h [NEW] ./src/H5FDprivate.h [NEW] ./src/H5FDpublic.h [NEW] ./src/H5FDsec2.c [NEW] ./src/H5FDsec2.h [NEW] Removed/added files for virtual file layer. ./bin/trace ./src/H5.c Removed unused public datatypes and added new VFL public datatypes. Changed an error message. ./config/BlankForm ./config/dec-flags ./config/gnu-flags ./config/hpux10.20 ./config/hpux9.03 ./config/irix5.x ./config/irix6.x ./config/solaris2.x ./config/unicosmk Removed the H5F_OPT_SEEK and H5F_LOW_DFLT constants from the configuration since they're no longer applicable. The default file driver is always the sec2 driver and it always optimizes calls to lseek() or lseek64(). ./config/depend.in C preprocessor errors generated during automatic dependency building are sent to /dev/null to prevent them from appearing twice in the make output. ./src/H5AC.c ./src/H5B.c ./src/H5D.c ./src/H5F.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Oshared.c ./src/H5T.c ./src/H5detect.c ./test/ohdr.c Changed H5F_ADDR_UNDEF to HADDR_UNDEF to be more consistent with the `haddr_t' datatype which is now a public type. ./src/H5D.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5Tconv.c ./test/cmpd_dset.c ./test/dsets.c ./test/overhead.c ./test/tselect.c ./test/tvltypes.c The H5P_DATASET_XFER constant was changed to H5P_DATA_XFER because the properties apply to all types of I/O operations, not just datasets. ./src/H5B.c ./src/H5Bprivate.h ./src/H5D.c ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5R.c ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Smpio.c ./src/H5Spoint.c ./src/H5Sprivate.h ./test/big.c ./test/h5test.c ./test/istore.c ./testpar/t_dset.c ./testpar/t_file.c ./tools/h5debug.c ./tools/h5ls.c Modified to work with the virtual file layer by calling H5FD_* functions instead of H5F_low_* functions and by passing file access and data transfer properties by object ID instead of pointer. Changed H5D_transfer_t to H5FD_mpio_xfer_t since the COLLECTIVE vs. INDEPENDENT transfer mode is specific to the MPIO file driver. Moved MPIO-specific stuff into the MPIO driver. ./src/H5B.c ./src/H5D.c ./src/H5Fprivate.h The H5F_mpio_* private functions were renamed and placed in the H5FDmpio driver except those which appeared in H5Smpio.c. ./src/H5E.c ./src/H5Epublic.h Added major error number H5E_VFL for virtual file layer related errors. ./src/H5F.c ./src/H5Fprivate.h Changed the logic that controls whether the boot block is written. Instead of assuming that the first call to write the boot block is only to allocate space, I've added a function argument which makes this explicit. Changed the way files are compared so that a driver-defined comparison function can be called. Files which belong to different drivers are always considered different. Removed H5F_driver_t since file drivers are now identified by object ID instead of a special non-user-extendible datatype. Removed all the hard-coded low-level file properties which have been replaced by the various file drivers. ./src/H5I.c ./src/H5Iprivate.h Added the H5I_inc_ref() which was removed a few months ago since we finally have a use for it. ./src/H5Ipublic.h Added the H5I_VFL object ID type to identify file drivers in the virtual file layer. ./src/H5MF.c ./src/H5MFprivate.h Moved all the allocation/deallocation code into the virtual file layer which allows file drivers to override much of it. ./src/H5P.c ./src/H5Ppublic.h Moved file driver-specific code into the various file driver files. The H5Pcopy() and H5Pclose() functions make calls into the virtual file driver to manage the memory for driver-specific file access and data transfer properties. ./src/H5private.h ./src/H5public.h The `haddr_t' type is now public. ./test/tfile.c Added a few more comments.
1999-08-11 04:21:32 +08:00
/*
* Try to truncate first file again. This should fail because fid1 is the
* same file and is currently open.
*/
fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(fid2, FAIL, "H5Fcreate");
1997-07-31 05:17:56 +08:00
[svn-r1568] Changes since 19990730 ---------------------- This extensive change is the virtual file layer implementation. I've ported and tested the sec2, family, and core drivers and only ported the mpio driver (Albert will test it). So if you need MPIO I would recommend sticking with the previous version for a while. You will get a few compile warnings about split and stdio drivers not being implemented and possibly tracing information not inserted in some of the drivers. You can safely ignore them but I plan to fix them. I'm still working on the split driver because I just realized that it needs a part of the VFL that isn't written yet. Documentation is being updated also because there were some minor changes (mostly just name changes). It should be available on my web site later this week. ./MANIFEST ./src/Makefile.in ./src/hdf5.h ./src/H5Flow.c [REMOVED] ./src/H5Fstdio.c [REMOVED] ./src/H5Fsec2.c [REMOVED] ./src/H5Fsplit.c [REMOVED] ./src/H5Fmpio.c [REMOVED] ./src/H5Ffamily.c [REMOVED] ./src/H5Fcore.c [REMOVED] ./src/H5MFpublic.h [REMOVED] ./src/H5FD.c [NEW] ./src/H5FDcore.c [NEW] ./src/H5FDcore.h [NEW] ./src/H5FDfamily.c [NEW] ./src/H5FDfamily.h [NEW] ./src/H5FDmpio.c [NEW] ./src/H5FDmpio.h [NEW] ./src/H5FDprivate.h [NEW] ./src/H5FDpublic.h [NEW] ./src/H5FDsec2.c [NEW] ./src/H5FDsec2.h [NEW] Removed/added files for virtual file layer. ./bin/trace ./src/H5.c Removed unused public datatypes and added new VFL public datatypes. Changed an error message. ./config/BlankForm ./config/dec-flags ./config/gnu-flags ./config/hpux10.20 ./config/hpux9.03 ./config/irix5.x ./config/irix6.x ./config/solaris2.x ./config/unicosmk Removed the H5F_OPT_SEEK and H5F_LOW_DFLT constants from the configuration since they're no longer applicable. The default file driver is always the sec2 driver and it always optimizes calls to lseek() or lseek64(). ./config/depend.in C preprocessor errors generated during automatic dependency building are sent to /dev/null to prevent them from appearing twice in the make output. ./src/H5AC.c ./src/H5B.c ./src/H5D.c ./src/H5F.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Oshared.c ./src/H5T.c ./src/H5detect.c ./test/ohdr.c Changed H5F_ADDR_UNDEF to HADDR_UNDEF to be more consistent with the `haddr_t' datatype which is now a public type. ./src/H5D.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5Tconv.c ./test/cmpd_dset.c ./test/dsets.c ./test/overhead.c ./test/tselect.c ./test/tvltypes.c The H5P_DATASET_XFER constant was changed to H5P_DATA_XFER because the properties apply to all types of I/O operations, not just datasets. ./src/H5B.c ./src/H5Bprivate.h ./src/H5D.c ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fistore.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Gnode.c ./src/H5Gpkg.h ./src/H5HG.c ./src/H5HL.c ./src/H5O.c ./src/H5R.c ./src/H5Sall.c ./src/H5Shyper.c ./src/H5Smpio.c ./src/H5Spoint.c ./src/H5Sprivate.h ./test/big.c ./test/h5test.c ./test/istore.c ./testpar/t_dset.c ./testpar/t_file.c ./tools/h5debug.c ./tools/h5ls.c Modified to work with the virtual file layer by calling H5FD_* functions instead of H5F_low_* functions and by passing file access and data transfer properties by object ID instead of pointer. Changed H5D_transfer_t to H5FD_mpio_xfer_t since the COLLECTIVE vs. INDEPENDENT transfer mode is specific to the MPIO file driver. Moved MPIO-specific stuff into the MPIO driver. ./src/H5B.c ./src/H5D.c ./src/H5Fprivate.h The H5F_mpio_* private functions were renamed and placed in the H5FDmpio driver except those which appeared in H5Smpio.c. ./src/H5E.c ./src/H5Epublic.h Added major error number H5E_VFL for virtual file layer related errors. ./src/H5F.c ./src/H5Fprivate.h Changed the logic that controls whether the boot block is written. Instead of assuming that the first call to write the boot block is only to allocate space, I've added a function argument which makes this explicit. Changed the way files are compared so that a driver-defined comparison function can be called. Files which belong to different drivers are always considered different. Removed H5F_driver_t since file drivers are now identified by object ID instead of a special non-user-extendible datatype. Removed all the hard-coded low-level file properties which have been replaced by the various file drivers. ./src/H5I.c ./src/H5Iprivate.h Added the H5I_inc_ref() which was removed a few months ago since we finally have a use for it. ./src/H5Ipublic.h Added the H5I_VFL object ID type to identify file drivers in the virtual file layer. ./src/H5MF.c ./src/H5MFprivate.h Moved all the allocation/deallocation code into the virtual file layer which allows file drivers to override much of it. ./src/H5P.c ./src/H5Ppublic.h Moved file driver-specific code into the various file driver files. The H5Pcopy() and H5Pclose() functions make calls into the virtual file driver to manage the memory for driver-specific file access and data transfer properties. ./src/H5private.h ./src/H5public.h The `haddr_t' type is now public. ./test/tfile.c Added a few more comments.
1999-08-11 04:21:32 +08:00
/*
* Try with H5F_ACC_EXCL. This should fail too because the file already
* exists.
*/
fid2 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(fid2, FAIL, "H5Fcreate");
#endif /*H5_HAVE_FILE_VERSIONS*/
1997-07-31 05:17:56 +08:00
/* Get the file-creation template */
[svn-r673] Changes since 19980908 ---------------------- ./COPYING Reformatted as text instead of C. Removed zlib crew from the list of contributors since no zlib code is actually in the hdf5 library. ./INSTALL ./INSTALL.ascired ./MANIFEST Minor updates for Beta release including version number change. ./INSTALL_MAINT Added information about making a release. ./RELEASE Updated function list based on public header files. ./bin/checkposix Got rid of complaints about some obvious things. ./doc/html/H5.api.html ./doc/html/RM_H5F.html ./src/H5F.c ./src/H5Fpublic.h ./test/tfile.c Changed H5Fget_create_template() and H5Fget_access_template() to H5Fget_create_plist() and H5Fget_access_plist() since that conforms better to lots of other names. ./doc/html/Datatypes.html ./doc/html/ExternalFiles.html ./doc/html/Files.html ./doc/html/H5.api.html ./doc/html/H5.sample_code.html ./doc/html/RM_H5F.html ./doc/html/RM_H5Front.html Changed `template' to `property list', etc. ./doc/html/Ragged.html [NEW] Documentation for ragged arrays. ./src/H5Iprivate.h ./src/H5Ipublic.h ./src/H5I.c Changed the scope of some symbols to be more local. ./src/H5.c ./src/H5AC.c ./src/H5D.c ./src/H5E.c ./src/H5F.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5I.c ./src/H5O.c ./src/H5Ocomp.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Omtime.c ./src/H5Oname.c ./src/H5P.c ./src/H5S.c ./src/H5Shyper.c ./src/H5Tbit.c ./src/H5Tconv.c ./src/H5V.c ./src/H5Z.c ./src/H5private.h Fixed some violations of our naming scheme by adding HD to the beginning of all Posix functions.
1998-09-09 03:15:44 +08:00
tmpl1 = H5Fget_create_plist(fid1);
CHECK(tmpl1, FAIL, "H5Fget_create_plist");
1997-07-31 05:17:56 +08:00
/* Get the file-creation parameters */
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
ret = H5Pget_userblock(tmpl1, &ublock);
CHECK(ret, FAIL, "H5Pget_userblock");
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
VERIFY(ublock, F1_USERBLOCK_SIZE, "H5Pget_userblock");
1997-07-31 05:17:56 +08:00
ret = H5Pget_sizes(tmpl1, &parm, &parm2);
CHECK(ret, FAIL, "H5Pget_sizes");
VERIFY(parm, F1_OFFSET_SIZE, "H5Pget_sizes");
VERIFY(parm2, F1_LENGTH_SIZE, "H5Pget_sizes");
1997-07-31 05:17:56 +08:00
ret = H5Pget_sym_k(tmpl1, &iparm, &iparm2);
CHECK(ret, FAIL, "H5Pget_sym_k");
VERIFY(iparm, F1_SYM_INTERN_K, "H5Pget_sym_k");
VERIFY(iparm2, F1_SYM_LEAF_K, "H5Pget_sym_k");
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
[svn-r291] Changes since 19980206 ---------------------- ./configure.in ./src/H5Fprivate.h ./src/H5Fsec2.c We now detect and use lseek64() on systems that have it (e.g., Irix64) and are able to generate >2GB files on Irix XFS file systems (and anything else that supports large files). This change also removed some warning messages from the Irix `-64' compiler. > $ ls -l istore.h5 > -rw-r--r-- 1 matzke meshtv 8605436856 Feb 17 14:03 istore.h5 ./configure.in ./src/H5Fprivate.h ./src/H5Fstdio.h We now detect and use fseek64() on systems that have it (e.g., Irix64) and are able to generate >2GB files on Irix XFS file systems (and anything else that supports large files). This change also removed some warning messages from the Iris `-64' compiler. ./src/H5E.c ./src/H5Epublic.h Added the H5E_OVERFLOW error to signal file address overflow. ./src/H5Fpublic.h ./examples/h5_chunk_read.c ./examples/h5_compound.c ./examples/h5_extend_write.c ./examples/h5_group.c ./examples/h5_read.c ./examples/h5_write.c ./html/Datasets.html ./html/Files.html ./html/H5.api.html ./html/H5.intro.html ./html/H5.sample_code.html ./html/ph5example.c ./html/review1.html ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/tfile.c ./test/th5p.c ./test/theap.c ./test/tohdr.c ./test/tstab.c ./testpar/phdf5.c Renamed file access constants to follow the naming scheme. Also changed the base names a little to be more accurate as to what they do. The old names H5ACC_WRITE and H5ACC_OVERWRITE will temporarily work. H5ACC_DEFAULT --> H5F_ACC_RDONLY for H5Fopen() H5ACC_DEFAULT --> H5F_ACC_EXCL for H5Fcreate() H5ACC_WRITE --> H5F_ACC_RDWR H5ACC_OVERWRITE --> H5F_ACC_TRUNC Albert or Kim: The H5ACC_INDEPENDENT and H5ACC_COLLECTIVE macros in H5Fpublic.h should be an enum typedef and have names more like H5F_MPIO_INDEPENDENT and H5F_MPIO_COLLECTIVE. Also change the access_mode argument of H5Cset_mpio(). H5Fcreate() and H5Fopen() are more strict now about which flags are acceptable for the operation. ./src/H5Fprivate.h ./src/H5F.c ./src/H5C.c Changed the file access template to make it more general. A union contains a struct for each type of low-level driver and the default template is initialized at run-time. ./src/H5Fpublic.h ./src/H5F.c Added H5Fget_access_template() and cleaned up H5Fget_create_template(). ./src/H5C.c The H5Cset_mpi() no longer trashes the file access template when an error is detected. We check for errors and *then* update the file access template. Added H5C_close() so Albert and Kim have a place to release the MPI communicator and info from the file access property list. Kim or Albert: I notice in H5Cset_mpi() you copy the MPI communicator. Do you need to do something similar in H5C_copy()? ./src/H5F.c Added more error checking for the file creation and access property lists because it used to be possible to make the library dump core by swapping the creation and access property list ID numbers of H5Fcreate(). ./test/istore.c ./test/tfile.c ./test/th5p.c ./test/theap.c ./test/tohdr.c ./test/tstab.c ./testpar/testphdf5.c One must pass H5C_DEFAULT as the file creation or access property list in order to get the default property list. It is no longer possible to pass zero or any other arbitrary bad object ID. ./src/H5Fcore.c ./src/H5Ffamly.c ./src/H5Flow.c ./src/H5Fmpio.c ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5MF.c The file access property list is passed to all H5F_low_...() functions and to the drivers. ./src/H5Fcore.c The block size can be set at run time on a per-file basis instead of at compile time across all files. The "5000 items in a group test" now takes 1.6 seconds. ./src/H5private.h Removed inclusion of mpi.h and mpio.h since they're included from H5public.h. ./src/H5Cpublic.h ./src/H5C.c Added H5Cset_stdio(), H5Cset_sec2(), H5Cset_core(), H5Cset_split(), and H5Cset_family() in addition to the H5Cset_mpio() that Kim and Albert already wrote. We still need the H5Cget_driver() and an H5Cget...() counterpart for each of those functions. The split and family drivers still need a little work but I'm checking this in anyway.
1998-02-20 02:26:49 +08:00
#ifdef LATER
1997-07-31 05:17:56 +08:00
/* Double-check that the atom has been vaporized */
1998-03-13 05:04:53 +08:00
ret = H5Pclose(tmpl1);
VERIFY(ret, FAIL, "H5Pclose");
[svn-r291] Changes since 19980206 ---------------------- ./configure.in ./src/H5Fprivate.h ./src/H5Fsec2.c We now detect and use lseek64() on systems that have it (e.g., Irix64) and are able to generate >2GB files on Irix XFS file systems (and anything else that supports large files). This change also removed some warning messages from the Irix `-64' compiler. > $ ls -l istore.h5 > -rw-r--r-- 1 matzke meshtv 8605436856 Feb 17 14:03 istore.h5 ./configure.in ./src/H5Fprivate.h ./src/H5Fstdio.h We now detect and use fseek64() on systems that have it (e.g., Irix64) and are able to generate >2GB files on Irix XFS file systems (and anything else that supports large files). This change also removed some warning messages from the Iris `-64' compiler. ./src/H5E.c ./src/H5Epublic.h Added the H5E_OVERFLOW error to signal file address overflow. ./src/H5Fpublic.h ./examples/h5_chunk_read.c ./examples/h5_compound.c ./examples/h5_extend_write.c ./examples/h5_group.c ./examples/h5_read.c ./examples/h5_write.c ./html/Datasets.html ./html/Files.html ./html/H5.api.html ./html/H5.intro.html ./html/H5.sample_code.html ./html/ph5example.c ./html/review1.html ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/tfile.c ./test/th5p.c ./test/theap.c ./test/tohdr.c ./test/tstab.c ./testpar/phdf5.c Renamed file access constants to follow the naming scheme. Also changed the base names a little to be more accurate as to what they do. The old names H5ACC_WRITE and H5ACC_OVERWRITE will temporarily work. H5ACC_DEFAULT --> H5F_ACC_RDONLY for H5Fopen() H5ACC_DEFAULT --> H5F_ACC_EXCL for H5Fcreate() H5ACC_WRITE --> H5F_ACC_RDWR H5ACC_OVERWRITE --> H5F_ACC_TRUNC Albert or Kim: The H5ACC_INDEPENDENT and H5ACC_COLLECTIVE macros in H5Fpublic.h should be an enum typedef and have names more like H5F_MPIO_INDEPENDENT and H5F_MPIO_COLLECTIVE. Also change the access_mode argument of H5Cset_mpio(). H5Fcreate() and H5Fopen() are more strict now about which flags are acceptable for the operation. ./src/H5Fprivate.h ./src/H5F.c ./src/H5C.c Changed the file access template to make it more general. A union contains a struct for each type of low-level driver and the default template is initialized at run-time. ./src/H5Fpublic.h ./src/H5F.c Added H5Fget_access_template() and cleaned up H5Fget_create_template(). ./src/H5C.c The H5Cset_mpi() no longer trashes the file access template when an error is detected. We check for errors and *then* update the file access template. Added H5C_close() so Albert and Kim have a place to release the MPI communicator and info from the file access property list. Kim or Albert: I notice in H5Cset_mpi() you copy the MPI communicator. Do you need to do something similar in H5C_copy()? ./src/H5F.c Added more error checking for the file creation and access property lists because it used to be possible to make the library dump core by swapping the creation and access property list ID numbers of H5Fcreate(). ./test/istore.c ./test/tfile.c ./test/th5p.c ./test/theap.c ./test/tohdr.c ./test/tstab.c ./testpar/testphdf5.c One must pass H5C_DEFAULT as the file creation or access property list in order to get the default property list. It is no longer possible to pass zero or any other arbitrary bad object ID. ./src/H5Fcore.c ./src/H5Ffamly.c ./src/H5Flow.c ./src/H5Fmpio.c ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5MF.c The file access property list is passed to all H5F_low_...() functions and to the drivers. ./src/H5Fcore.c The block size can be set at run time on a per-file basis instead of at compile time across all files. The "5000 items in a group test" now takes 1.6 seconds. ./src/H5private.h Removed inclusion of mpi.h and mpio.h since they're included from H5public.h. ./src/H5Cpublic.h ./src/H5C.c Added H5Cset_stdio(), H5Cset_sec2(), H5Cset_core(), H5Cset_split(), and H5Cset_family() in addition to the H5Cset_mpio() that Kim and Albert already wrote. We still need the H5Cget_driver() and an H5Cget...() counterpart for each of those functions. The split and family drivers still need a little work but I'm checking this in anyway.
1998-02-20 02:26:49 +08:00
#endif
1997-07-31 05:17:56 +08:00
/* Create a new file with a non-standard file-creation template */
tmpl1 = H5Pcreate(H5P_FILE_CREATE);
CHECK(tmpl1, FAIL, "H5Pcreate");
1997-07-31 05:17:56 +08:00
/* Set the new file-creation parameters */
ret = H5Pset_userblock(tmpl1, F2_USERBLOCK_SIZE);
CHECK(ret, FAIL, "H5Pset_userblock");
1997-07-31 05:17:56 +08:00
ret = H5Pset_sizes(tmpl1, (size_t)F2_OFFSET_SIZE, (size_t)F2_LENGTH_SIZE);
CHECK(ret, FAIL, "H5Pset_sizes");
1997-07-31 05:17:56 +08:00
ret = H5Pset_sym_k(tmpl1, F2_SYM_INTERN_K, F2_SYM_LEAF_K);
CHECK(ret, FAIL, "H5Pset_sym_k");
/*
* Try to create second file, with non-standard file-creation template
* params.
*/
fid2 = H5Fcreate(FILE2, H5F_ACC_TRUNC, tmpl1, H5P_DEFAULT);
CHECK(fid2, FAIL, "H5Fcreate");
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
/* Make certain we can create a dataset properly in the file with the userblock */
{
hid_t dataset_id, dataspace_id; /* identifiers */
hsize_t dims[F2_RANK];
int data[F2_DIM0][F2_DIM1];
unsigned i,j;
/* Create the data space for the dataset. */
dims[0] = F2_DIM0;
dims[1] = F2_DIM1;
dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
CHECK(dataspace_id, FAIL, "H5Screate_simple");
/* Create the dataset. */
dataset_id = H5Dcreate(fid2, F2_DSET, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT);
CHECK(dataset_id, FAIL, "H5Dcreate");
for(i=0; i<F2_DIM0; i++)
for(j=0; j<F2_DIM1; j++)
data[i][j]=i*10+j;
/* Write data to the new dataset */
ret = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
CHECK(ret, FAIL, "H5Dwrite");
/* End access to the dataset and release resources used by it. */
ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
/* Terminate access to the data space. */
ret = H5Sclose(dataspace_id);
CHECK(ret, FAIL, "H5Sclose");
}
1997-07-31 05:17:56 +08:00
/* Get the file-creation template */
[svn-r673] Changes since 19980908 ---------------------- ./COPYING Reformatted as text instead of C. Removed zlib crew from the list of contributors since no zlib code is actually in the hdf5 library. ./INSTALL ./INSTALL.ascired ./MANIFEST Minor updates for Beta release including version number change. ./INSTALL_MAINT Added information about making a release. ./RELEASE Updated function list based on public header files. ./bin/checkposix Got rid of complaints about some obvious things. ./doc/html/H5.api.html ./doc/html/RM_H5F.html ./src/H5F.c ./src/H5Fpublic.h ./test/tfile.c Changed H5Fget_create_template() and H5Fget_access_template() to H5Fget_create_plist() and H5Fget_access_plist() since that conforms better to lots of other names. ./doc/html/Datatypes.html ./doc/html/ExternalFiles.html ./doc/html/Files.html ./doc/html/H5.api.html ./doc/html/H5.sample_code.html ./doc/html/RM_H5F.html ./doc/html/RM_H5Front.html Changed `template' to `property list', etc. ./doc/html/Ragged.html [NEW] Documentation for ragged arrays. ./src/H5Iprivate.h ./src/H5Ipublic.h ./src/H5I.c Changed the scope of some symbols to be more local. ./src/H5.c ./src/H5AC.c ./src/H5D.c ./src/H5E.c ./src/H5F.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5I.c ./src/H5O.c ./src/H5Ocomp.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Omtime.c ./src/H5Oname.c ./src/H5P.c ./src/H5S.c ./src/H5Shyper.c ./src/H5Tbit.c ./src/H5Tconv.c ./src/H5V.c ./src/H5Z.c ./src/H5private.h Fixed some violations of our naming scheme by adding HD to the beginning of all Posix functions.
1998-09-09 03:15:44 +08:00
tmpl1 = H5Fget_create_plist(fid2);
CHECK(tmpl1, FAIL, "H5Fget_create_plist");
1997-07-31 05:17:56 +08:00
/* Get the file-creation parameters */
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
ret = H5Pget_userblock(tmpl1, &ublock);
CHECK(ret, FAIL, "H5Pget_userblock");
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
VERIFY(ublock, F2_USERBLOCK_SIZE, "H5Pget_userblock");
1997-07-31 05:17:56 +08:00
ret = H5Pget_sizes(tmpl1, &parm, &parm2);
CHECK(ret, FAIL, "H5Pget_sizes");
VERIFY(parm, F2_OFFSET_SIZE, "H5Pget_sizes");
VERIFY(parm2, F2_LENGTH_SIZE, "H5Pget_sizes");
ret = H5Pget_sym_k(tmpl1, &iparm, &iparm2);
CHECK(ret, FAIL, "H5Pget_sym_k");
VERIFY(iparm, F2_SYM_INTERN_K, "H5Pget_sym_k");
VERIFY(iparm2, F2_SYM_LEAF_K, "H5Pget_sym_k");
1997-07-31 05:17:56 +08:00
/* Clone the file-creation template */
1998-03-13 05:04:53 +08:00
tmpl2 = H5Pcopy(tmpl1);
CHECK(tmpl2, FAIL, "H5Pcopy");
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
1997-07-31 05:17:56 +08:00
/* Set the new file-creation parameter */
ret = H5Pset_userblock(tmpl2, F3_USERBLOCK_SIZE);
CHECK(ret, FAIL, "H5Pset_userblock");
1997-07-31 05:17:56 +08:00
/*
* Try to create second file, with non-standard file-creation template
* params
*/
fid3 = H5Fcreate(FILE3, H5F_ACC_TRUNC, tmpl2, H5P_DEFAULT);
CHECK(fid3, FAIL, "H5Fcreate");
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose(tmpl2);
CHECK(ret, FAIL, "H5Pclose");
1997-07-31 05:17:56 +08:00
/* Get the file-creation template */
[svn-r673] Changes since 19980908 ---------------------- ./COPYING Reformatted as text instead of C. Removed zlib crew from the list of contributors since no zlib code is actually in the hdf5 library. ./INSTALL ./INSTALL.ascired ./MANIFEST Minor updates for Beta release including version number change. ./INSTALL_MAINT Added information about making a release. ./RELEASE Updated function list based on public header files. ./bin/checkposix Got rid of complaints about some obvious things. ./doc/html/H5.api.html ./doc/html/RM_H5F.html ./src/H5F.c ./src/H5Fpublic.h ./test/tfile.c Changed H5Fget_create_template() and H5Fget_access_template() to H5Fget_create_plist() and H5Fget_access_plist() since that conforms better to lots of other names. ./doc/html/Datatypes.html ./doc/html/ExternalFiles.html ./doc/html/Files.html ./doc/html/H5.api.html ./doc/html/H5.sample_code.html ./doc/html/RM_H5F.html ./doc/html/RM_H5Front.html Changed `template' to `property list', etc. ./doc/html/Ragged.html [NEW] Documentation for ragged arrays. ./src/H5Iprivate.h ./src/H5Ipublic.h ./src/H5I.c Changed the scope of some symbols to be more local. ./src/H5.c ./src/H5AC.c ./src/H5D.c ./src/H5E.c ./src/H5F.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5I.c ./src/H5O.c ./src/H5Ocomp.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Omtime.c ./src/H5Oname.c ./src/H5P.c ./src/H5S.c ./src/H5Shyper.c ./src/H5Tbit.c ./src/H5Tconv.c ./src/H5V.c ./src/H5Z.c ./src/H5private.h Fixed some violations of our naming scheme by adding HD to the beginning of all Posix functions.
1998-09-09 03:15:44 +08:00
tmpl1 = H5Fget_create_plist(fid3);
CHECK(tmpl1, FAIL, "H5Fget_create_plist");
1997-07-31 05:17:56 +08:00
/* Get the file-creation parameters */
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
ret = H5Pget_userblock(tmpl1, &ublock);
CHECK(ret, FAIL, "H5Pget_userblock");
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
VERIFY(ublock, F3_USERBLOCK_SIZE, "H5Pget_userblock");
1997-07-31 05:17:56 +08:00
ret = H5Pget_sizes(tmpl1, &parm, &parm2);
CHECK(ret, FAIL, "H5Pget_sizes");
VERIFY(parm, F3_OFFSET_SIZE, "H5Pget_sizes");
VERIFY(parm2, F3_LENGTH_SIZE, "H5Pget_sizes");
1997-07-31 05:17:56 +08:00
ret = H5Pget_sym_k(tmpl1, &iparm, &iparm2);
CHECK(ret, FAIL, "H5Pget_sym_k");
VERIFY(iparm, F3_SYM_INTERN_K, "H5Pget_sym_k");
VERIFY(iparm2, F3_SYM_LEAF_K, "H5Pget_sym_k");
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
1997-07-31 05:17:56 +08:00
/* Close first file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
1997-07-31 05:17:56 +08:00
/* Close second file */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
1997-07-31 05:17:56 +08:00
/* Close third file */
ret = H5Fclose(fid3);
CHECK(ret, FAIL, "H5Fclose");
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
} /* test_file_create() */
1997-07-31 05:17:56 +08:00
/****************************************************************
**
** test_file_open(): Low-level file open I/O test routine.
**
1997-07-31 05:17:56 +08:00
****************************************************************/
static void
test_file_open(void)
1997-07-31 05:17:56 +08:00
{
hid_t fid1, fid2; /*HDF5 File IDs */
hid_t did; /*dataset ID */
hid_t fapl_id; /*file access property list ID */
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
hid_t tmpl1; /*file creation templates */
hsize_t ublock; /*sizeof user block */
size_t parm; /*file-creation parameters */
size_t parm2; /*file-creation parameters */
unsigned iparm;
unsigned iparm2;
unsigned intent;
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
herr_t ret; /*generic return value */
1997-07-31 05:17:56 +08:00
/*
* Test single file open
*/
1997-07-31 05:17:56 +08:00
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Opening I/O\n"));
1997-07-31 05:17:56 +08:00
/* Open first file */
fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fopen");
1997-07-31 05:17:56 +08:00
/* Get the intent */
ret = H5Fget_intent(fid1, &intent);
CHECK(ret, FAIL, "H5Fget_intent");
VERIFY(intent, H5F_ACC_RDWR, "H5Fget_intent");
1997-07-31 05:17:56 +08:00
/* Get the file-creation template */
[svn-r673] Changes since 19980908 ---------------------- ./COPYING Reformatted as text instead of C. Removed zlib crew from the list of contributors since no zlib code is actually in the hdf5 library. ./INSTALL ./INSTALL.ascired ./MANIFEST Minor updates for Beta release including version number change. ./INSTALL_MAINT Added information about making a release. ./RELEASE Updated function list based on public header files. ./bin/checkposix Got rid of complaints about some obvious things. ./doc/html/H5.api.html ./doc/html/RM_H5F.html ./src/H5F.c ./src/H5Fpublic.h ./test/tfile.c Changed H5Fget_create_template() and H5Fget_access_template() to H5Fget_create_plist() and H5Fget_access_plist() since that conforms better to lots of other names. ./doc/html/Datatypes.html ./doc/html/ExternalFiles.html ./doc/html/Files.html ./doc/html/H5.api.html ./doc/html/H5.sample_code.html ./doc/html/RM_H5F.html ./doc/html/RM_H5Front.html Changed `template' to `property list', etc. ./doc/html/Ragged.html [NEW] Documentation for ragged arrays. ./src/H5Iprivate.h ./src/H5Ipublic.h ./src/H5I.c Changed the scope of some symbols to be more local. ./src/H5.c ./src/H5AC.c ./src/H5D.c ./src/H5E.c ./src/H5F.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5I.c ./src/H5O.c ./src/H5Ocomp.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Omtime.c ./src/H5Oname.c ./src/H5P.c ./src/H5S.c ./src/H5Shyper.c ./src/H5Tbit.c ./src/H5Tconv.c ./src/H5V.c ./src/H5Z.c ./src/H5private.h Fixed some violations of our naming scheme by adding HD to the beginning of all Posix functions.
1998-09-09 03:15:44 +08:00
tmpl1 = H5Fget_create_plist(fid1);
CHECK(tmpl1, FAIL, "H5Fget_create_plist");
1997-07-31 05:17:56 +08:00
/* Get the file-creation parameters */
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
ret = H5Pget_userblock(tmpl1, &ublock);
CHECK(ret, FAIL, "H5Pget_userblock");
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
VERIFY(ublock, F2_USERBLOCK_SIZE, "H5Pget_userblock");
ret = H5Pget_sizes(tmpl1, &parm, &parm2);
CHECK(ret, FAIL, "H5Pget_sizes");
VERIFY(parm, F2_OFFSET_SIZE, "H5Pget_sizes");
VERIFY(parm2, F2_LENGTH_SIZE, "H5Pget_sizes");
ret = H5Pget_sym_k(tmpl1, &iparm, &iparm2);
CHECK(ret, FAIL, "H5Pget_sym_k");
VERIFY(iparm, F2_SYM_INTERN_K, "H5Pget_sym_k");
VERIFY(iparm2, F2_SYM_LEAF_K, "H5Pget_sym_k");
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
1997-07-31 05:17:56 +08:00
/* Close first file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/*
* Test two file opens: one is opened H5F_ACC_RDONLY and H5F_CLOSE_WEAK.
* It's closed with an object left open. Then another is opened
* H5F_ACC_RDWR, which should fail.
*/
/* Output message about test being performed */
MESSAGE(5, ("Testing 2 File Openings\n"));
/* Create file access property list */
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl_id, FAIL, "H5Pcreate");
/* Set file close mode to H5F_CLOSE_WEAK */
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_WEAK);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* Open file for first time */
fid1 = H5Fopen(FILE2, H5F_ACC_RDONLY, fapl_id);
CHECK(fid1, FAIL, "H5Fopen");
/* Check the intent */
ret = H5Fget_intent(fid1, &intent);
CHECK(ret, FAIL, "H5Fget_intent");
VERIFY(intent, H5F_ACC_RDONLY, "H5Fget_intent");
/* Open dataset */
did = H5Dopen(fid1, F2_DSET);
CHECK(did, FAIL, "H5Dopen");
/* Check that the intent works even if NULL is passed in */
ret = H5Fget_intent(fid1, NULL);
CHECK(ret, FAIL, "H5Fget_intent");
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Open file for second time, which should fail. */
fid2 = H5Fopen(FILE2, H5F_ACC_RDWR, fapl_id);
VERIFY(fid2, FAIL, "H5Fopen");
/* Check that the intent fails for an invalid ID */
ret = H5Fget_intent(fid1, &intent);
VERIFY(ret, FAIL, "H5Fget_intent");
/* Close dataset from first open */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
} /* test_file_open() */
1997-07-31 05:17:56 +08:00
/****************************************************************
**
** test_file_close(): low-level file close test routine.
** It mainly tests behavior with close degree.
**
*****************************************************************/
static void
test_file_close(void)
{
hid_t fid1, fid2;
hid_t fapl_id, access_id;
hid_t dataset_id, group_id1, group_id2, group_id3;
H5F_close_degree_t fc_degree;
herr_t ret;
/* Test behavior while opening file multiple times with different
* file close degree value
*/
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fcreate");
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl_id, FAIL, "H5Pcreate");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
ret = H5Pget_fclose_degree(fapl_id, &fc_degree);
VERIFY(fc_degree, H5F_CLOSE_STRONG, "H5Pget_fclose_degree");
/* should fail */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
VERIFY(fid2, FAIL, "H5Fopen");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* should succeed */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
CHECK(fid2, FAIL, "H5Fopen");
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
/* Test behavior while opening file multiple times with different file
* close degree
*/
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fcreate");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_WEAK);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
ret = H5Pget_fclose_degree(fapl_id, &fc_degree);
VERIFY(fc_degree, H5F_CLOSE_WEAK, "H5Pget_fclose_degree");
/* should succeed */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
CHECK(fid2, FAIL, "H5Fopen");
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
/* Test behavior while opening file multiple times with file close
* degree STRONG */
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
CHECK(fid1, FAIL, "H5Fcreate");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_WEAK);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* should fail */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
VERIFY(fid2, FAIL, "H5Fopen");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* should succeed */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
CHECK(fid2, FAIL, "H5Fopen");
/* Create a dataset and a group in each file open respectively */
create_objects(fid1, fid2, NULL, NULL, NULL, NULL);
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
/* Test behavior while opening file multiple times with file close
* degree SEMI */
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
CHECK(fid1, FAIL, "H5Fcreate");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* should fail */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
VERIFY(fid2, FAIL, "H5Fopen");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* should succeed */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
CHECK(fid2, FAIL, "H5Fopen");
/* Create a dataset and a group in each file open respectively */
create_objects(fid1, fid2, &dataset_id, &group_id1, &group_id2, &group_id3);
/* Close first open, should fail since it is SEMI and objects are
* still open. */
ret = H5Fclose(fid1);
VERIFY(ret, FAIL, "H5Fclose");
/* Close second open, should fail since it is SEMI and objects are
* still open. */
ret = H5Fclose(fid2);
VERIFY(ret, FAIL, "H5Fclose");
ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Gclose(group_id1);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id2);
CHECK(ret, FAIL, "H5Gclose");
/* Close second open, should fail since it is SEMI and one group ID is
* still open. */
ret = H5Fclose(fid2);
VERIFY(ret, FAIL, "H5Fclose");
/* Same check with H5Idec_ref() (should fail also) */
ret = H5Idec_ref(fid2);
VERIFY(ret, FAIL, "H5Idec_ref");
ret = H5Gclose(group_id3);
CHECK(ret, FAIL, "H5Gclose");
/* Close second open again. Should succeed. */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
/* Test behavior while opening file multiple times with file close
* degree WEAK */
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_WEAK);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
CHECK(fid1, FAIL, "H5Fcreate");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* should fail */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
VERIFY(fid2, FAIL, "H5Fopen");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* should succeed */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
CHECK(fid2, FAIL, "H5Fopen");
/* Create a dataset and a group in each file open respectively */
create_objects(fid1, fid2, &dataset_id, &group_id1, &group_id2, &group_id3);
/* Create more new files and test object count and ID list functions */
test_obj_count_and_id(fid1, fid2, dataset_id, group_id1,
group_id2, group_id3);
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Close second open. File will be finally closed after all objects
* are closed. */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Gclose(group_id1);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id2);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id3);
CHECK(ret, FAIL, "H5Gclose");
/* Test behavior while opening file multiple times with file close
* degree DEFAULT */
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
CHECK(fid1, FAIL, "H5Fcreate");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* should fail */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
VERIFY(fid2, FAIL, "H5Fopen");
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT);
CHECK(ret, FAIL, "H5Pset_fclose_degree");
/* should succeed */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id);
CHECK(fid2, FAIL, "H5Fopen");
/* Create a dataset and a group in each file open respectively */
create_objects(fid1, fid2, &dataset_id, &group_id1, &group_id2, &group_id3);
access_id = H5Fget_access_plist(fid1);
CHECK(access_id, FAIL, "H5Fget_access_plist");
ret= H5Pget_fclose_degree(access_id, &fc_degree);
CHECK(ret, FAIL, "H5Pget_fclose_degree");
switch(fc_degree) {
case H5F_CLOSE_STRONG:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
break;
case H5F_CLOSE_SEMI:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Gclose(group_id1);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id2);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id3);
CHECK(ret, FAIL, "H5Gclose");
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
break;
case H5F_CLOSE_WEAK:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Gclose(group_id1);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id2);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id3);
CHECK(ret, FAIL, "H5Gclose");
break;
default:
CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree");
break;
}
/* Close file access property list */
ret = H5Pclose(fapl_id);
CHECK(ret, FAIL, "H5Pclose");
ret = H5Pclose(access_id);
CHECK(ret, FAIL, "H5Pclose");
}
/****************************************************************
**
** create_objects(): routine called by test_file_close to create
** a dataset and a group in file.
**
****************************************************************/
static void
create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
hid_t *ret_gid2, hid_t *ret_gid3)
{
int oid_count;
herr_t ret;
/* Check reference counts of file IDs and opened object IDs.
* The verification is hard-coded. If in any case, this testing
* is changed, remember to check this part and update the macros.
*/
{
oid_count = H5Fget_obj_count(fid1, H5F_OBJ_ALL);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
oid_count = H5Fget_obj_count(fid1, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
oid_count = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
oid_count = H5Fget_obj_count(fid2, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
}
/* create a dataset in the first file open */
{
hid_t dataset_id, dataspace_id; /* identifiers */
hsize_t dims[F2_RANK];
int data[F2_DIM0][F2_DIM1];
unsigned i,j;
/* Create the data space for the dataset. */
dims[0] = F2_DIM0;
dims[1] = F2_DIM1;
dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
CHECK(dataspace_id, FAIL, "H5Screate_simple");
/* Create the dataset. */
dataset_id = H5Dcreate(fid1, "/dset", H5T_NATIVE_INT, dataspace_id,
H5P_DEFAULT);
CHECK(dataset_id, FAIL, "H5Dcreate");
for(i=0; i<F2_DIM0; i++)
for(j=0; j<F2_DIM1; j++)
data[i][j]=i*10+j;
/* Write data to the new dataset */
ret = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, data);
CHECK(ret, FAIL, "H5Dwrite");
if(ret_did != NULL)
*ret_did = dataset_id;
/* Terminate access to the data space. */
ret = H5Sclose(dataspace_id);
CHECK(ret, FAIL, "H5Sclose");
}
/* Create a group in the second file open */
{
hid_t gid1, gid2, gid3;
gid1 = H5Gcreate(fid2, "/group", (size_t)0);
CHECK(gid1, FAIL, "H5Gcreate");
if(ret_gid1 != NULL)
*ret_gid1 = gid1;
gid2 = H5Gopen(fid2, "/group");
CHECK(gid2, FAIL, "H5Gopen");
if(ret_gid2 != NULL)
*ret_gid2 = gid2;
gid3 = H5Gopen(fid2, "/group");
CHECK(gid3, FAIL, "H5Gopen");
if(ret_gid3 != NULL)
*ret_gid3 = gid3;
}
/* Check reference counts of file IDs and opened object IDs.
* The verification is hard-coded. If in any case, this testing
* is changed, remember to check this part and update the macros.
*/
{
oid_count = H5Fget_obj_count(fid1, H5F_OBJ_ALL);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
oid_count = H5Fget_obj_count(fid1, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
oid_count = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
oid_count = H5Fget_obj_count(fid2, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
}
}
2003-10-30 01:04:58 +08:00
/****************************************************************
**
** test_get_file_id(): Test H5Iget_file_id()
2003-10-30 01:04:58 +08:00
**
*****************************************************************/
static void
2003-10-30 01:04:58 +08:00
test_get_file_id(void)
{
2003-11-01 02:48:42 +08:00
hid_t fid, fid2, fid3;
hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id;
2003-10-30 01:04:58 +08:00
hid_t plist;
hsize_t dims[F2_RANK];
unsigned intent;
2003-10-30 01:04:58 +08:00
herr_t ret;
/* Create a file */
2003-11-01 02:48:42 +08:00
fid = H5Fcreate(FILE4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
2003-10-30 01:04:58 +08:00
/* Check the intent */
ret = H5Fget_intent(fid, &intent);
CHECK(ret, FAIL, "H5Fget_intent");
VERIFY(intent, H5F_ACC_RDWR, "H5Fget_intent");
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id(fid, fid);
2003-10-30 01:04:58 +08:00
/* Create a group in the file. Make a duplicated file ID from the group.
* And close this duplicated ID
*/
group_id = H5Gcreate(fid, GRP_NAME, (size_t)0);
2003-10-30 01:04:58 +08:00
CHECK(group_id, FAIL, "H5Gcreate");
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id(fid, group_id);
2003-10-30 01:04:58 +08:00
2003-11-01 02:48:42 +08:00
/* Close the file and get file ID from the group ID */
ret = H5Fclose(fid);
2003-10-30 01:04:58 +08:00
CHECK(ret, FAIL, "H5Fclose");
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id(-1, group_id);
ret = H5Gclose(group_id);
CHECK(ret, FAIL, "H5Gclose");
2003-11-01 02:48:42 +08:00
/* Open the file again. Test H5Iget_file_id() */
fid = H5Fopen(FILE4, H5F_ACC_RDWR, H5P_DEFAULT);
2003-11-01 02:48:42 +08:00
CHECK(fid, FAIL, "H5Fcreate");
group_id = H5Gopen(fid, GRP_NAME);
2003-11-01 02:48:42 +08:00
CHECK(group_id, FAIL, "H5Gcreate");
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id(fid, group_id);
/* Open the file for second time. Test H5Iget_file_id() */
fid3 = H5Freopen(fid);
CHECK(fid3, FAIL, "H5Freopen");
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id(fid3, fid3);
2003-11-01 02:48:42 +08:00
ret = H5Fclose(fid3);
CHECK(ret, FAIL, "H5Fclose");
/* Create a dataset in the group. Make a duplicated file ID from the
* dataset. And close this duplicated ID.
2003-10-30 01:04:58 +08:00
*/
dims[0] = F2_DIM0;
dims[1] = F2_DIM1;
dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
CHECK(dataspace_id, FAIL, "H5Screate_simple");
2003-11-01 02:48:42 +08:00
dataset_id = H5Dcreate(group_id, DSET_NAME, H5T_NATIVE_INT, dataspace_id,
2003-10-30 01:04:58 +08:00
H5P_DEFAULT);
CHECK(dataset_id, FAIL, "H5Dcreate");
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id(fid, dataset_id);
2003-10-30 01:04:58 +08:00
/* Create an attribute for the dataset. Make a duplicated file ID from
* this attribute. And close it.
*/
attr_id=H5Acreate(dataset_id,ATTR_NAME,H5T_NATIVE_INT,dataspace_id,H5P_DEFAULT);
CHECK(ret, FAIL, "H5Acreate");
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id(fid, attr_id);
2003-10-30 01:04:58 +08:00
/* Create a named datatype. Make a duplicated file ID from
* this attribute. And close it.
*/
datatype_id=H5Tcopy(H5T_NATIVE_INT);
CHECK(ret, FAIL, "H5Acreate");
2003-11-01 02:48:42 +08:00
ret = H5Tcommit(fid, TYPE_NAME, datatype_id);
CHECK(ret, FAIL, "H5Tcommit");
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id(fid, datatype_id);
2003-10-30 01:04:58 +08:00
/* Create a property list and try to get file ID from it.
* Supposed to fail.
*/
plist = H5Pcreate(H5P_FILE_ACCESS);
CHECK(plist, FAIL, "H5Pcreate");
2003-10-30 01:04:58 +08:00
H5E_BEGIN_TRY {
fid2 = H5Iget_file_id(plist);
} H5E_END_TRY;
VERIFY(fid2, FAIL, "H5Iget_file_id");
/* Close objects */
ret = H5Tclose(datatype_id);
CHECK(ret, FAIL, "H5Tclose");
2003-10-30 01:04:58 +08:00
ret = H5Aclose(attr_id);
CHECK(ret, FAIL, "H5Aclose");
2003-10-30 01:04:58 +08:00
ret = H5Sclose(dataspace_id);
CHECK(ret, FAIL, "H5Sclose");
ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
2003-10-30 01:04:58 +08:00
ret = H5Gclose(group_id);
CHECK(ret, FAIL, "H5Gclose");
2003-11-01 02:48:42 +08:00
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
}
/****************************************************************
**
** check_file_id(): Internal function of test_get_file_id()
2003-11-01 02:48:42 +08:00
**
*****************************************************************/
static void
2003-11-01 02:48:42 +08:00
check_file_id(hid_t fid, hid_t object_id)
{
hid_t new_fid;
herr_t ret;
/* Return a duplicated file ID even not expecting user to do it.
* And close this duplicated ID
*/
new_fid = H5Iget_file_id(object_id);
if(fid >=0)
VERIFY(new_fid, fid, "H5Iget_file_id");
else
CHECK(new_fid, FAIL, "H5Iget_file_id");
ret = H5Fclose(new_fid);
2003-10-30 01:04:58 +08:00
CHECK(ret, FAIL, "H5Fclose");
}
/****************************************************************
**
** test_obj_count_and_id(): test object count and ID list functions.
**
****************************************************************/
static void
test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
hid_t gid2, hid_t gid3)
{
hid_t fid3, fid4;
int oid_count;
herr_t ret;
/* Create two new files */
fid3 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid3, FAIL, "H5Fcreate");
fid4 = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid4, FAIL, "H5Fcreate");
/* test object count of all files IDs open */
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_FILE);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
/* test object count of all datasets open */
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATASET);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_1, "H5Fget_obj_count");
/* test object count of all groups open */
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_GROUP);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_3, "H5Fget_obj_count");
/* test object count of all named datatypes open */
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATATYPE);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
/* test object count of all attributes open */
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ATTR);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
/* test object count of all objects currently open */
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count");
{
hid_t *oid_list;
int i;
H5I_type_t id_type;
oid_list = (hid_t*)calloc((size_t)oid_count, sizeof(hid_t));
if(oid_list != NULL) {
ret = H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_ALL, oid_count, oid_list);
CHECK(ret, FAIL, "H5Fget_obj_ids");
}
for(i=0; i<oid_count; i++) {
id_type = H5Iget_type(oid_list[i]);
switch(id_type) {
case H5I_FILE:
if(oid_list[i]!=fid1 && oid_list[i]!=fid2 &&
oid_list[i]!=fid3 && oid_list[i]!=fid4) {
ret = FAIL;
CHECK(ret, FAIL, "H5Fget_obj_ids");
}
break;
case H5I_GROUP:
if(oid_list[i]!=gid1 && oid_list[i]!=gid2 &&
oid_list[i]!=gid3) {
ret = FAIL;
CHECK(ret, FAIL, "H5Fget_obj_ids");
}
break;
case H5I_DATASET:
VERIFY(oid_list[i], did, "H5Fget_obj_ids");
break;
default:
ret = FAIL;
CHECK(ret, FAIL, "H5Fget_obj_ids");
}
}
free(oid_list);
}
/* close the two new files */
ret = H5Fclose(fid3);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Fclose(fid4);
CHECK(ret, FAIL, "H5Fclose");
}
/****************************************************************
**
** test_file_perm(): low-level file test routine.
** This test verifies that a file can be opened for both
** read-only and read-write access and things will be handled
** appropriately.
**
*****************************************************************/
static void
test_file_perm(void)
{
hid_t file; /* File opened with read-write permission */
hid_t filero; /* Same file opened with read-only permission */
hid_t dspace; /* Dataspace ID */
hid_t dset; /* Dataset ID */
herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Permissions\n"));
dspace = H5Screate(H5S_SCALAR);
CHECK(dspace, FAIL, "H5Screate");
/* Create the file (with read-write permission) */
file = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fcreate");
/* Create a dataset with the read-write file handle */
dset = H5Dcreate(file, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT);
CHECK(dset, FAIL, "H5Dcreate");
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
#ifndef H5_CANNOT_OPEN_TWICE
/* Open the file (with read-only permission) */
filero = H5Fopen(FILE2, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(filero, FAIL, "H5Fopen");
/* Create a dataset with the read-only file handle (should fail) */
H5E_BEGIN_TRY {
dset = H5Dcreate(filero, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT);
} H5E_END_TRY;
VERIFY(dset, FAIL, "H5Dcreate");
if(dset!=FAIL) {
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
} /* end if */
ret = H5Fclose(filero);
CHECK(ret, FAIL, "H5Fclose");
#endif /*H5_CANNOT_OPEN_TWICE*/
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Sclose(dspace);
CHECK(ret, FAIL, "H5Sclose");
} /* end test_file_perm() */
/****************************************************************
**
** test_file_freespace(): low-level file test routine.
** This test checks the free space available in a file in various
** situations.
**
*****************************************************************/
static void
test_file_freespace(void)
{
hid_t file; /* File opened with read-write permission */
hssize_t free_space; /* Amount of free space in file */
hid_t dspace; /* Dataspace ID */
hid_t dset; /* Dataset ID */
hid_t dcpl; /* Dataset creation property list */
unsigned u; /* Local index variable */
char name[32]; /* Dataset name */
herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Free Space\n"));
/* Create the file (with read-write permission) */
file = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fcreate");
/* Check that the free space is 0 */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
VERIFY(free_space, 0, "H5Fget_freespace");
/* Create dataspace for datasets */
dspace = H5Screate(H5S_SCALAR);
CHECK(dspace, FAIL, "H5Screate");
/* Create a dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* Set the space allocation time to early */
ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create datasets in file */
for(u = 0; u < 10; u++) {
sprintf(name, "Dataset %u", u);
dset = H5Dcreate(file, name, H5T_STD_U32LE, dspace, dcpl);
CHECK(dset, FAIL, "H5Dcreate");
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
} /* end for */
/* Close dataspace */
ret = H5Sclose(dspace);
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset creation property list */
ret = H5Pclose(dcpl);
CHECK(ret, FAIL, "H5Pclose");
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
#ifdef H5_HAVE_LARGE_HSIZET
VERIFY(free_space, 2368, "H5Fget_freespace");
#else /* H5_HAVE_LARGE_HSIZET */
VERIFY(free_space, 588, "H5Fget_freespace"); /* XXX: fix me */
#endif /* H5_HAVE_LARGE_HSIZET */
/* Delete datasets in file */
for(u = 0; u < 10; u++) {
sprintf(name, "Dataset %u", u);
ret = H5Gunlink(file, name);
CHECK(ret, FAIL, "H5Gunlink");
} /* end for */
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
#ifdef H5_HAVE_LARGE_HSIZET
VERIFY(free_space, 5512, "H5Fget_freespace");
#else /* H5_HAVE_LARGE_HSIZET */
VERIFY(free_space, 4592, "H5Fget_freespace"); /* XXX: fix me */
#endif /* H5_HAVE_LARGE_HSIZET */
/* Close file */
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
} /* end test_file_freespace() */
/****************************************************************
**
** test_file_ishdf5(): low-level file test routine.
** This test checks whether the H5Fis_hdf5() routine is working
** correctly in variuous situations.
**
*****************************************************************/
static void
test_file_ishdf5(void)
{
hid_t file; /* File opened with read-write permission */
hid_t fcpl; /* File creation property list */
int fd; /* File Descriptor */
ssize_t nbytes; /* Number of bytes written */
unsigned u; /* Local index variable */
unsigned char buf[1024]; /* Buffer of data to write */
htri_t status; /* Whether a file is an HDF5 file */
herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Detection of HDF5 Files\n"));
/* Create a file */
file = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fcreate");
/* Close file */
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is an HDF5 file */
status = H5Fis_hdf5(FILE1);
VERIFY(status, TRUE, "H5Fis_hdf5");
/* Create a file creation property list with a non-default user block size */
fcpl = H5Pcreate(H5P_FILE_CREATE);
CHECK(fcpl, FAIL, "H5Pcreate");
ret = H5Pset_userblock(fcpl, (hsize_t)2048);
CHECK(ret, FAIL, "H5Pset_userblock");
/* Create file with non-default user block */
file = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fcreate");
/* Release file-creation property list */
ret = H5Pclose(fcpl);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is an HDF5 file */
status = H5Fis_hdf5(FILE1);
VERIFY(status, TRUE, "H5Fis_hdf5");
/* Create non-HDF5 file and check it */
fd=HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, 0666);
CHECK(ret, FAIL, "HDopen");
/* Initialize information to write */
for(u=0; u<1024; u++)
buf[u]=(unsigned char)u;
/* Write some information */
nbytes = HDwrite(fd, buf, (size_t)1024);
VERIFY(nbytes, 1024, "HDwrite");
/* Close the file */
ret = HDclose(fd);
CHECK(ret, FAIL, "HDclose");
/* Verify that the file is not an HDF5 file */
status = H5Fis_hdf5(FILE1);
VERIFY(status, FALSE, "H5Fis_hdf5");
} /* end test_file_ishdf5() */
/****************************************************************
**
** test_file_open_dot(): low-level file test routine.
** This test checks whether opening objects with "." for a name
** works correctly in variuous situations.
**
*****************************************************************/
static void
test_file_open_dot(void)
{
hid_t fid; /* File ID */
hid_t gid, gid2; /* Group IDs */
hid_t did; /* Dataset ID */
hid_t sid; /* Dataspace ID */
hid_t tid, tid2; /* Datatype IDs */
herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing opening objects with \".\" for a name\n"));
/* Create a new HDF5 file to work with */
fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create a group in the HDF5 file */
gid = H5Gcreate(fid, GRP_NAME, (size_t)0);
CHECK(gid, FAIL, "H5Gcreate");
/* Create a dataspace for creating datasets */
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Create a dataset with no name using the file ID */
H5E_BEGIN_TRY {
did = H5Dcreate(fid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT);
} H5E_END_TRY;
VERIFY(did, FAIL, "H5Dcreate");
/* Create a dataset with no name using the group ID */
H5E_BEGIN_TRY {
did = H5Dcreate(gid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT);
} H5E_END_TRY;
VERIFY(did, FAIL, "H5Dcreate");
/* Open a dataset with no name using the file ID */
H5E_BEGIN_TRY {
did = H5Dopen(fid, ".");
} H5E_END_TRY;
VERIFY(did, FAIL, "H5Dopen");
/* Open a dataset with no name using the group ID */
H5E_BEGIN_TRY {
did = H5Dopen(gid, ".");
} H5E_END_TRY;
VERIFY(did, FAIL, "H5Dopen");
/* Make a copy of a datatype to use for creating a named datatype */
tid = H5Tcopy(H5T_NATIVE_INT);
CHECK(tid, FAIL, "H5Tcopy");
/* Create a named datatype with no name using the file ID */
H5E_BEGIN_TRY {
ret = H5Tcommit(fid, ".", tid);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Tcommit");
/* Create a named datatype with no name using the group ID */
H5E_BEGIN_TRY {
ret = H5Tcommit(gid, ".", tid);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Tcommit");
/* Open a named datatype with no name using the file ID */
H5E_BEGIN_TRY {
tid2 = H5Topen(fid, ".");
} H5E_END_TRY;
VERIFY(tid2, FAIL, "H5Topen");
/* Open a named datatype with no name using the group ID */
H5E_BEGIN_TRY {
tid2 = H5Topen(gid, ".");
} H5E_END_TRY;
VERIFY(tid2, FAIL, "H5Topen");
/* Create a group with no name using the file ID */
H5E_BEGIN_TRY {
gid2 = H5Gcreate(fid, ".", (size_t)0);
} H5E_END_TRY;
VERIFY(gid2, FAIL, "H5Gcreate");
/* Create a group with no name using the group ID */
H5E_BEGIN_TRY {
gid2 = H5Gcreate(gid, ".", (size_t)0);
} H5E_END_TRY;
VERIFY(gid2, FAIL, "H5Gcreate");
/* Open a group with no name using the file ID (should open the root group) */
gid2 = H5Gopen(fid, ".");
CHECK(gid2, FAIL, "H5Gopen");
ret = H5Gclose(gid2);
CHECK(ret, FAIL, "H5Gclose");
/* Open a group with no name using the group ID (should open the group again) */
gid2 = H5Gopen(gid, ".");
CHECK(gid2, FAIL, "H5Gopen");
ret = H5Gclose(gid2);
CHECK(ret, FAIL, "H5Gclose");
/* Close everything */
ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
ret = H5Gclose(gid);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
} /* end test_file_open_dot() */
/****************************************************************
**
** test_file_open_overlap(): low-level file test routine.
** This test checks whether opening files in an overlapping way
** (as opposed to a nested manner) works correctly.
**
*****************************************************************/
static void
test_file_open_overlap(void)
{
hid_t fid1, fid2;
hid_t did1, did2;
hid_t gid;
hid_t sid;
int nobjs; /* # of open objects */
unsigned intent;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing opening overlapping file opens\n"));
/* Create file */
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fcreate");
/* Open file also */
fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid2, FAIL, "H5Fopen");
/* Check the intent */
ret = H5Fget_intent(fid1, &intent);
CHECK(ret, FAIL, "H5Fget_intent");
VERIFY(intent, H5F_ACC_RDWR, "H5Fget_intent");
/* Create a group in file */
gid = H5Gcreate(fid1, GROUP1, (size_t)0);
CHECK(gid, FAIL, "H5Gcreate");
/* Create dataspace for dataset */
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Create dataset in group w/first file ID */
did1 = H5Dcreate(gid, DSET1, H5T_NATIVE_INT, sid, H5P_DEFAULT);
CHECK(did1, FAIL, "H5Dcreate");
/* Check number of objects opened in first file */
nobjs = H5Fget_obj_count(fid1, H5F_OBJ_LOCAL|H5F_OBJ_ALL);
VERIFY(nobjs, 3, "H5Fget_obj_count"); /* 3 == file, dataset & group */
/* Close dataset */
ret = H5Dclose(did1);
CHECK(ret, FAIL, "H5Dclose");
/* Close group */
ret = H5Gclose(gid);
CHECK(ret, FAIL, "H5Gclose");
/* Close first file ID */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
/* Create dataset with second file ID */
did2 = H5Dcreate(fid2, DSET2, H5T_NATIVE_INT, sid, H5P_DEFAULT);
CHECK(did2, FAIL, "H5Dcreate");
/* Check number of objects opened in first file */
nobjs = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
VERIFY(nobjs, 2, "H5Fget_obj_count"); /* 3 == file & dataset */
/* Close dataspace */
ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
/* Close second dataset */
ret = H5Dclose(did2);
CHECK(ret, FAIL, "H5Dclose");
/* Close second file */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
} /* end test_file_open_overlap() */
/****************************************************************
**
** test_file_getname(): low-level file test routine.
** This test checks whether H5Fget_name works correctly.
**
*****************************************************************/
static void
test_file_getname(void)
{
/* Compound datatype */
typedef struct s1_t {
unsigned int a;
float b;
} s1_t;
hid_t file_id;
hid_t group_id;
hid_t dataset_id;
hid_t space_id;
hid_t type_id;
hid_t attr_id;
hsize_t dims[TESTA_RANK] = {TESTA_NX, TESTA_NY};
char name[TESTA_NAME_BUF_SIZE];
ssize_t name_len;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing H5Fget_name() functionality\n"));
/* Create a new file_id using default properties. */
file_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT );
CHECK(file_id, FAIL, "H5Fcreate");
/* Get and verify file name */
name_len = H5Fget_name(file_id, name, (size_t)TESTA_NAME_BUF_SIZE);
CHECK(name_len, FAIL, "H5Fget_name");
VERIFY_STR(name, FILE1, "H5Fget_name");
/* Create a group in the root group */
group_id = H5Gcreate(file_id, TESTA_GROUPNAME, (size_t)0);
CHECK(group_id, FAIL, "H5Gcreate");
/* Get and verify file name */
name_len = H5Fget_name(group_id, name, (size_t)TESTA_NAME_BUF_SIZE);
CHECK(name_len, FAIL, "H5Fget_name");
VERIFY_STR(name, FILE1, "H5Fget_name");
/* Create the data space */
space_id = H5Screate_simple(TESTA_RANK, dims, NULL);
CHECK(space_id, FAIL, "H5Screate_simple");
/* Try get file name from data space. Supposed to fail because
* it's illegal operation. */
H5E_BEGIN_TRY {
name_len = H5Fget_name(space_id, name, (size_t)TESTA_NAME_BUF_SIZE);
} H5E_END_TRY;
VERIFY(name_len, FAIL, "H5Fget_name");
/* Create a new dataset */
dataset_id = H5Dcreate(file_id, TESTA_DSETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
CHECK(dataset_id, FAIL, "H5Dcreate");
/* Get and verify file name */
name_len = H5Fget_name(dataset_id, name, (size_t)TESTA_NAME_BUF_SIZE);
CHECK(name_len, FAIL, "H5Fget_name");
VERIFY_STR(name, FILE1, "H5Fget_name");
/* Create an attribute for the dataset */
attr_id = H5Acreate(dataset_id,TESTA_ATTRNAME,H5T_NATIVE_INT,space_id,H5P_DEFAULT);
CHECK(attr_id, FAIL, "H5Acreate");
/* Get and verify file name */
name_len = H5Fget_name(attr_id, name, (size_t)TESTA_NAME_BUF_SIZE);
CHECK(name_len, FAIL, "H5Fget_name");
VERIFY_STR(name, FILE1, "H5Fget_name");
/* Create a compound datatype */
type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
CHECK(type_id, FAIL, "H5Tcreate");
/* Insert fields */
ret = H5Tinsert (type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
CHECK(ret, FAIL, "H5Tinsert");
ret = H5Tinsert (type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_FLOAT);
CHECK(ret, FAIL, "H5Tinsert");
/* Save it on file */
ret = H5Tcommit(file_id, TESTA_DTYPENAME, type_id);
CHECK(ret, FAIL, "H5Tcommit");
/* Get and verify file name */
name_len = H5Fget_name(type_id, name, (size_t)TESTA_NAME_BUF_SIZE);
CHECK(name_len, FAIL, "H5Fget_name");
VERIFY_STR(name, FILE1, "H5Fget_name");
/* Close things down */
ret = H5Tclose(type_id);
CHECK(ret, FAIL, "H5Tclose");
ret = H5Aclose(attr_id);
CHECK(ret, FAIL, "H5Aclose");
ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Sclose(space_id);
CHECK(ret, FAIL, "H5Sclose");
ret = H5Gclose(group_id);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Fclose(file_id);
CHECK(ret, FAIL, "H5Fclose");
} /* end test_file_getname() */
/****************************************************************
**
** test_file_double_root_open(): low-level file test routine.
** This test checks whether opening the root group from two
** different files works correctly.
**
*****************************************************************/
static void
test_file_double_root_open(void)
{
hid_t file1_id, file2_id;
hid_t grp1_id, grp2_id;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double root group open\n"));
file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1_id, FAIL, "H5Fcreate");
file2_id = H5Fopen (FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file2_id, FAIL, "H5Fopen");
grp1_id = H5Gopen(file1_id, "/");
CHECK(grp1_id, FAIL, "H5Gopen");
grp2_id = H5Gopen(file2_id, "/");
CHECK(grp2_id, FAIL, "H5Gopen");
/* Note "assymetric" close order */
ret = H5Gclose(grp1_id);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(grp2_id);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Fclose(file1_id);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Fclose(file2_id);
CHECK(ret, FAIL, "H5Fclose");
} /* end test_file_double_root_open() */
/****************************************************************
**
** test_file_double_group_open(): low-level file test routine.
** This test checks whether opening the same group from two
** different files works correctly.
**
*****************************************************************/
static void
test_file_double_group_open(void)
{
hid_t file1_id, file2_id;
hid_t grp1_id, grp2_id;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double non-root group open\n"));
file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1_id, FAIL, "H5Fcreate");
file2_id = H5Fopen (FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file2_id, FAIL, "H5Fopen");
grp1_id = H5Gcreate(file1_id, GRP_NAME, (size_t)0);
CHECK(grp1_id, FAIL, "H5Gcreate");
grp2_id = H5Gopen(file2_id, GRP_NAME);
CHECK(grp2_id, FAIL, "H5Gopen");
/* Note "assymetric" close order */
ret = H5Gclose(grp1_id);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(grp2_id);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Fclose(file1_id);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Fclose(file2_id);
CHECK(ret, FAIL, "H5Fclose");
} /* end test_file_double_group_open() */
/****************************************************************
**
** test_file_double_dataset_open(): low-level file test routine.
** This test checks whether opening the same dataset from two
** different files works correctly.
**
*****************************************************************/
static void
test_file_double_dataset_open(void)
{
hid_t file1_id, file2_id;
hid_t dset1_id, dset2_id;
hid_t space_id;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double dataset open\n"));
file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1_id, FAIL, "H5Fcreate");
file2_id = H5Fopen (FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file2_id, FAIL, "H5Fopen");
/* Create dataspace for dataset */
space_id = H5Screate(H5S_SCALAR);
CHECK(space_id, FAIL, "H5Screate");
dset1_id = H5Dcreate(file1_id, DSET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
CHECK(dset1_id, FAIL, "H5Dcreate");
dset2_id = H5Dopen(file2_id, DSET_NAME);
CHECK(dset2_id, FAIL, "H5Dopen");
/* Close "supporting" dataspace */
ret = H5Sclose(space_id);
CHECK(ret, FAIL, "H5Sclose");
/* Note "assymetric" close order */
ret = H5Dclose(dset1_id);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Dclose(dset2_id);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Fclose(file1_id);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Fclose(file2_id);
CHECK(ret, FAIL, "H5Fclose");
} /* end test_file_double_dataset_open() */
/****************************************************************
**
** test_file_double_datatype_open(): low-level file test routine.
** This test checks whether opening the same named datatype from two
** different files works correctly.
**
*****************************************************************/
static void
test_file_double_datatype_open(void)
{
hid_t file1_id, file2_id;
hid_t type1_id, type2_id;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double dataset open\n"));
file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1_id, FAIL, "H5Fcreate");
file2_id = H5Fopen (FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file2_id, FAIL, "H5Fopen");
type1_id = H5Tcopy(H5T_NATIVE_INT);
CHECK(type1_id, FAIL, "H5Tcopy");
ret = H5Tcommit(file1_id, TYPE_NAME, type1_id);
CHECK(ret, FAIL, "H5Tcommit");
type2_id = H5Topen(file2_id, TYPE_NAME);
CHECK(type2_id, FAIL, "H5Topen");
/* Note "assymetric" close order */
ret = H5Tclose(type1_id);
CHECK(ret, FAIL, "H5Tclose");
ret = H5Tclose(type2_id);
CHECK(ret, FAIL, "H5Tclose");
ret = H5Fclose(file1_id);
CHECK(ret, FAIL, "H5Fclose");
ret = H5Fclose(file2_id);
CHECK(ret, FAIL, "H5Fclose");
} /* end test_file_double_dataset_open() */
1997-07-31 05:17:56 +08:00
/****************************************************************
**
** test_file(): Main low-level file I/O test routine.
**
1997-07-31 05:17:56 +08:00
****************************************************************/
void
test_file(void)
1997-07-31 05:17:56 +08:00
{
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File I/O\n"));
1997-07-31 05:17:56 +08:00
test_file_create(); /* Test file creation(also creation templates)*/
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
test_file_open(); /* Test file opening */
#ifndef H5_NO_SHARED_WRITING
test_file_close(); /* Test file close behavior */
#endif /* H5_NO_SHARED_WRITING */
2003-10-30 01:04:58 +08:00
test_get_file_id(); /* Test H5Iget_file_id */
test_file_perm(); /* Test file access permissions */
test_file_freespace(); /* Test file free space information */
test_file_ishdf5(); /* Test detecting HDF5 files correctly */
test_file_open_dot(); /* Test opening objects with "." for a name */
#ifndef H5_CANNOT_OPEN_TWICE
test_file_open_overlap(); /* Test opening files in an overlapping manner */
#endif /*H5_CANNOT_OPEN_TWICE*/
test_file_getname(); /* Test basic H5Fget_name() functionality */
#ifndef H5_CANNOT_OPEN_TWICE
test_file_double_root_open(); /* Test opening root group from two files works properly */
test_file_double_group_open(); /* Test opening same group from two files works properly */
test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */
test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */
#endif /*H5_CANNOT_OPEN_TWICE*/
[svn-r338] Changes since 19980407 ---------------------- ./src/H5B.c ./src/H5D.c ./src/H5Dprivate.h ./src/H5Dpublic.h ./src/H5F.c ./src/H5Farray.c ./src/H5Fcore.c ./src/H5Ffamily.c ./src/H5Fistore.c ./src/H5Flow.c ./src/H5Fprivate.h ./src/H5Fpublic.h ./src/H5Fsec2.c ./src/H5Fsplit.c ./src/H5Fstdio.c ./src/H5G.c ./src/H5Gent.c ./src/H5Gnode.c ./src/H5HG.c ./src/H5HL.c ./src/H5MF.c ./src/H5MFprivate.h ./src/H5O.c ./src/H5Ocont.c ./src/H5Odtype.c ./src/H5Oefl.c ./src/H5Olayout.c ./src/H5Oname.c ./src/H5Oprivate.h ./src/H5Osdspace.c ./src/H5Oshared.c ./src/H5Ostab.c ./src/H5P.c ./src/H5Ppublic.h ./src/H5S.c ./src/H5Sprivate.h ./src/H5Spublic.h ./src/H5Ssimp.c ./src/H5Tconv.c ./src/H5Tpkg.h ./src/H5V.c ./src/H5Vprivate.h ./src/H5private.h ./src/H5public.h ./src/h5ls.c ./test/cmpd_dset.c ./test/dsets.c ./test/extend.c ./test/external.c ./test/hyperslab.c ./test/iopipe.c ./test/istore.c ./test/shtype.c ./test/tfile.c ./test/th5s.c Anything having to do with the size of a dataset now uses the types `hsize_t' and `hssize_t' which must be the same size and at least as large as `size_t'. This isn't fully tested yet, so hsize_t and hssize_t are defined as size_t and ssize_t in H5public.h. Setting them to larger values will trip up gcc versions less than 2.8.1 on x86 platforms. Documented unused function formals with `__unused__' before the formal name. This also has the effect of supressing warning messages for gcc since it's defined to be `__attribute__((unused))' in the H5private.h file. ./src/debug.c ./src/h5ls.c If the file name contains a `%' then the file is opened as a file family with H5P_DEFAULT for the file member access property list. ./src/h5ls.c The group name is optional, defaulting to `/'. ./src/hdf5.h Added some missing public header files.
1998-04-09 05:43:02 +08:00
} /* test_file() */
/*-------------------------------------------------------------------------
* Function: cleanup_file
*
* Purpose: Cleanup temporary test files
*
* Return: none
*
* Programmer: Albert Cheng
* July 2, 1998
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
void
cleanup_file(void)
{
HDremove(FILE1);
HDremove(FILE2);
HDremove(FILE3);
HDremove(FILE4);
}