Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H5Ovisit2 change of behavior between 1.10.11 and v1.14.4.3 #4941

Open
abhibaruah opened this issue Oct 9, 2024 · 0 comments
Open

H5Ovisit2 change of behavior between 1.10.11 and v1.14.4.3 #4941

abhibaruah opened this issue Oct 9, 2024 · 0 comments
Assignees
Labels
Component - C Library Core C library issues (usually in the src directory) Confirmed Priority - 1. High 🔼 These are important issues that should be resolved in the next release
Milestone

Comments

@abhibaruah
Copy link

Platform (please complete the following information)

  • HDF5 version - 1.14.4.3
  • OS and version - Debian 12
  • Compiler and version - gcc

I noticed that there is a change of behavior in H5Ovisit2 between HDF5 versions 1.10.11 and 1.14.4.3.
I wanted to check if this is intended behavior, or a bug introduced in any of the versions after 1.10.11.

I also see the same behavior with H5Ovisit_by_name2.
We are also compiling the application with the compatibility flag “-DH5_USE_18_API” to preserve 1.8 function mapping.
I have created a simplified reproduction of the tests on our end and am attaching it. The h5 file I used for the repro can be found here.

Output from 1.10.11:
H5Ovisit_func
.
144115188075855873
H5Ovisit_func
g1
144115188075855873
H5Ovisit_func
g1/g2
144115188075855873
H5Ovisit_func
g1/g2/myDataset
144115188075855873
Status: 0

Output from 1.14.4.3
H5Ovisit_func
.
144115188075855873
Status: 0

Even though the H5Ovisit2 documentation mentions it is “a recursive iteration function to visit the object obj_id and, if obj_id is a group, all objects in and below it in an HDF5 file,…”, for 1.14.4.3, it seems like the function visits only the root group and not all the nested groups.

#include "hdf5.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include "string.h"

#define FILE1           "testfile.h5"

herr_t H5Ovisit_func(hid_t obj_id, const char* name, const H5O_info_t *info, void* opdata) {
    std::cout << "H5Ovisit_func" << std::endl;
    std::cout << name << std::endl;

    std::cout << obj_id << std::endl;
    return (0);
}

int main() {
  hid_t           file_id;    /* Handles */
  herr_t          status;
  

  /*
    * Create a new file using the default properties.
    */
  file_id = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);

// Open root object
  hid_t obj_id = H5Oopen(file_id, "/", H5P_DEFAULT);

  // Visit root
  H5_index_t idx_type = H5_INDEX_NAME;
  H5_iter_order_t order = H5_ITER_DEC;
  void* opdata = (void*)0;
  unsigned fields = H5O_INFO_META_SIZE;

  // Visit the root group
  status = H5Ovisit2(obj_id, idx_type, order, H5Ovisit_func, opdata, fields);
  std::cout << "Status: " << status << std::endl;



  // Close objects
  H5Oclose(obj_id);
  status = H5Fclose(file_id);

	return 0;
}


@bmribler bmribler added Priority - 0. Blocker ⛔ This MUST be merged for the release to happen Component - C Library Core C library issues (usually in the src directory) UNCONFIRMED New issues are unconfirmed until a maintainer can duplicate them labels Oct 9, 2024
@bmribler bmribler self-assigned this Oct 9, 2024
@bmribler bmribler added Confirmed Merge - To 2.0 This needs to be merged to HDF5 2.0 and removed UNCONFIRMED New issues are unconfirmed until a maintainer can duplicate them labels Oct 12, 2024
@derobins derobins added Priority - 1. High 🔼 These are important issues that should be resolved in the next release and removed Merge - To 2.0 This needs to be merged to HDF5 2.0 Priority - 0. Blocker ⛔ This MUST be merged for the release to happen labels Oct 15, 2024
@derobins derobins added this to the 2.0.0 milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C Library Core C library issues (usually in the src directory) Confirmed Priority - 1. High 🔼 These are important issues that should be resolved in the next release
Projects
None yet
Development

No branches or pull requests

3 participants