400 likes | 418 Views
Explore the HDF5 abstract data model and its implementation in UML notation. Learn about HDF5 file structure, objects, and their relationships for various programming languages.
E N D
HDF5 Abstract Data Model Classes, Objects and their relationships http://hdf.ncsa.uiuc.edu/HDF5/ADM_EOS_Sep99/index.htm
Outline • Motivation and goals • Overview of HDF5 file structure and HDF5 objects • UML notation • Formal description of HDF5 file, HDF5 objects and operations in UML
Motivation and Goals • Need a formal description of HDF5 file and library • Need an HDF5 abstract data model (ADM) for high level C++, F90, Java, Ada(?) APIs • Attempt to look at HDF5 ADM from OO point of view • HDF group does not have experience in OO design and languages • Universal Modeling Language (UML) has been chosen to document current HDF5 ADM and HDF5 Library • Suggestions and help from HDF5 “OO users” is WELCOME!
HDF5 File (conceptual view) • Container for storing scientific data • Primary Objects: • Groups • Datasets • Secondary Objects: • Datatypes • Dataspaces • Additional means to organize data • Attributes • Sharable objects • Storage and access properties
/ File RGroup B C A F Group Dataset Datatype D E H G Dataset Group K Example of an HDF5 File Dataset path : /B /C/D/G
File A E H Dataset Example of an HDF5 File (cont.) / RGroup B C F Group Dataset Datatype D G Group K Dataset path : /B /C/D/G
Example of an HDF5 File (cont.) / File RGroup B C F Group Dataset Datatype D Group K Dataset path : /B
HDF5File (logical view) • Directed graph with an entry point(root group) • nodes are HDF5 objects: • Group, Dataset, Dataspace, Datatype • each object may have more than one path to it • edges are inclusion directions (HDF5 links) • graph may have: • loops • isolated nodes • “dangling” edges
UML Notation Book: UML Distilled Applying the Standard Object Modeling Language by Martin Fowler Booch Jacobson Rumbaugh Object Technology Series Addison-Wesley
UML Notation Class Class Name ____________ Attribute ____________ Operation Class Name
UML Notation Association Describes connection between object instances, should be a verb. Object A has object B associated with it. Class A Class B Multiplicity of Association Object A has zero or more objects B associated with it. Object B belongs to at least one and up to N objects A Class A Class B 1..N 0...*
UML Notation Generalization(Inheritance) “is a” relationship B is an A Class A Class B
UML Notation Aggregation “apart of” relationship Objects B and C are part of object A Class A Class B Class C
UML Notation Composition “apart of” relationship Objects B and C “live and die” with A Class A Class B Class C
FileClass Group Class Dataset Class DataspaceClass Datatype Class Named_Object Class Group Dataset Named Dataspace Named Datatype User_Defined_Attribute Class HDF5 Classes
Link Class Root Link Non-Root Link Soft Link Hard Link Property List Class File Property List Creation Property List Access Property List Dataset Property List Transfer Property List Storage property List HDF5 Classes
File Class File , Group Class and Root Link Class Association Diagram 1 1 File Class Group Class 1 0…* 1 1 Root Link Class File Property List Class File is a composition of a Group. Root Link is created when File is created. Root Link points to the Group which is called Root Group. Root Group is automatically created/opened/closed when File is created/opened/closed.
File and Group Classes File Class _______________________________________________ open/close create is_hdf5 get_create_prp get_access_prp mount/unmount reopen Group Class _____________________ _____________________ open/close iterate get_object_info get_link_value get/set_comment
Group Class and Associated Classes Group Group Class 1 C 0…* Non-Root Link Class 1…* D A B 0…1 ... HDF5 object HDF5 object Named Object Class
Link Class Link Class Non-Root Link Class Root Link Class Hard Link Soft Link 0...* 1...* 0...1 1 Named Object Named Object
Non-Root Link Class Non-Root Link Class ____________________________ name ______________________ link/unlink create move (rename)
Named_Object Class Named Datatype Class Group Class Dataset Class Named Dataspace Class Named_Object Class 1 0...1 1 0…* 1...* 0…* User Defined Attribute Hard Link Class Soft Link Class Not implemented yet
User Defined Attribute Datatype Dataset Dataspace Storage Property List Soft Link Hard Link Dataset Class and associated Classes 0...* 1 0...* 0...* 1 1 0...* 1 1 1 1...* 0…*
Dataset Class Dataset Class ________________________ user defined attribute ________________________ create open/close write/read extend get_space/type/property
Attribute Class and associated Classes Named Object Class 1 0...* Attribute Class 0...* 0...* 1 1 Dataspace Class Datatype Class
Attribute Class Attribute Class _________________________ name _____________________ create open/close write/read get_space/type/property
Property List Class and Subclasses Property List File Property List Dataset Property List Transfer PList Storage PList Access PList Creation PList
Dataspace Class Dataspace Class Hard Link 0…* 1 Transient Dataspace Class
Dataspace Class Dataspace Class _______________________________ rank current_size maximum_size _______________________________ create/create_simple open/close/lock is_simple copy extent_class extent_copy set_extent_simple set_extent_none get_simple_extent_npoints/ndims/dims Dataspace Extent General operations Extent operations
Transient Dataspace Class Dataspace Class ______________ selection ______________ select_elements select_none select_hyperslab select_valid offset_simple ………………... Dataspace Selection Set and modify selections
Datatype Class and Subclasses Datatype Class Compound Enumeration Atomic Variable Length Array
Datatype Class Datatype Class ______________ ______________ copy equal close convert get_class get_size
Atomic Datatype Class and Subclasses Atomic Datatype Class Predefined Atomic Userdefined Atomic H5Tcopy 1 0…* LinkClass
Predefined Atomic Datatype Class Predefined Atomic Datatype Class String Time Integer Float Opaque Reference Bitfield Object Reference Region Reference
Examples of Predefined Atomic Datatype Predefined Atomic Datatype _______________________ name = H5T_arch_base _______________________ H5T_IEEE_F64LEEight-byte little-endian, IEEE floating-point H5T_STD_U16BE Two-byte big-endian, unsigned integer H5T_C_S1 One-byte null-terminated string of eight-bit characters H5T_CRAY_F64 Eight-byte Cray floating point H5T_STD_ROBJ Reference to entire object in a file H5T_NATIVE_LONG long
Compound Datatype Class Compound Datatype Class typedef struct { int a; float b; my_type c[10]; } compound_t 1…* Datatype Class
Enumeration Datatype Class Enumeration Datatype 1 Datatype Class 1…* RED 0 GREEN 1 BLUE 2 ( string, value of type Datatype ) Only Integer datatype for now
Variable Length Datatype Class 1 Variable Length Datatype Class Datatype Class 1 2 3 4 5 A C RED GREEN BLUE
Reading Dataset into Memory from File File Memory 2D array of integers 3D array of floats
File Copy of File Dataspace _______________________ Selection Dataset Dataset Xfer Prp List Dataspace H5Dread ( ) Data Buffer Datatype Memory Dataspace ___________________ Selection Memory Datatype Reading Dataset into Memory from File Memory 2D array with selected rectangle I/O hint floats 3D array with selected union of cubes