hdf5 abstract data model
DESCRIPTION
Source: http://hdfeos.org/workshops/ws03/presentations/elena.pptTRANSCRIPT
02/21/14 1
HDF5 Abstract Data Model
Classes, Objects and their relationships
http://hdf.ncsa.uiuc.edu/HDF5/ADM_EOS_Sep99/index.htm
02/21/14 2
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
02/21/14 3
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!
02/21/14 4
• 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
HDF5 File (conceptual view)
02/21/14 5
Example of an HDF5 File
File
GroupDatatype Dataset
Group Dataset
RGroup/
A B C
D E
F
GH
K
Dataset path : /B /C/D/G
02/21/14 6
Example of an HDF5 File (cont.)
File
GroupDatatype Dataset
Group
RGroup/
B C
D
Dataset
E
F
G
A
H
K
Dataset path : /B /C/D/G
02/21/14 7
Example of an HDF5 File (cont.)
File RGroup
GroupDatatype Dataset
Group
/
B C
D
F
K
Dataset path : /B
02/21/14 8
HDF5 File (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
02/21/14 9
UML Notation
Book:
UML Distilled Applying the Standard Object Modeling Language
by Martin Fowler Booch Jacobson Rumbaugh Object Technology Series
Addison-Wesley
02/21/14 10
UML Notation
Class
Class Name Class Name____________ Attribute____________
Operation
02/21/14 11
UML Notation
Association Describes connection between object instances, should be a verb.
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
1..N 0...*
Object A has object B associated with it.
Class A Class B
02/21/14 12
UML Notation
Class A
Generalization(Inheritance) “is a” relationship B is an A
Class B
02/21/14 13
UML Notation
Class A
Aggregation “a part of” relationship Objects B and C are part of object A
Class B Class C
02/21/14 14
UML Notation
Class A
Composition “a part of” relationship Objects B and C “live and die” with A
Class B Class C
02/21/14 15
HDF5 Classes
– File Class– Group Class– Dataset Class– Dataspace Class
– Datatype Class
– Named_Object Class• Group
• Dataset• Named Dataspace• Named Datatype
– User_Defined_Attribute Class
02/21/14 16
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
02/21/14 17
File Class File , Group Class and Root Link Class Association Diagram
1 1File Class Group 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.
Root Link Class1
1
File Property List Class1
0…*
02/21/14 18
File Class
______________________________________________
_
open/closecreateis_hdf5get_create_prpget_access_prpmount/unmountreopen
File and Group Classes
Group Class__________________________________________
open/closeiterateget_object_infoget_link_valueget/set_comment
02/21/14 19
Group Class
Non-Root Link Class
0…*
1
Group Class and Associated Classes
Named Object Class
0…1
1…*
Group
HDF5 object HDF5 object...
A B
C
D
02/21/14 20
Non-Root Link Class
Link Class
Soft Link Hard Link
Named Object Named Object10...1
0...* 1...*
Root Link Class
Link Class
02/21/14 21
Non-Root Link Class____________________________
name______________________link/unlinkcreatemove (rename)
Non-Root Link Class
02/21/14 22
Named_Object Class
Group Class Dataset Class Named Datatype Class Named Dataspace Class
Named_Object Class
Soft Link Class User Defined Attribute 0…* 0…*
1 0...1
Hard Link Class 1...*
1
Not implemented yet
02/21/14 23
Dataset
Storage Property List
User Defined Attribute
0…*
0...*
1
1
0...*
1...*
Hard Link Soft Link
1 Dataspace1
Datatype1
0...* 0...*
Dataset Class and associated Classes
1
02/21/14 24
Dataset Class
Dataset Class________________________
user defined attribute________________________
createopen/closewrite/readextendget_space/type/property
02/21/14 25
Attribute Class
Datatype Class Dataspace Class
Named Object Class
1
1 1
Attribute Class and associated Classes
0...*
0...* 0...*
02/21/14 26
Attribute Class
Attribute Class_________________________
name_____________________createopen/closewrite/readget_space/type/property
02/21/14 27
Property List Class and Subclasses
Property List
File Property List Dataset Property List
Creation PList Access PList Storage PList Transfer PList
02/21/14 28
Dataspace Class
Dataspace Class
Hard Link10…*
Transient Dataspace Class
02/21/14 29
Dataspace ClassDataspace Class_______________________________rankcurrent_sizemaximum_size_______________________________create/create_simpleopen/close/lockis_simplecopyextent_classextent_copyset_extent_simpleset_extent_noneget_simple_extent_npoints/ndims/dims
Extent operations
General operations
Dataspace Extent
02/21/14 30
Transient Dataspace Class
Dataspace Class______________selection______________select_elementsselect_noneselect_hyperslabselect_validoffset_simple………………...
Set and modify selections
Dataspace Selection
02/21/14 31
Datatype Class
Datatype Class and Subclasses
Atomic
Compound
Variable Length
Enumeration
Array
02/21/14 32
Datatype Class____________________________copyequalcloseconvertget_classget_size
Datatype Class
02/21/14 33
Atomic Datatype Class and Subclasses
Atomic Datatype Class
Predefined Atomic Userdefined AtomicH5Tcopy
Link Class
0…*
1
02/21/14 34
Predefined Atomic Datatype Class
Predefined Atomic Datatype Class
Reference
Object Reference Region Reference
Opaque
Time String Integer Float
Bitfield
02/21/14 35
Examples of Predefined Atomic Datatype
Predefined Atomic Datatype_______________________name = H5T_arch_base_______________________
H5T_IEEE_F64LE Eight-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
02/21/14 36
Compound Datatype Class
Compound Datatype Class
Datatype Class
1…*
typedef struct { int a; float b; my_type c[10];} compound_t
02/21/14 37
Enumeration Datatype Class
( string, value of type Datatype )
Enumeration Datatype
Only Integer datatype for now
Datatype Class
1…*RED 0GREEN 1BLUE 2
1
02/21/14 38
Variable Length Datatype Class
Variable Length Datatype Class
Datatype Class 1
A 1 2 3 4 5
RED GREEN BLUE
C
02/21/14 39
Reading Dataset into Memory from File
File Memory
2D array of integers 3D array of floats
02/21/14 40
Reading Dataset into Memory from File
Memory Dataspace___________________
Selection
Memory Datatype
Dataset Xfer Prp List
Copy of File Dataspace_______________________
Selection Dataset
Dataspace
Datatype
Data
File Memory2D array with selected rectangle
3D array with selected union of cubes
floats
H5DreadBuffer( )
I/O hint