/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 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. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * This program illustrates assertion errors when linked * to HDF5 1.4.1-post2 or 1.4.2-pre3 debug library. * * If the assertion errors are ignored, the program eventially causes * an error in H5Gcreate when writing object 83381. * * When writing in single file mode, the assertion errors still occur * but the H5Gcreate error does not. */ #include "hdf5.h" #define FILEN "testmeta.h5" #define MEMB_SIZE 100000000 #define CHUNK_SIZE 512 #define NDATAARRAYS 3 /*#define NPOINTS 2048*/ #define NPOINTS 20 #define NEXTARRAYS 10 #define NWATTRS 2 #define NDATAOBJECTS 100000 int main(void) { hid_t file_id, prop_id, memspace_id, type_id; hid_t group_id; hid_t dataset_id, dataspace_id; herr_t status; hsize_t dims[1]; hsize_t maxdims[1]; float data[NPOINTS]; float floatval; unsigned numdataobj = 0; unsigned i, j; char name[80]; hsize_t start[1] = {0}; hsize_t stride[1] = {1}; hsize_t count[1] = {1}; /* Create a file */ file_id = H5Fcreate(FILEN, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Create a dataset to hold the number of data objects */ /* Create the data space */ dataspace_id = H5Screate(H5S_SCALAR); /* Create dataset */ dataset_id = H5Dcreate(file_id, "/NumDataObj", H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT); /* Write value to NumDataObj dataset */ status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &numdataobj); /* Close the identifiers */ status = H5Dclose(dataset_id); status = H5Sclose(dataspace_id); /* Create extendible arrays */ /* Set up for extendible dataset */ prop_id = H5Pcreate(H5P_DATASET_CREATE); dims[0] = CHUNK_SIZE; status = H5Pset_chunk(prop_id, 1, dims); /* Create dataspace */ dims[0]=1; maxdims[0]=H5S_UNLIMITED; dataspace_id = H5Screate_simple(1, dims, maxdims); for(i=0; i