# Werner Benger Center for Computation & Technology Louisiana State University 1LCI 2010 F5 Tutorial.

## Presentation on theme: "Werner Benger Center for Computation & Technology Louisiana State University 1LCI 2010 F5 Tutorial."— Presentation transcript:

Werner Benger Center for Computation & Technology Louisiana State University 1LCI 2010 F5 Tutorial

Data Model Motivation  Often as hard to communicate as technical issues  People often don’t see the point  Hard to convince people working within a closed application context about necessity of a semantic layer: “just write the data somehow” “just create a compatible data reader” 2LCI 2010 F5 Tutorial

Example: “Uniform Grid”  Is an precise mathematical concept: A data box with points uniformly distributed in some coordinate space Basically a multidimensional data array with bounding box information  Occurs in many applications: Simulation programs Visualization programs 3LCI 2010 F5 Tutorial

Modeling a Uniform Grid  Problem: every person implementing the concept of a “uniform grid” implements it differently  Uniform grid written by application A is almost certainly incompatible to the layout expected by some application B  Not a problem within application A’s context, but problematic when exchanging data with application B  are we sure we never want such data exchange? 4LCI 2010 F5 Tutorial

The n 2 problem  Equip application B with interface for A?  Or application A with B interface?  Then what with application C, D, E,…?  Problem is an n 2 effort   Common data model counts in the long term, even if short term overhead 5LCI 2010 F5 Tutorial

Custom-made HDF5 6LCI 2010 F5 Tutorial

The n 2 problem Application X can read HDF5 written by application Y But can it also understand it?? “application X can read HDF5” “which HDF5?” 7LCI 2010 F5 Tutorial

Ideally: Unified layer ? Cactus PUGH OpenDXAmiraVTK Cactus Carpet 8LCI 2010 F5 Tutorial

Data Format vs. Data Model  HDF5 does not solve the problem:  HDF5 is an container for multidimensional arrays with attributes ○ Keeps away the burden of low-level I/O ○ But does not uniquely specify how to formulate the concept of a “uniform grid” ○ Many alternatives possible, each of them equally appropriate for a certain problem 9LCI 2010 F5 Tutorial

HDF5 vs. F5  HDF5 is a container for multidimensional arrays, but leaves semantics of data open (“local” information, low-level description): ○ Have an array of 200x200x200 single-precision floats ○ This dataset has an attribute named “time”  F5 provides means to describe relationships among data sets (arrays), (“global” information, high-level description) on top of HDF5 ○ Have the evolution of a vertex-centered velocity vector field on a uniform grid in Cartesian coordinates ○ Have a scalar field on a surface (e.g. Gaussian curvature on curved surfaces) 10LCI 2010 F5 Tutorial

Concept of the “F5”  F5 data model approach: Select and specify the only unique way of modeling that is most compatible within similar formulations within a larger context, e.g. “regular grids”, “curvilinear grids”, … Not necessarily the most straightforward modeling for a specific problem, but only gradual increase of complexity for closely related problem Not a list of myriads of independent cases – similar cases are modeled similarly Inspired by mathematical concept of fiber bundles 11LCI 2010 F5 Tutorial

What is a “fiber bundle”?  Short: a space E that can be written as the product of a base space B and a fiber space F, e.g. E = B × F (trivial bundle) base space fiber space at each point of base space 12LCI 2010 F5 Tutorial

Gains of fiber bundle model  Operations on the fiber space can be performed independent from the base space ○ Vector operations on vector bundles: adding fields, subtracting fields, … ○ Data conversions and transformations, …  Operations on the base space independent from fiber space ○ Selecting subsets, cropping and merging regions… ○ Topological relations among points, … 13LCI 2010 F5 Tutorial

F5 concepts  Nested fiber bundles: Parameter space fiber bundle Fiber bundle on discrete points Fiber bundle on cells Fiber bundle on cell complexes  Support for multiple representations (redundant, but not trivial reproduction)  “Relative” information 14LCI 2010 F5 Tutorial

Organizational Structure  F5 uses HDF5 grouping capabilities organize objects of equal properties Allows to iterate over groups of datasets Allows to identify important information More independence from naming conventions  Information content per File all required information can be contained in a single HDF5 file data can also be spread among multiple files and uniquely merged file split possible on adjustable granularity One or many simulations per file 15LCI 2010 F5 Tutorial

F5 Hierarchy  HDF5: Hierarchical Data Format  HDF5 Formulation involves five hierarchy levels (groups): ○ Time slices group (generalized: parameter slices) ○ Grid group ○ Topology group ○ Representation group ○ Field group (with optional substructure) /Time/Grid/Topology/Representation/Field/(fragment)/(components) 16LCI 2010 F5 Tutorial

F5 Hierarchy Levels  Only two levels visible to end-user: “grid group” and “field group” /Time/Grid/Topology/Representation/Field/  Substructure (fragment)/(components) is internal Might be implemented in low-level HDF5 HDF5 might change, F5 API will not 17LCI 2010 F5 Tutorial

Time Group /Time/Grid/Topology/Representation/Field/  Contains time attribute (textual name not used), groups all information that refers to this physical time  NO integer timestep!  Data synchronization by physical time  Compare different simulations ○ Exploring parameter space, e.g. weak and strong brill waves ○ T=10M is 100 iteration steps on one run, but 150 iterations in another run. ○ Data features and evolution data  Non-equidistant time steps  Generalization: multidimensional parameter space 18LCI 2010 F5 Tutorial

Grid Group /Time/Grid/Topology/Representation/Field/  Denotes a geometrical entity at a certain time step (static information)  Freely selectable name  Information beyond Grid group is related  Arbitrary number of Grid groups per time  Optional integer timestep 19LCI 2010 F5 Tutorial

F5 “Grid” group  A geometrical entity at a certain point within a parameter space, e.g. a uniform grid at t=10.0  Fibers over a parameter space  Is the base space of multiple fibers describing its properties “topology” groups, e.g. Vertices, edges, faces, cells 20LCI 2010 F5 Tutorial

Grid properties Describe Grid as a set of points with neighbourhood information positional information for each coordinate system data values for fields per coordinate system multiple charts, supporting coordinate transformations Derived information: connectivity edges, faces,... 21LCI 2010 F5 Tutorial

Topology Group /Time/Grid/Topology/Representation/Field/  Denotes information on a topological component of a Grid  Internal naming scheme & attributes Vertices, cells, edges, faces Refinement levels Invisible to end-user (only via parameters)  Data below Topology group MUST be of same data space (number of elements) 22LCI 2010 F5 Tutorial

Representation Group /Time/Grid/Topology/Representation/Field/  Denotes information related to a topological entity Relative to a chart (coordinate expressions) Relative to another Topology group ○ Spacelike: refinement information ○ Timelike: evolution information (splitup/merge)  Naming scheme determined by relation object /CartesianChart3D/ /SphericalChart2D/ /VertexLevel0/ 23LCI 2010 F5 Tutorial

Field Group /Time/Grid/Topology/Representation/Field/  Contains actual or procedural data sets Type information: scalar, vector, tensor, covector Positional information ○ Coordinate locations, vertices per cell, edges per cell, …  DATA sets or procedural field information: Components of compound expressions Coefficients for procedural evaluation Partially covered data sets (Fragments) 24LCI 2010 F5 Tutorial

Information provided by F5  Field type, e.g. vector, covector, … no need to guess what the application has done directly specifiable in the file format  Coordinate system information, memory order (C-arrays, Fortran-arrays),…  Versioning information Enables reading old files (ensured backward compatibility) May also mix older and newer versions in same file 25LCI 2010 F5 Tutorial

Grid Types under Consideration ● Point Sets ● Unstructured Cell Data ● Tetrahedral Grids ● Regular Grids ● Uniform Grids ● Uniform Cartesian Grids ● Uniform Polar Grids ● Triangular Surfaces ● Quad-based Surfaces ● Irregular Surfaces ● Hierarchical Grids (AMR) ● Streamlines, Particle Trajectories, Geodesics ● Apparent Horizons ● Embedding Surfaces 26LCI 2010 F5 Tutorial

Practice: Using F5  Currently source code is hosted at http://f5.origo.ethz.ch/ International/Swiss version of sourgeforge F5 originally stems from a Germany-based project at the Max-Planck Institute for Gravitational Physics (Albert- Einstein Institute Potsdam)  Need SVN client software http://subversion.apache.org/ http://subversion.apache.org/  F5 checkout (complete, w. HDF5 & examples) svn co https://svn.origo.ethz.ch/f5/apps/ https://svn.origo.ethz.ch/f5/apps/ 27LCI 2010 F5 Tutorial

Compiling F5  No “configure” required, just checkout & compile ~:\$ svn co https://svn.origo.ethz.ch/f5/apps/ https://svn.origo.ethz.ch/f5/apps/ ~:\$ cd apps apps:\$ make apps:\$ make[1]: Leaving directory `…/apps/tools' The Fiber Bundle HDF5 Library has been built successfully. apps:\$ … lots of stuff happens… 28LCI 2010 F5 Tutorial

Directory Structure bin/ executables, add this to your \$PATH converters/ file converter source code examples/ examples source code F5/ the F5 library GNUmakefile.rules part of the make system hdf5-src/ snapshot of HDF5 library lib/ shared libraries make/ part of the make system Makefile main make file obj/ temporary files used for compilation SVNLINKS SVN internal file tools/ tools for F5 zlib123/ snapshot of the zlib library 29LCI 2010 F5 Tutorial

Example: Galaxy Collision 30LCI 2010 F5 Tutorial

Example: Galaxy Collision 31LCI 2010 F5 Tutorial

Example: Galaxy Collision Set up a collection of “particles” Radial distribution around a mass center Mass center For Intruder galaxy 32LCI 2010 F5 Tutorial

Example: Galaxy Collision Set up particles in “orbit” around galaxy center All velocities are Tangential High velocity in the Center (Kepler rotation) Slow momentum For intruder galaxy “shooting” to target galaxy 33LCI 2010 F5 Tutorial

Coding the Galaxy Collision main() { #define N 511 F5_vec3_point_t P[N]; F5_vec3_float_t V[N]; F5_vec3_float_t A[N]; float mass[N], weirdness[N]; for(i=2;i { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/13/4158332/slides/slide_34.jpg", "name": "Coding the Galaxy Collision main() { #define N 511 F5_vec3_point_t P[N]; F5_vec3_float_t V[N]; F5_vec3_float_t A[N]; float mass[N], weirdness[N]; for(i=2;i

Output: “Particle System” ~ \$ cd apps/examples/Particles ~/apps/examples/Particles \$ make mkdir -p /home/apps/obj/arch-Linuxx86_64-Debug.el5/Particles gcc -I/home/apps -I/home/apps/lib/arch-Linuxx86_64-Debug.el5 -DWITH_hdf5 - I/home/apps/hdf5-src -DWITH_zlib123 "-I/home/l/apps/zlib123/" -MD -shared -fPIC - DHAVE_LIBS_H -DFORTRAN_UNDERLINE -fPIC -ggdb -c /home//apps/examples/Particles/Particles.c -o Particles.o rm -f /home/apps/bin/arch-Linuxx86_64-Debug.el5/Particles unset MAKEFLAGS; g++ Particles.o -L/home/apps/lib/arch-Linuxx86_64-Debug.el5 - L/home/apps/lib/arch-Linuxx86_64-Debug.el5 -o /home/apps/bin/arch-Linuxx86_64- Debug.el5/Particles -lF5 -lhdf5 -lpthread -lzlib123 -lF5 -lhdf5 -lpthread -lzlib123 -lstdc++ Type 'make exec' to execute shared binary Particles 35LCI 2010 F5 Tutorial

Output: “Particle System” ~/apps/examples/Particles \$ make exec make[1]: Nothing to be done for `vpath_Particles-bin'. Type 'make exec' to execute shared binary Particles /home/apps/bin/arch-Linuxx86_64-Debug.el5/Particles /home/apps/bin//Particles ~/apps/examples/Particles \$ ls -l total 24M -rw-r--r-- 1 werner internalusers 149 Feb 25 08:22 Makefile -rw-r--r-- 1 werner internalusers 3.2K Feb 25 08:22 Particles.c -rw-r--r-- 1 werner internalusers 4.3K Feb 25 08:22 Particles.dsp -rw-r--r-- 1 werner internalusers 24M Feb 25 09:03 Particles.f5 ~/apps/examples/Particles \$ 36LCI 2010 F5 Tutorial

Inspecting the File ~/apps/examples/Particles \$ h5ls Particles.f5 Charts Group TableOfContents Group t=000000000.0000000000 Group t=000000000.0100000000 Group t=000000000.0200000000 Group t=000000000.0300000000 Group t=000000000.0400000000 Group t=000000000.0500000000 Group t=000000000.0600000000 Group t=000000000.0700000000 Group t=000000000.0800000000 Group t=000000000.0900000000 Group t=000000000.1000000000 Group 37LCI 2010 F5 Tutorial

Inspecting 1 st Time Slice ~/apps/examples/Particles \$ h5ls –r Particles.f5/t=000000000.0000000000 /t=000000000.0000000000/GalaxyStars Group /t=000000000.0000000000/GalaxyStars/Charts Group /t=000000000.0000000000/GalaxyStars/Charts/StandardCartesianChart3D Group /t=000000000.0000000000/GalaxyStars/Charts/StandardCartesianChart3D/GlobalChart -> /Charts/Cartesian3D/StandardCartesianChart3D /t=000000000.0000000000/GalaxyStars/Points Group /t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D Group /t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Acceleration Dataset {511} /t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Positions Dataset {511} /t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Velocity Dataset {511} /t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/mass Dataset {511} /t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/weirdness Dataset {511} /Time / Grid / Topology / Coord / Field 38LCI 2010 F5 Tutorial

Inspecting the File’s Fields \$ h5ls -rv Particles.f5/t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Positions Opened "Particles.f5" with sec2 driver. /t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Positions Dataset {511/511} Attribute: TypeInfo scalar Type: shared-0:1:0:19496 enum native int { UnknownArrayType = 0 Contiguous = 1 SeparatedCompound = 2 Constant = 3 FragmentedContiguous = 4 FragmentedSeparatedCompound = 5 DirectProduct = 6 IndexPermutation = 7 UniformSampling = 8 FragmentedUniformSampling = 9 } Data: Contiguous Location: 0:1:0:19968 Links: 1 Modified: 2010-02-25 10:13:14 CST Comment: "Contiguous" Storage: 6132 logical bytes, 6132 allocated bytes, 100.00% utilization Type: shared-0:1:0:15464 struct { "x" +0 native float "y" +4 native float "z" +8 native float } 12 bytes Type: struct { float x,y,z; }; 39LCI 2010 F5 Tutorial

Named Datatypes \$ h5ls -rv Particles.f5/t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Positions Opened "Particles.f5" with sec2 driver. /t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Positions Dataset {511/511} Attribute: TypeInfo scalar Type: shared-0:1:0:19496 enum native int { UnknownArrayType = 0 Contiguous = 1 SeparatedCompound = 2 Constant = 3 FragmentedContiguous = 4 FragmentedSeparatedCompound = 5 DirectProduct = 6 IndexPermutation = 7 UniformSampling = 8 FragmentedUniformSampling = 9 } Data: Contiguous Location: 0:1:0:19968 Links: 1 Modified: 2010-02-25 10:13:14 CST Comment: "Contiguous" Storage: 6132 logical bytes, 6132 allocated bytes, 100.00% utilization Type: shared-0:1:0:15464 struct { "x" +0 native float "y" +4 native float "z" +8 native float } 12 bytes Type attributes shared among all datasets e.g. coordinate system 40LCI 2010 F5 Tutorial

Inspecting the File’s Field Data \$ h5ls -d Particles.f5/t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Positions t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Positions Dataset {511} Data: (0) {-0.002, -0.002, 9.995}, {0, 0, 1e-06}, {0.0509902, 0.136946, 9.99645e-07}, {0.0926937, 0.11297, 9.99645e-07}, {0.124352, 0.0767509, 9.99645e-07}, {0.142536, 0.0322152, 9.99645e-07}, (6) {0.145273, -0.0158116, 9.99645e-07}, {0.132268, -0.062125, 9.99645e-07}, {0.104929, -0.101706, 9.99645e-07}, {0.0662198, - 0.130266, 9.99645e-07}, {0.0203346, -0.144709, 9.99645e-07}, (11) {-0.0277542, -0.143471, 9.99645e-07}, {-0.0728353, -0.126686, 9.99645e-07}, {-0.110024, -0.0961719, 9.99645e-07}, {-0.135289, - 0.0552364, 9.99645e-07}, {-0.145894, -0.00831518, 9.99645e-07}, (16) {-0.140689, 0.0395071, 9.99645e-07}, {-0.120238, 0.0830482, 9.99645e-07}, {-0.0867577, 0.11759, 9.99645e-07}, {-0.0438756, 0.139389, 9.99645e-07}, {0.00376106, 0.146083, 9.99645e-07}, (21) {0.0360555, 0.303467, 9.98582e-07}, {0.132638, 0.275317, 9.98582e-07}, {0.214846, 0.217333, 9.98582e-07}, {0.273773, 0.135796, 9.98582e-07}, {0.303032, 0.0395446, 9.98582e-07}, (26) {0.299453, -0.0609925, 9.98582e-07}, {0.263424, -0.15492, 9.98582e-07}, {0.198848, -0.23206, 9.98582e-07}, {0.112725, - 0.284052, 9.98582e-07}, {0.0143853, -0.305263, 9.98582e-07}, (31) {-0.0855128, -0.293394, 9.98582e-07}, {-0.176144, -0.249731, 9.98582e-07}, {-0.247688, -0.179006, 9.98582e-07}, {-0.292391, - 0.0888827, 9.98582e-07}, {-0.305408, 0.0108722, 9.98582e-07}, (36) {-0.28533, 0.109449, 9.98582e-07}, {-0.234332, 0.196165, 9.98582e-07}, {-0.157941, 0.261624, 9.98582e-07}, {-0.0644337, 0.298732, 9.98582e-07}, {0.0294392, 0.459661, 9.96813e-07}, 41LCI 2010 F5 Tutorial

Inspecting the File’s Field Data \$ h5ls -d Particles.f5/t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Positions t=000000000.0000000000/GalaxyStars/Points/StandardCartesianChart3D/Positions Dataset {511} Data: (0) {-0.002, -0.002, 9.995}, {0, 0, 1e-06}, {0.0509902, 0.136946, 9.99645e-07}, {0.0926937, 0.11297, 9.99645e-07}, {0.124352, 0.0767509, 9.99645e-07}, {0.142536, 0.0322152, 9.99645e-07}, (6) {0.145273, -0.0158116, 9.99645e-07}, {0.132268, -0.062125, 9.99645e-07}, {0.104929, -0.101706, 9.99645e-07}, {0.0662198, -0.130266, 9.99645e-07}, {0.0203346, -0.144709, 9.99645e-07}, (11) {-0.0277542, -0.143471, 9.99645e-07}, {-0.0728353, -0.126686, 9.99645e-07}, {-0.110024, -0.0961719, 9.99645e-07}, {-0.135289, -0.0552364, 9.99645e-07}, {-0.145894, -0.00831518, 9.99645e-07}, (16) {-0.140689, 0.0395071, 9.99645e-07}, {-0.120238, 0.0830482, 9.99645e-07}, {-0.0867577, 0.11759, 9.99645e-07}, {-0.0438756, 0.139389, 9.99645e-07}, {0.00376106, 0.146083, 9.99645e-07}, (21) {0.0360555, 0.303467, 9.98582e-07}, {0.132638, 0.275317, 9.98582e-07}, {0.214846, 0.217333, 9.98582e-07}, {0.273773, 0.135796, 9.98582e-07}, {0.303032, 0.0395446, 9.98582e-07}, (26) {0.299453, -0.0609925, 9.98582e-07}, {0.263424, -0.15492, 9.98582e-07}, {0.198848, -0.23206, 9.98582e-07}, {0.112725, -0.284052, 9.98582e-07}, {0.0143853, -0.305263, 9.98582e-07}, (31) {-0.0855128, -0.293394, 9.98582e-07}, {-0.176144, -0.249731, 9.98582e-07}, {-0.247688, -0.179006, 9.98582e-07}, {-0.292391, -0.0888827, 9.98582e-07}, {-0.305408, 0.0108722, 9.98582e-07}, (36) {-0.28533, 0.109449, 9.98582e-07}, {-0.234332, 0.196165, 9.98582e-07}, {-0.157941, 0.261624, 9.98582e-07}, {-0.0644337, 0.298732, 9.98582e-07}, {0.0294392, 0.459661, 9.96813e-07}, 42LCI 2010 F5 Tutorial

Animation 43LCI 2010 F5 Tutorial

F5ls – list F5 semantics F5ls Particles.f5 ----------- [Particles.f5] -------------- ******* Timeslice for t=0 ******* Grid `GalaxyStars' (no timestep information) Root level vertex fields: Acceleration : Contiguous Size: 511 vector (32bit) Positions : Contiguous Size: 511 cartesian coordinates [float] (no range) Velocity : Contiguous Size: 511 vector (32bit) mass : Contiguous Size: 511 scalar (float) weirdness : Contiguous Size: 511 scalar (float) ******* Timeslice for t=0.01 ******* Grid `GalaxyStars' (no timestep information) Root level vertex fields: Acceleration : Contiguous Size: 511 vector (32bit) Positions : Contiguous Size: 511 cartesian coordinates [float] (no range) Velocity : Contiguous Size: 511 vector (32bit) mass : Contiguous Size: 511 scalar (float) weirdness : Contiguous Size: 511 scalar (float) ******* Timeslice for t=0.02 ******* make –C ~/apps/tools/F5ls/ 44LCI 2010 F5 Tutorial

2 nd Example: Uniform Grid „Data Cube“ 45LCI 2010 F5 Tutorial

2 nd Example: Uniform Grid „Data Cube“ Time-dependent? Same cube, Many fields? 46LCI 2010 F5 Tutorial

Coding the Uniform Grid, I main() { int NumOfDataValues = NumOfDataValuesX*NumOfDataValuesY*NumOfDataValuesZ; hid_t FileID, DataID; /* HDF5-Identifiers for opened File and opened DataSet */ hsize_t dims[3]; /* Number of Values in each dimension */ F5_vec3_point_t Origin; /* Starting Point of the Volume */ F5_vec3_float_t Delta; /* Stepsize between two Points on the Grid */ F5Path *fpath; float ScalarData[NumOfDataValuesX*NumOfDataValuesY*NumOfDataValuesZ]; /* Init Data */ /* Create the File */ FileID = H5Fcreate(FileName, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); main() { int NumOfDataValues = NumOfDataValuesX*NumOfDataValuesY*NumOfDataValuesZ; hid_t FileID, DataID; /* HDF5-Identifiers for opened File and opened DataSet */ hsize_t dims[3]; /* Number of Values in each dimension */ F5_vec3_point_t Origin; /* Starting Point of the Volume */ F5_vec3_float_t Delta; /* Stepsize between two Points on the Grid */ F5Path *fpath; float ScalarData[NumOfDataValuesX*NumOfDataValuesY*NumOfDataValuesZ]; /* Init Data */ /* Create the File */ FileID = H5Fcreate(FileName, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); 47LCI 2010 F5 Tutorial

Coding the Uniform Grid, II fpath = F5Fwrite_uniform_cartesian3D( FileID, /* File identifier given by HDF5 */ 3.141592, /* Time Value of the field */ "SimpleScalar", /* Name of the Grid */ &Origin, /* Starting Point of the Volume */ &Delta, /* Spacing between Grid points */ dims, /* Number of Values in each direction */ "TestField", /* Name of the Field */ H5T_NATIVE_FLOAT, /* Type of the Values in the Field */ ScalarData, /* Pointer to the Data */ NULL, /* Coordinate System (default) */ F5P_DEFAULT); /* Default dataset properties */ F5close(fpath); H5Fclose(FileID); fpath = F5Fwrite_uniform_cartesian3D( FileID, /* File identifier given by HDF5 */ 3.141592, /* Time Value of the field */ "SimpleScalar", /* Name of the Grid */ &Origin, /* Starting Point of the Volume */ &Delta, /* Spacing between Grid points */ dims, /* Number of Values in each direction */ "TestField", /* Name of the Field */ H5T_NATIVE_FLOAT, /* Type of the Values in the Field */ ScalarData, /* Pointer to the Data */ NULL, /* Coordinate System (default) */ F5P_DEFAULT); /* Default dataset properties */ F5close(fpath); H5Fclose(FileID); 48LCI 2010 F5 Tutorial

Run: “Uniform Grid” ~ \$ cd apps/examples/ScalarSimple ~/apps/examples/ScalarSimple \$ make … … … Type 'make exec' to execute shared binary ScalarSimple /home/apps/bin/arch-xxxx-Debug/ScalarSimple ~/apps/examples/ScalarSimple \$ make exec make[1]: Nothing to be done for `vpath_ScalarSimple-bin'. Type 'make exec' to execute shared binary ScalarSimple /home/apps/bin/arch-msys-Debug/ScalarSimple /home/apps/bin//ScalarSimple 49LCI 2010 F5 Tutorial

Output: “Uniform Grid” apps/examples/ScalarSimple \$ ls -l -rw-r--r-- 1 werner 24824 Feb 26 15:36 CellScalar.f5 -rw-r--r-- 1 werner 184 Feb 25 08:22 Makefile -rw-r--r-- 1 werner 12930192 Feb 26 15:36 ManyGridMultiScalar.f5 -rw-r--r-- 1 werner 4330832 Feb 26 15:36 MultiScalar.f5 -rw-r--r-- 1 werner 16322 Feb 25 08:22 ScalarSimple.c -rw-r--r-- 1 werner 4802 Feb 25 08:22 ScalarSimple.dsp -rw-r--r-- 1 werner 153328 Feb 26 15:36 StaticScalar.f5 -rw-r--r-- 1 werner 1526600 Feb 26 15:36 TimeDependentScalar.f5 50LCI 2010 F5 Tutorial

Content: “Uniform Grid” apps/examples/ScalarSimple \$ h5ls StaticScalar.f5 Charts Group TableOfContents Group t=000000003.1415920000 Group apps/examples/ScalarSimple \$ h5ls -r StaticScalar.f5/t=000000003.1415920000 /t=000000003.1415920000/SimpleScalar Group /t=000000003.1415920000/SimpleScalar/Charts Group /t=000000003.1415920000/SimpleScalar/Charts/StandardCartesianChart3D Group /t=000000003.1415920000/SimpleScalar/Charts/StandardCartesianChart3D/GlobalChart -> /Charts/Cartesian3D/StandardCartesianChart3D /t=000000003.1415920000/SimpleScalar/Fields Group /t=000000003.1415920000/SimpleScalar/Fields/Positions Group /t=000000003.1415920000/SimpleScalar/Points Group /t=000000003.1415920000/SimpleScalar/Points/StandardCartesianChart3D Group /t=000000003.1415920000/SimpleScalar/Points/StandardCartesianChart3D/Positions Group /t=000000003.1415920000/SimpleScalar/Points/StandardCartesianChart3D/TestField Dataset {30, 20, 53} 51LCI 2010 F5 Tutorial

Positions: “Uniform Grid” apps/examples/ScalarSimple \$ \$ h5ls -vr StaticScalar.f5/t=000000003.1415920000/SimpleScalar/Points/StandardCartesianChart3D Opened "StaticScalar.f5" with sec2 driver. /t=000000003.1415920000/SimpleScalar/Points/StandardCartesianChart3D/Positions Group Attribute: DataspaceDims {3} Type: native int Data: 30, 20, 53 Attribute: base scalar Type: shared-0:1:0:15464 struct { "x" +0 native float "y" +4 native float "z" +8 native float } 12 bytes Data: {-1, -1, -1} Attribute: delta scalar Type: shared-0:1:0:15464 struct { "x" +0 native float "y" +4 native float "z" +8 native float } 12 bytes Data: {0.0377358, 0.1, 0.0666667} Type: struct { float x,y,z; }; Resolution Bounding Box origin Cell size 52LCI 2010 F5 Tutorial

Positions: “Uniform Grid” apps/examples/ScalarSimple \$ \$ h5ls -vr StaticScalar.f5/t=000000003.1415920000/SimpleScalar/Points/StandardCartesianChart3 D/TestField Dataset {30/30, 20/20, 53/53} Attribute: TypeInfo scalar Type: shared-0:1:0:19496 enum native int { UnknownArrayType = 0 Contiguous = 1 SeparatedCompound = 2 Constant = 3 FragmentedContiguous = 4 FragmentedSeparatedCompound = 5 DirectProduct = 6 IndexPermutation = 7 UniformSampling = 8 FragmentedUniformSampling = 9 } Data: Contiguous 53LCI 2010 F5 Tutorial

Positions: “Uniform Grid” apps/examples/ScalarSimple \$ \$../../bin/F5ls StaticScalar.f5 ----------- [StaticScalar.f5] -------------- ******* Timeslice for t=3.14159 ******* Grid `SimpleScalar' (no timestep information) Root level vertex fields: Positions : UniformSampling Size: 53x20x30 cartesian coordinates Range: [-1,-1,-1]-[0.962264,0.9,0.933333] TestField : Contiguous Size: 53x20x30 scalar (float) 54LCI 2010 F5 Tutorial

More Layout examples: a Uniform Grid  Information available: Data at time T=0.0 grid name selected as “minkowski” data defined on vertices Using default cartesian coordinates /T=0/minkowski/Points/StandardCartesianChart3D/* 55LCI 2010 F5 Tutorial

Constructing a Uniform Grid, II  Bounding box information is stored as procedural field called “Positions” Contains min/max information, or base and delta /T=0/minkowski/Points/StandardCartesianChart3D/Positions 56LCI 2010 F5 Tutorial

Constructing a Uniform Grid, III  Defining a scalar field: /T=0/minkowski/Points/StandardCartesianChart3D/ADMBASE::LAPSE Dataset {43, 37, 19}  Defining a vector field: Optional field of struct or struct of fields /T=0/minkowski/Points/StandardCartesianChart3D/STATICCONFORMAL::CONFAC_1DERIVS Group /T=0/minkowski/Points/StandardCartesianChart3D/STATICCONFORMAL::CONFAC_1DERIVS/Dx Dataset {43, 37, 19} /T=0/minkowski/Points/StandardCartesianChart3D/STATICCONFORMAL::CONFAC_1DERIVS/Dy Dataset {43, 37, 19} /T=0/minkowski/Points/StandardCartesianChart3D/STATICCONFORMAL::CONFAC_1DERIVS/Dz Dataset {43, 37, 19} 57LCI 2010 F5 Tutorial

F5 API Demo: static scalar F5Path*fpath; Hid_t FileID; FileID = H5Fcreate(“Filename.f5”, H5F_ACC_TRUNC, /* Creation Flags */ H5P_DEFAULT, /* File creation property list identifier */ H5P_DEFAULT); /* File access property list identifier */ /* Write the Data */ fpath = F5Fwrite_uniform_cartesian3D(FileID, /* File identifier given by HDF5 */ 3.141592, /* Time Value of the field */ "SimpleScalar", /* Name of the Grid */ &Origin, /* Starting Point of the Volume */ &Delta, /* Spacing between Grid points */ dims, /* Number of Values in each direction */ "TestField", /* Name of the Field */ H5T_NATIVE_FLOAT, /* Type of the Values in the Field */ ScalarData, /* Pointer to the Data */ NULL, /* Coordinate System - We use a standard chart here. */ F5P_DEFAULT); /* Default dataset properties */ F5close(fpath); /* Close the DataSet */ /* Close the File */ H5Fclose(FileID); 58LCI 2010 F5 Tutorial

F5 API Demo: dynamic scalar /* Step through the Time */ for(j=0;j { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/13/4158332/slides/slide_59.jpg", "name": "F5 API Demo: dynamic scalar /* Step through the Time */ for(j=0;j

F5 API demo: many fields F5write_uniform_cartesian3Dv(FileID, /* File identifier given by HDF5 */ Time, /* Time Value of the field */ "TimeScalar", /* Name of the Grid */ &Origin, /* Starting Point of the Volume */ &Delta, /* Spacing between Grid points */ dims, /* Number of Values in each direction */ NULL, /* Coordinate System - We use a standard chart here. */ F5P_DEFAULT, /* Default dataset properties */ "TestField", /* Name of the first Field */ H5T_NATIVE_FLOAT, /* Type of the Values in the Field */ ScalarData, /* Pointer to the Data */ "TestField2", /* Name of the second Field */ H5T_NATIVE_DOUBLE, /* Type of the Values in the Field */ ScalarData2, /* Pointer to the Data */ NULL, /* To end the List of Fields */ H5T_NATIVE_DOUBLE, /* Whatever - does not matter */ NULL /* To end the List of Fields */ ); 60LCI 2010 F5 Tutorial

Example: Uniform Grid with many fields (h5ls) H5ls minkowski-0000.f5 Charts Group T=0 Group T=0.119047619047619041010577234374 Group T=0.238095238095238193043456931264 Group T=0.357142857142857372831912243782 Group T=0.476190476190476552620367556301 Group T=0.595238095238095232808461787499 Group TableOfContents Group Note: actual time information is specified as float attribute, not via group names. 61LCI 2010 F5 Tutorial

F5ls (data semantics) F5ls minkowski-0000.f5 minkowski-0060.f5 minkowski-0120.f5 minkowski-0180.f5 ******* Timeslice for t=0 ******* Grid `minkowski', showing vertex fields: ADMBASE::CURV : SeparatedCompound 43x37x19 metric tensor ADMBASE::LAPSE : Contigous 43x37x19 scalar ADMBASE::METRIC : SeparatedCompound 43x37x19 metric tensor Positions : UniformSampling 43x37x19 cartesian coordinates [-0.5,-0.5,- 0.5]-[0.5,0.5,0.5] STATICCONFORMAL::CONFAC : Contigous 43x37x19 scalar STATICCONFORMAL::CONFAC_1DERIVS : SeparatedCompound 43x37x19 vector STATICCONFORMAL::CONFAC_2DERIVS : SeparatedCompound 43x37x19 metric tensor ******* Timeslice for t=0.119048 ******* Grid `minkowski', showing vertex fields: ADMBASE::CURV : SeparatedCompound 43x37x19 metric tensor ADMBASE::LAPSE : Contigous 43x37x19 scalar ADMBASE::METRIC : SeparatedCompound 43x37x19 metric tensor Positions : UniformSampling 43x37x19 cartesian coordinates [-0.5,-0.5,- 0.5]-[0.5,0.5,0.5] STATICCONFORMAL::CONFAC : Contigous 43x37x19 scalar STATICCONFORMAL::CONFAC_1DERIVS : SeparatedCompound 43x37x19 vector STATICCONFORMAL::CONFAC_2DERIVS : SeparatedCompound 43x37x19 metric tensor 63LCI 2010 F5 Tutorial

Storing fragmented data on Uniform Grid  Information available: Data at time T=0.0 grid name selected as “minkowski” data defined on vertices Using default Cartesian coordinates Data are not contiguous but exists in many fragments – internal structure of fields /T=0/minkowski/Points/StandardCartesianChart3D/*/? 64LCI 2010 F5 Tutorial

Constructing fragmented field on Uniform Grid, II  Fields are not data sets, but a group containing data sets, each a fragment /T=0/minkowski/Points/StandardCartesianChart3D/ADMBASE::LAPSE Group /T=0/minkowski/Points/StandardCartesianChart3D/ADMBASE::LAPSE/box0 Dataset {10, 37, 19} /T=0/minkowski/Points/StandardCartesianChart3D/ADMBASE::LAPSE/box1 Dataset {10, 37, 19} /T=0/minkowski/Points/StandardCartesianChart3D/ADMBASE::LAPSE/box2 Dataset {10, 37, 19} /T=0/minkowski/Points/StandardCartesianChart3D/ADMBASE::LAPSE/box3 Dataset {13, 37, 19} 65LCI 2010 F5 Tutorial

Constructing fragmented field data on Uniform Grid, II  Positional information per fragment provided once in the Positions/ component /T=0/minkowski/Points/StandardCartesianChart3D/Positions Group /T=0/minkowski/Points/StandardCartesianChart3D/Positions/box0 Group w. attrib. (min,max) /T=0/minkowski/Points/StandardCartesianChart3D/Positions/box1 Group w. attrib. (min,max) /T=0/minkowski/Points/StandardCartesianChart3D/Positions/box2 Group w. attrib. (min,max) /T=0/minkowski/Points/StandardCartesianChart3D/Positions/box3 Group w. attrib. (min,max)  Constraint: all fields per representation group must be fragmented same way  Consistent layout ensured 66LCI 2010 F5 Tutorial

Example: Fragmented data on a Uniform Grid with many fields (h5ls) h5ls minkowski-0000:0000.f5 Charts Group T=0 Group T=0.119047619047619041010577234374 Group T=0.238095238095238193043456931264 Group T=0.357142857142857372831912243782 Group T=0.476190476190476552620367556301 Group T=0.595238095238095232808461787499 Group TableOfContents Group h5ls minkowski-0000:0000.f5/T=0/minkowski/Points/StandardCartesianChart3D ADMBASE::CURV Group ADMBASE::LAPSE Group ADMBASE::METRIC Group Positions Group STATICCONFORMAL::CONFAC Group STATICCONFORMAL::CONFAC_1DERIVS Group STATICCONFORMAL::CONFAC_2DERIVS Group 67LCI 2010 F5 Tutorial

Fragmented data F5ls (data semantics) F5ls minkowski-*.f5 ******* Timeslice for t=0 ******* Grid `minkowski', showing vertex fields: ADMBASE::CURV : FragmentedSeparatedCompound 43x37x19 metric tensor ADMBASE::LAPSE : FragmentedContigous 43x37x19 scalar ADMBASE::METRIC : FragmentedSeparatedCompound 43x37x19 metric tensor Positions : UniformSampling 43x37x19 cartesian coordinates [-0.5,-0.5,- 0.5]-[0.5,0.5,0.5] STATICCONFORMAL::CONFAC : FragmentedContigous 43x37x19 scalar STATICCONFORMAL::CONFAC_1DERIVS : FragmentedSeparatedCompound 43x37x19 vector STATICCONFORMAL::CONFAC_2DERIVS : FragmentedSeparatedCompound 43x37x19 metric tensor ******* Timeslice for t=0.119048 ******* Grid `minkowski', showing vertex fields: ADMBASE::CURV : FragmentedSeparatedCompound 43x37x19 metric tensor ADMBASE::LAPSE : FragmentedContigous 43x37x19 scalar ADMBASE::METRIC : FragmentedSeparatedCompound 43x37x19 metric tensor Positions : UniformSampling 43x37x19 cartesian coordinates [-0.5,-0.5,- 0.5]-[0.5,0.5,0.5] STATICCONFORMAL::CONFAC : FragmentedContigous 43x37x19 scalar STATICCONFORMAL::CONFAC_1DERIVS : FragmentedSeparatedCompound 43x37x19 vector STATICCONFORMAL::CONFAC_2DERIVS : FragmentedSeparatedCompound 43x37x19 metric tensor … 69LCI 2010 F5 Tutorial

Constructing uniform AMR  Information available: Data at time T=0.0 grid name selected as “minkowski” data defined on vertices Using default cartesian coordinates Data are available in multiple refinement levels /T=0/minkowski/Points/StandardCartesianChart3D/*/? 70LCI 2010 F5 Tutorial

Constructing uniform AMR, II  Levels specified via Topology group /T=0/minkowski/VertexLevel0/StandardCartesianChart3D/ADMBASE::LAPSE Dataset {10, 10, 10} /T=0/minkowski/VertexLevel1/StandardCartesianChart3D/ADMBASE::LAPSE Dataset {20, 20, 20} /T=0/minkowski/VertexLevel2/StandardCartesianChart3D/ADMBASE::LAPSE Dataset {40, 40, 40} /T=0/minkowski/VertexLevel3/StandardCartesianChart3D/ADMBASE::LAPSE Dataset {80, 80, 80}  Field substructure still applicable: Field may be fragmented Field fragments may be omitted Compound field may be separated into components Field may be procedural (bounding box per fragment) 71LCI 2010 F5 Tutorial

Example: AMR, Fragmented  Example in: apps/examples/FragmentedField/ Demonstrates ○ Fragmentation ○ Refinement ○ Time dependency ○ Multiple fields LCI 2010 F5 Tutorial72

F5ls FragmentedField.f5  F5ls option “-r” displays refinement LCI 2010 F5 Tutorial73 ******* Timeslice for t=0.9 ******* Grid `DemoGrid' [ 10] >> NonsenseScalar : FragmentedContiguous Size: 129x89x45 scalar (float) Positions : UniformSampling Size: 129x89x45 cartesian coordinates [float] Range: [-10,-5,-2.5]-[15.6,12.6,6.3] SensitiveVectors : FragmentedContiguous Size: 129x89x45 vector (32bit) >> NonsenseScalar : FragmentedContiguous Size: 129x89x45 scalar (float) Positions : UniformSampling Size: 129x89x45 cartesian coordinates [float] Range: [-10,-5,-2.5]-[2.8,3.8,1.9] SensitiveVectors : FragmentedContiguous Size: 129x89x45 vector (32bit) >> NonsenseScalar : FragmentedContiguous Size: 129x89x45 scalar (float) Positions : UniformSampling Size: 129x89x45 cartesian coordinates [float] Range: [-10,-5,-2.5]-[-3.6,-0.6,-0.3] SensitiveVectors : FragmentedContiguous Size: 129x89x45 vector (32bit)

Constructing multipatch data  Information available: Data at time T=0.0 grid name selected as “minkowski” data defined on vertices Using multiple coordinate systems /T=0/minkowski/Points/StandardCartesianChart3D/*/? 74LCI 2010 F5 Tutorial

Constructing multipatch data, II  Coordinate systems specified via Representation group /T=0/minkowski/Points/CartesianPatch0/ADMBASE::LAPSE Dataset {10, 10, 10} /T=0/minkowski/Points/CartesianPatch1/ADMBASE::LAPSE Dataset {10, 10, 10} /T=0/minkowski/Points/CartesianPatch2/ADMBASE::LAPSE Dataset {10, 10, 10} /T=0/minkowski/Points/StandardCartesianChart3D/ADMBASE::LAPSE Dataset {30, 30, 30}  Field & refinement substructure still applicable  Global coordinate system optional  Coordinate transformation information specified elsewhere (not shown here) 75LCI 2010 F5 Tutorial

Multipatch / Curvilinear Grid LCI 2010 F5 Tutorial76

Viz example: vectors field in curvilinear multiblock data LCI 2010 F5 Tutorial77

Features Supported by F5 (II) Extended data types ○ vector fields ○ tensor fields ○ covariant and contravariant indices ○ coordinate transformation rules for vector and tensor fields Transparent support for different field layouts ○ arrays of structs ○ struct of arrays Arbitrary dimensions ○ one-dimensional data ○ two-dimensional data (surfaces) ○ three-dimensional data (volumes) ○ higher dimensions up to HDF5 limit 78LCI 2010 F5 Tutorial

Features Supported by F5(III)  Structured and unstructured grid types particle systems triangular surfaces regular surfaces uniform grids regular grids adaptive hierarchical meshes (AMR data) curvilinear grids tetrahedral grids (n.i.) hexahedral grids (n.i.) unstructured grids (n.i.) 79LCI 2010 F5 Tutorial

Further Info http://www.fiberbundle.net 80LCI 2010 F5 Tutorial

Download ppt "Werner Benger Center for Computation & Technology Louisiana State University 1LCI 2010 F5 Tutorial."

Similar presentations