Re: it works with new HDF5 APIs: Re: beta1 bug

Hi Quincey,

Yes, they should but they didn't . The last H5Fopen should definitely use access property for new files and not H5P_DEFAULT.

We need to look carefully why the original program didn't work and fix whatever needs to be fixed.

Elena

At 7:45 AM -0500 4/27/07, Quincey Koziol wrote:
Hi Elena,

On Apr 26, 2007, at 12:00 PM, Elena Pourmal wrote:

Ed,

Since you are using new feature of HDF5, you cannot use the old APIs. We rewrote your program and it works. It is attached. (That doesn't mean that HDF5 is bugs free :-) )

Hmm, I think that Ed's original program should work also. He's used all the APIs correctly as far as I can see. The older APIs should be able to read the files created with the newer APIs (as long as they are from the newer library).

        Quincey


We still have to do a lot of work to make it easy to convert the old applications (like first implementation of NetCDF-4) to use new HDF5 features. So for now you need to make some changes to the NetCDF-4 code.

I propose that we work together to speed up NetCDF-4 conversion to the new APIs since our docs are still under development. Will you have time tomorrow to have a quick telecon?

Thank you!

Elena


At 1:57 PM -0600 4/25/07, Ed Hartnett wrote:
Jeff Whitaker <jswhit@xxxxxxxxxxx> writes:

 Ed:  The attached C program creates a netcdf4_classic file that is
 unreadable (ncdump'ing it gives an 'HDF Error').

 -Jeff


<snip>

Jeff,

This turns out to be a HDF5 error, I believe.

I have reduced it to a HDF5-only program, which I sent to Quincey, the
HDF5 programmer. (But I happen to know he's on a well-deserved
vacation in Florida, so I don't know when he'll get back to look at
this!)

If anyone else at HDF5 HQ is interested, here's the HDF5 code that
demonstrates the problem. It fails on the H5Gopen call, at the bottom
of the code.

Thanks!

Ed

   printf("Testing some more simple atts...");
   {
      hid_t fcpl_id, fapl_id, hdfid, grpid;
      hid_t spaceid, attid, attid1;
      int one = 1;
      hsize_t dims[1];

      /* Create a HDF5 file. */
      if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
      if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG)) ERR;
      if (H5Pset_latest_format(fapl_id, 1) < 0) ERR;
      if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
      if (H5Pset_link_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
H5P_CRT_ORDER_INDEXED)) < 0) ERR;
      if (H5Pset_attr_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
H5P_CRT_ORDER_INDEXED)) < 0) ERR;
if ((hdfid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
      if (H5Pclose(fapl_id) < 0) ERR;
      if (H5Pclose(fcpl_id) < 0) ERR;

      /* Open the root group. */
      if ((grpid = H5Gopen(hdfid, "/")) < 0) ERR;

      /* Write an attribute. */
      if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
      if ((attid = H5Acreate(grpid, NC3_STRICT_ATT_NAME, H5T_NATIVE_INT,
                             spaceid, H5P_DEFAULT)) < 0) ERR;
      if (H5Awrite(attid, H5T_NATIVE_INT, &one) < 0) ERR;
      if (H5Sclose(spaceid) < 0) ERR;

      H5Fflush(hdfid, H5F_SCOPE_GLOBAL);
      dims[0] = 1;
      if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
      if ((attid1 = H5Acreate(grpid, "a", H5T_NATIVE_INT, spaceid,
                             H5P_DEFAULT)) < 0) ERR;
      if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR;
      if (H5Aclose(attid1) < 0) ERR;
      if ((attid1 = H5Acreate(grpid, "b", H5T_NATIVE_INT, spaceid,
                             H5P_DEFAULT)) < 0) ERR;
      if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR;
      if (H5Aclose(attid1) < 0) ERR;
      if ((attid1 = H5Acreate(grpid, "c", H5T_NATIVE_INT, spaceid,
                             H5P_DEFAULT)) < 0) ERR;
      if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR;
      if (H5Aclose(attid1) < 0) ERR;

      if (H5Sclose(spaceid) < 0) ERR;
      if (H5Aclose(attid) < 0) ERR;
      if (H5Gclose(grpid) < 0) ERR;
      if (H5Fclose(hdfid) < 0) ERR;

if ((hdfid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
      if ((grpid = H5Gopen(hdfid, "/")) < 0)
      if (H5Gclose(grpid) < 0) ERR;
      if (H5Fclose(hdfid) < 0) ERR;
   }

--
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx

==============================================================================
To unsubscribe netcdf-hdf, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


--

------------------------------------------------------------
Elena Pourmal
The HDF Group
1901 So First ST.
Suite C-2
Champaign, IL 61820

epourmal@xxxxxxxxxxxx
(217)333-0238 (office)
(217)333-9049 (fax)
------------------------------------------------------------
<netcdf_bug.c>



Attachment converted: Macintosh HD:smime 502.p7s (    /    ) (0010E88E)


--

------------------------------------------------------------
Elena Pourmal
The HDF Group
1901 So First ST.
Suite C-2
Champaign, IL 61820

epourmal@xxxxxxxxxxxx
(217)333-0238 (office)
(217)333-9049 (fax)
------------------------------------------------------------

==============================================================================
To unsubscribe netcdf-hdf, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================