kharm/hdf5_utils.hpp
// Open an existing file for reading
Open an existing file for reading
Open an existing file for reading
int H5F::open(const char *fname)
{
    hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS);
#if USE_MPI
    H5Pset_fapl_mpio(plist_id, MPI_COMM_WORLD, MPI_INFO_NULL);
#endif
    file_id = H5Fopen(fname, H5F_ACC_RDONLY, plist_id);
    H5Pclose(plist_id);
    set_directory("/");
    H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
    if (file_id < 0)
        FAIL(file_id, "hdf5_open", fname);
    return 0;
}
int H5F :: open ( const char * fname ) { hid_t plist_id = H5Pcreate ( H5P_FILE_ACCESS ) ; #if USE_MPI H5Pset_fapl_mpio ( plist_id , MPI_COMM_WORLD , MPI_INFO_NULL ) ; #endif file_id = H5Fopen ( fname , H5F_ACC_RDONLY , plist_id ) ; H5Pclose ( plist_id ) ; set_directory ( " " ) ; H5Eset_auto2 ( H5E_DEFAULT , NULL , NULL ) ; if ( file_id < 0 ) FAIL ( file_id , " " , fname ) ; return 0 ; }
Open an existing file for reading
Open an existing file for reading
// Everyone expects directory to be root after open // Quiet HDF5's own errors, so we can control them