New Features in HDF5. Why new features? September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial

Size: px
Start display at page:

Download "New Features in HDF5. Why new features? September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial"

Transcription

1 New Features in HDF5 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 1 Why new features? September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 2 1

2 Why new features? HDF was released in February 2008 Major update of HDF5 1.6.* series (stable set of features and APIs since 1998) New features 200 new APIs Changes to file format Changes to APIs Backward compatible New releases in November 2008 HDF and Minor bug fixes Support for new platforms and compilers September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 3 Information about the release Follow New Features and Compatibility Issues links September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 4 2

3 Why new features? Need to address some deficiencies in initial design Examples: Big overhead in file sizes Non-tunable metadata cache implementation Handling of free-space in a file September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 5 Why new features? Need to address new requirements Add support for New types of indexing (object creation order) Big volumes of variable-length data (DNA sequences) Simultaneous real-time streams (fast append to one -dimensional datasets) UTF-8 encoding for objects path names Accessing objects stored in another HDF5 files (external or user-defined links) September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 6 3

4 Outline Dataset and datatype improvements Group improvements Link revisions Shared object header messages Metadata cache improvements Error handling Backward/forward compatibility HDF5 and NetCDF-4 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 7 Dataset and Datatype Improvements September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 8 4

5 Why: Text-based data type descriptions Simplify data type creation Make data type creation code more readable Facilitate debugging by printing the text description of a data type What: New routines to create an HDF5 data type through the text description of the data type and get a text description from the HDF5 data type September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 9 Text data type description September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 10 5

6 Why: Serialized datatypes and dataspaces Allow datatype and dataspace info to be transmitted between processes Allow datatype/dataspace to be stored in non -HDF5 files What: A new set of routines to serialize/deserialize HDF5 datatypes and dataspaces. September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 11 Serialized datatypes and dataspaces Example /* Find the buffer length and encode a datatype into buffer */ status = H5Tencode(t_id, NULL, &cmpd_buf_size); cmpd_buf = (unsigned char*)calloc(1, cmpd_buf_size); H5Tencode(t_id, cmpd_buf, &cmpd_buf_size) /* Decode a binary description of a datatype and retune a datatype handle */ t_id = H5Tdecode(cmpd_buf); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 12 6

7 Why: Integer to float convert during I/O HDF5 1.6 and earlier supported conversion within the same class (16-bit integer 32-bit integer, 64 -bit float 32-bit float) Conversion needed to support NetCDF 4 programming model What: Integer to float conversion supported during I/O September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 13 Integer to float convert during I/O Example: conversion is transparent to application /* Create a dataset of 64-bit little-endian type */ dset_id = H5Dcreate(loc_id, Mydata, H5T_IEEE_F64LE,space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write integer data to Mydata */ status = H5Dwrite(dset_id, H5T_NATIVE_INT, ); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 14 7

8 Why: Revised conversion exception handling Give apps greater control over exceptions (range errors, etc.) during datatype conversion Needed to support NetCDF 4 programming model What: Revised conversion exception handling September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 15 Revised conversion exception handling To handle exceptions during conversions, register handling function through H5Pset_type_conv_cb(). Cases of exception: H5T_CONV_EXCEPT_RANGE_HI H5T_CONV_EXCEPT_RANGE_LOW H5T_CONV_EXCEPT_TRUNCATE H5T_CONV_EXCEPT_PRECISION H5T_CONV_EXCEPT_PINF H5T_CONV_EXCEPT_NINF H5T_CONV_EXCEPT_NAN Return values: H5T_CONV_ABORT, H5T_CONV_UNHANDLED, H5T_CONV_HANDLED September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 16 8

9 Why: Compression filter for n-bit data Compact storage for user-defined datatypes What: When data stored on disk, padding bits chopped off and only significant bits stored Supports most datatypes Works with compound datatypes September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 17 N-bit compression example In memory, one value of N-Bit datatype is stored like this: byte 3 byte 2 byte 1 byte 0????????????SPPP PPPPPPPP PPPP???? S-sign bit P-significant bit?-padding bit After passing through the N-Bit filter, all padding bits are chopped off, and the bits are stored on disk like this: 1st value 2nd value SPPPPPPP PPPPPPPP SPPPPPPP PPPPPPPP... Opposite (decompress) when going from disk to memory Limited to integer and floating-point data September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 18 9

10 N-bit compression example Example /* Create a N-bit datatype */ dt_id = H5Tcopy(H5T_STD_I32LE); H5Tset_precision(dt_id, 16); H5Tset_offset(dt_id, 4); /* Create and write a dataset */ dcpl_id = H5Pcreate(H5P_DATASET_CREATE); H5Pset_chunk(dcpl_id, ); H5Pset_nbit(dcpl_id); dset_id = H5Dcreate(,,,,,dcpl_id, ); H5Dwrite(dset_id,,,,,buf); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 19 Why: Offset+size storage filter Use less storage when less precision needed What: Performs scale/offset operation on each value Truncates result to fewer bits before storing Currently supports integers and floats Precision may be lost September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 20 10

11 Example with floating-point type Data: { , , , } Choose scaling factor: decimal precision to keep E.g. scale factor D = 2 1. Find minimum value (offset): Subtract minimum value from each element Result: {5.102, 0, 1.086, 6.185} 3. Scale data by multiplying 10 D = 100 Result: {510.2, 0, 108.6, 618.5} 4. Round the data to integer Result: {510, 0, 109, 619} 5. Pack and store using min number of bits September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 21 Offset+size storage filter Example /* Use scale+offset filter on integer data; let library figure out the number of minimum bits necessary to story the data without loss of precision */ H5Pset_scaleoffset (dcrp_id,h5z_so_int,h5z_so_int_minbits_default); H5Pset_chunk(dcrp_id,, ); dset_id = H5Dcreate(,,,,,dcpl_id, ); /* Use sclae+offset filter on floating-point data; compression may be lossy */ H5Pset_scaleoffset(dcrp_id,H5Z_SO_FLOAT_DSCALE,2 ); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 22 11

12 Why: NULL Dataspace Allow datasets with no elements to be described NetCDF 4 needed a place holder for attributes What: A dataset with no dimensions, no data September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 23 NULL dataspace Example /* Create a dataset with NULL dataspace*/ sp_id = H5Screate(H5S_NULL); dset_id = H5Dcreate(,"SDS.h5,,sp_id,,, ); HDF5 "SDS.h5" { GROUP "/" { DATASET "IntArray" { DATATYPE H5T_STD_I32LE DATASPACE NULL DATA { } } } } September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 24 12

13 HDF5 file format revision September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 25 Why: HDF5 file format revision Address deficiencies of the original file format Address space overhead in an HDF5 file Enable new features What: New routine that instructs the HDF5 library to create all objects using the latest version of the HDF5 file format (cmp. with the earliest version when object became available, e.g. array datatype) Will talk about the versioning later September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 26 13

14 HDF5 file format revision Example /* Use the latest version of a file format for each object created in a file */ fapl_id = H5Pcreate(H5P_FILE_ACCESS); H5Pset_latest_format(fapl_id, 1); fid = H5Fcreate(,,,fapl_id); or fid = H5Fopen(,,fapl_id); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 27 Group Revisions September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 28 14

15 Why: Better large group storage Faster, more scalable storage and access for large groups What: New format and method for storing groups with many links September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 29 Informal benchmark Create a file and a group in a file Create up to 10^6 groups with one dataset in each group Compare files sizes and performance of HDF using the latest group format with the performance of HDF (default, old format) and Note: Default and became very slow after groups September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 30 15

16 Time to open and read a dataset 1000 Time (milliseconds) (old groups) 1.8 (new groups) Number of Groups September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 31 Time to close the file Time (milliseconds) (old groups) 1.8 (new groups) Number of Groups September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 32 16

17 File size Size (kilobytes) (old groups) 1.8 (new groups) Number of Groups September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 33 Why: Access links by creation-time order Allow iteration & lookup of group s links (children) by creation order as well as by name order Support netcdf access model for netcdf 4 What: Option to access objects in group according to relative creation time September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 34 17

18 Example Access links by creation-time order /* Track and index creation order of the links */ H5Pset_link_creation_order(gcpl_id, (H5P_CRT_ORDER_TRACKED H5P_CRT_ORDER_INDEXED)); /* Create a group */ gid = H5Gcreate(fid, GNAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 35 Example: h5dump --group=1 tordergr.h5 HDF5 "tordergr.h5" { GROUP "1" { GROUP "a" { GROUP "a1" { } GROUP "a2" { GROUP "a21" { } GROUP "a22" { } } } GROUP "b" { } GROUP "c" { } } } September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 36 18

19 Example: h5dump --sort_by=creation_order HDF5 "tordergr.h5" { GROUP "1" { GROUP "c" { } GROUP "b" { } GROUP "a" { GROUP "a1" { } GROUP "a2" { GROUP "a22" { } GROUP "a21" { } } } } } September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 37 Compact groups Why: Save space and access time for small groups If groups small, don t need B-tree overhead What: Alternate storage for groups with few links Default storage when latest format is specified Library converts to original storage (B-tree based) using default or user-specified threshold September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 38 19

20 Compact groups Example File with 11,600 groups With original group structure, file size ~ 20 MB With compact groups, file size ~ 12 MB Total savings: 8 MB (40%) Average savings/group: ~700 bytes September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 39 Example Compact groups /* Change storage to dense if number of group members is bigger than 16 and go back to compact storage if number of group members is smaller than 12 */ H5Pset_link_phase_change(gcpl_id, 16, 12) /* Create a group */ g_id = H5Gcreate(,,,gcpl_id, ); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 40 20

21 Why: Intermediate group creation Simplify creation of a series of connected groups Avoid having to create each intermediate group separately, one by one What: Intermediate groups can be created when creating an object in a file, with one function call September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 41 Intermediate group creation Want to create /A/B/C/dset1 A exists, but B/C/dset1 do not / A / A One call creates groups B & C, then creates dset1 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 42 21

22 Intermediate group creation Example /* Create link creation property list */ lcrp_id = H5Pcreate(H5P_LINK_CREATE); /* Set flag for intermediate group creation Groups B and C will be created automatically */ H5Pset_create_intermediate_group(lcrp_id, TRUE); ds_id = H5Dcreate (file_id, "/A/B/C/dset1",,, lcrp_id,,,); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 43 Link Revisions September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 44 22

23 What are links? Links connect groups to their members Hard links point to a target by address Soft links store the path to a target root group Hard link <address> Soft link /target dataset dataset September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 45 Why: New: External Links Access objects stored in other HDF5 files in a transparent way What: Store location of file and path within that file Can link across files September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 46 23

24 New: External Links file1.h5 root group External_link file2.h5 /A/B/C/D/E file2.h5 root group target object <address> group External link object External_link in file1.h5 points to the group /A/B/C/D/E in file2.h5 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 47 Example External links /* Create an external link */ H5Lcreate_external(TARGET_FILE, /A/B/C/D/E", source_file_id, External_link,, ); /* We will use external link to create a group in a target file */ gr_id = H5Gcreate(source_file_id, External_link/F,,,, ); /* We can access group External_link/F in the source file and group /A/B/C/D/E/F in the target file */ September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 48 24

25 Why: New: User-defined Links Allow applications to create their own kinds of links and link operations, such as Create hard external link that finds an object by address Create link that accesses a URL Keep track of how often a link accessed, or other behavior What: Applications can create new kinds of links by supplying custom callback functions Can do anything HDF5 hard, soft, or external links do September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 49 Traversing an HDF5 file September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 50 25

26 Why: Traversing HDF5 file Allow applications to iterate through the objects in a group or visit recursively all objects under a group What: New APIs to traverse a group hierarchy New APIs to iterate through a group using different types of indices (name or creation order) H5Giterate is deprecated in favor of new functions September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 51 Traversing HDF5 file Example of some new APIs /* Check if object A/B exists in a root group */ H5Lexists(file_id, A/B, ); /* Iterate through group members of a root group using name as an index; this function doesn t recursively follow links into subgroups */ H5Literate(file_id, H5_INDEX_NAME, H5_ITER_INC, &idx, iter_link_cb, &info); /* Visit all objects under the root group; this function recursively follow links into subgroups */ H5Lvisit(file_id, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &info); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 52 26

27 Things to remember Traversing HDF5 file Never use H5Ldelete in any HDF5 iterate or visit call back functions Always close parent object before deleting a child object September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 53 Shared Object Header Messages September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 54 27

28 Shared object header messages Why: metadata duplicated many times, wasting space Example: You create a file with 10,000 datasets All use the same datatype and dataspace HDF5 needs to write this information 10,000 times! Dataset 1 Dataset 2 Dataset 3 datatype datatype datatype dataspace dataspace dataspace data 1 data 2 data 3 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 55 Shared object header messages What: Enable messages to be shared automatically HDF5 shares duplicated messages on its own! Dataset 1 Dataset 2 datatype dataspace data 1 data 2 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 56 28

29 Shared Messages Happens automatically Works with datatypes, dataspaces, attributes, fill values, and filter pipelines Saves space if these objects are relatively large May be faster if HDF5 can cache shared messages Drawbacks Usually slower than non-shared messages Adds overhead to the file Index for storing shared datatypes 25 bytes per instance Older library versions can t read files with shared messages September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 57 Two informal tests File with 24 datasets, all with same big datatype 26,000 bytes normally 17,000 bytes with shared messages enabled Saves 375 bytes per dataset But, make a bad decision: invoke shared messages but only create one dataset 9,000 bytes normally 12,000 bytes with shared messages enabled Probably slower when reading and writing, too. Moral: shared messages can be a big help, but only in the right situation! September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 58 29

30 Error Handling September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 59 Extendible error-handling APIs Why: Enable app to integrate error reporting with HDF5 library error stack What: New error handling API H5Epush - push major and minor error ID on specified error stack H5Eprint print specified stack H5Ewalk walk through specified stack H5Eclear clear specified stack H5Eset_auto turn error printing on/off for specified stack H5Eget_auto return settings for specified stack traversal September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 60 30

31 Error-handling programming model Create new class, major and minor error messages Register messages with the HDF5 library Manage errors Use default or create new error stack Push error Print error stack Close stack September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 61 Error-handling example #define ERR_CLS_NAME "Error Test" #define PROG_NAME "Error Program" #define PROG_VERS "1.0 #define ERR_MAJ_TEST_MSG "Error in test #define ERR_MIN_MYFUNC_MSG "Error in my function /* Initialize error information for application */ ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS); ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG); ERR_MIN_MYFUNC = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_MYFUNC_MSG);.. /* Unregister major and minor error, and class handles when done */ H5Eunregister_class(ERR_CLS); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 62 31

32 Error-handling example /* This function creates and write a dataset */ static herr_t my_function(hid_t fid) {. /* Force this function to fail and make it push error */ H5E_BEGIN_TRY { dataset = H5Dcreate1(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT); } H5E_END_TRY; if(dataset < 0) { H5Epush(H5E_DEFAULT, FILE, FUNC_my_function, LINE, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, "H5Dcreate failed"); goto error; } /* end if */ September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 63 Error-handling example Error Test-DIAG: Error detected in Error Program (1.0) thread 0: #000: error_example.c line 160 in main(): Error stack test failed major: Error in test minor: Error in my function #001: error_example.c line 100 in my_function(): H5Dcreate failed major: Error in IO minor: Error in H5Dcreate HDF5-DIAG: Error detected in HDF5 (1.8.1) thread 0: #002: H5Ddeprec.c line 154 in H5Dcreate1(): not a location ID major: Invalid arguments to routine minor: Inappropriate type #003: H5Gloc.c line 241 in H5G_loc(): invalid object ID major: Invalid arguments to routine minor: Bad value September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 64 32

33 Metadata cache September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 65 HDF5 metadata Metadata extra information about user s data Two types of metadata: Structural metadata: stores information about user s data When you create a group, you really create: Group header B-Tree (to index entries), and Local heap (to store entry names) September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 66 33

34 HDF5 metadata User defined metadata (for example, created via the H5A calls) Usually small less than 1 KB Accessed frequently Small disk accesses still expensive September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 67 Overview of HDF5 metadata cache Scenario Create datasets A,B,C,D 10^6 chunks under root group Initialize the chunks using a round robin (1 from A, 1 from B, 1 from C, 1 from D, repeat until done 10^6 random accesses across A,B,C and D 10^6 random accesses to A only Working set size (subset of metadata in use) Number of metadata cache accesses < 1MB <50K < 1MB ~30M ~120MB ~4M ~40MB ~4M September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 68 34

35 HDF5 metadata cache Challenges peculiar to metadata caching in HDF5 Varying metadata entry sizes Most entries are less than a few hundred bytes Entries may be of almost any size Encountered variations from few bytes to megabytes Varying working set sizes < 1MB for most applications most of the time ~ 8MB (astrophysics simulation code) Metadata cache competes with application in core Cache must be big enough to to hold working set Should never be significantly bigger lest is starve the user program for core September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 69 Metadata Cache in HDF and before Hash Table Metadata Metadata Metadata Fast No provision for collisions Eviction on collision For small hash table performance is bad since frequently accessed entries hash to the same location Good performance requires big size of hash table Inefficient use of core Unsustainable as HDF5 file size and complexity increases September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 70 35

36 Metadata Cache in HDF and Entries are stored in a hash table as before Collisions handled by chaining Maintain a LRU list to select candidates for eviction Maintain a running sum of the sizes of the entries Entries are evicted when a predefined limit on this sum is reached Size of the metadata cache is bounded Hard coded to 8MB Doesn t work when working set size is bigger Larger variations on a working set sizes are anticipated Manual control over the cache size is needed!!!! September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 71 Metadata Cache in HDF and Hash Table Metadata 9 Metadata 1 Metadata 3 Metadata 2 Metadata 8 Metadata 4 Metadata 5 Metadata 7 Metadata LRU list September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 72 36

37 Metadata Cache improvements Why: Improve I/O performance and memory usage when accessing many objects What: New metadata cache APIs control cache size monitor actual cache size and current hit rate Under the hood: adaptive cache resizing Automatically detects the current working size Sets max cache size to the working set size September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 73 Metadata cache improvements Note: most applications do not need to worry about the cache See Special topics in the HDF5 User s Guide for details And if you do see unusual memory growth or poor performance, please contact us. We want to help you. September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 74 37

38 Forward-backward compatibility September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 75 What do we promise to our users? Backward compatibility Newer version of the library will always read files created with an older version Forward compatibility Application written to work with an older version will compile, link and run as expected with a newer version Requires compilation flag For more information see API Compatibility Macros in HDF5 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 76 38

39 HDF file format changes File format changes Support new features Object creation order, UTF-8 encoding, external links Reduce file overhead New format for global and local heaps New groups storage compact groups Shared object messages Enabled only by using specific API If no new features requested, created file should be read by older versions of the HDF5 library September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 77 Example How application can create a 1.6.* incompatible file? Latest format is used for storing compound datatypes fapl = H5Pcreate(H5P_FILE_ACCESS); H5Pset_latest_format(fapl, TRUE); file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); tid = H5Tcreate(H5T_COMPOUND, sizeof(struct s1)); H5Tinsert( ); dset = H5Dcreate(file, New compound, tid, ); H5Dwrite(dset, ); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 78 39

40 HDF API changes HDF5 uses API versioning H5Gcreate1( loc_id, New/My old group, 0 ) H5Gcreate2( loc_id, New/My new group, lcpl_id, gcpl_id, gapl_id) HDF5 uses macros to map versioned API to a generic one H5Gcreate ( loc_id, New/My old group, 0 ) H5Gcreate ( loc_id, New/My new group, lcpl_id, gcpl_id, gapl_id) Mapping is set up at library build time; can be overwritten by application if application is built with special compilation flags September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 79 HDF API changes Examples of the new APIs H5Acreate1, H5Aopen1 - deprecated H5Acreate2, H5Aopen2 H5Gcreate1, H5Gopen1 H5Gcreate2, H5Gopen2, H5G_link_hard H5Rget_obj_type1 H5Rget_obj_type2 New APIs have more parameters to set up creation and access properties for the objects Default values for new parameters H5P_DEFAULT will emulate old behavior H5Gcreate ( loc_id, New/My old group, 0 ) H5Gcreate ( loc_id, New/My new group, H5P_DEFAULT,H5P_DEFAULT, H5P_DEFAULT) September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 80 40

41 HDF5 Library configuration Configure flag (global settings) (default) Public symbols are mapped to 1.8 (e.g. H5Gcreate is mapped to H5Gcreate2, old H5Gcreate is H5Greate1) Are deprecated symbols available? Yes 1.8 (e.g. H5Gcreate is mapped to H5Gcreate2, H5Gcreate1 is not available) No --with-default-apiversion=v18 --disable-deprecatedsymbols --with-default-apiversion=v (e.g. H5Gcreate is mapped to H5Gcreate1, H5Gcreate2 is available) September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 81 Yes HDF5 application configuration Global level HDF5 APIs mapping can be done by application Assuming both deprecated and new symbols are available in the library: h5cc my_program.c Both H5Gcreate1, H5Gcreate2 and H5Gcreate may be used h5cc -DH5_NO_DEPRECATED_SYMBOLS my_program.c Only new symbols are available for application; H5Gcreate is mapped to H5Gcreate2; application may use both H5Gcreate2 and H5Gcreate; cannot use H5Gcreate1 h5cc -DH5_USE_16_API my_program.c H5Gcreate is mapped to H5Gcreate1; all three H5Gcreate1, H5Gcreate2 and H5Gcreate can be used September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 82 41

42 HDF5 application configuration Per-function level Version and mapping can be set per function Assuming both deprecated and new symbols are available in the library: h5cc -D H5Gcreate_vers=1 -D H5Acreate_vers=2 my_program.c Maps H5Gcreate to H5Gcreate1 Maps H5Acreate to H5Acreate2 both H5Gcreate1 and H5Gcreate2 may be used; the same for H5Acreate1 and H5Acreate2 h5cc -D H5Gcreate_vers=2 my_program.c Maps H5Gcreate to H5Gcreate2 Both H5Gcreate1 and H5Gcreate2 may be used September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 83 Example: --with-default-api-version=v18 hid_t file_id, group_id; /* identifiers */... /* Open file.h5 */ file_id = H5Fopen( file.h5, H5F_ACC_RDWR, H5P_DEFAULT, H5P_DEFAULT); /* Create several groups in a file */ grp1_id = H5Gcreate (file_id, New/A", H5P_DEAFULT, gcpt, gapt); grp2_id = H5Gcreate1(file_id,"/B",0); grp3_id = H5Gcreate2(file_id, New/A", H5P_DEAFULT, gcpt, gapt); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 84 42

43 Example: --with-default-api-version=v16 hid_t file_id, group_id; /* identifiers */... /* Open file.h5 */ file_id = H5Fopen( file.h5, H5F_ACC_RDWR, H5P_DEFAULT, H5P_DEFAULT); /* Create several groups in a file */ grp1_id = H5Gcreate (file_id, "/A",0); grp2_id = H5Gcreate1(file_id,"/B",0); grp3_id = H5Gcreate2(file_id, New/C", H5P_DEAFULT, gcpt, gapt); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 85 Example: --disable-deprecated-symbols hid_t file_id, group_id; /* identifiers */... /* Open file.h5 */ file_id = H5Fopen( file.h5, H5F_ACC_RDWR, H5P_DEFAULT, H5P_DEFAULT); /* Create several groups in a file */ grp1_id = H5Gcreate (file_id, New/A", H5P_DEAFULT, gcpt, gapt); /* Compilation will fail */ grp2_id = H5Gcreate1(file_id,"/B",0); grp3_id = H5Gcreate2(file_id, New/A", H5P_DEAFULT, gcpt, gapt); September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 86 43

44 HDF5 and NetCDF-4 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 87 NetCDF-3 and HDF5 Development, maintenance, and funding Advantages Disadvantages NetCDF-3 UCAR Unidata NSF Popular, simple data model, lots of tools, multiple implementations (Java); data may be recovered after system crash Separate implementation to support parallel I/O (Argonne) and 64-bit platforms, limited number of data types (e.g. no support for structures), different limitations on variables, modifications after creation are inefficient HDF5 The HDF Group NASA, DOE, other Flexible, works on 32- bit and 64-bit platforms, high-performance, efficient storage, rich collection of data types, extensible Complex, steep learning curve, easy to misuse; system crash may corrupt HDF5 file September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 88 44

45 Goals of NetCDF/HDF combination Create NetCDF-4, combining desirable characteristics of NetCDF-3 and HDF5, while taking advantage of their separate strengths Widespread use and simplicity of NetCDF-3 Generality and performance of HDF5 Make NetCDF more suitable for high -performance computing, large datasets Provide simple high-level application programming interface (API) for HDF5 Demonstrate benefits of combination in advanced Earth science modeling efforts September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 89 What is NetCDF-4? NASA-funded effort to improve Interoperability among scientific data representations Integration of observations and model outputs I/O for high-performance computing Extended NetCDF-3 data model for scientific data (better data organization, richer data types and support for Extended set of NetCDF-3 APIs for using the model A new format for NetCDF data based on HDF5 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 90 45

46 What is NetCDF-4? Developed at Unidata in collaboration with The HDF Group Supported by Unidata Released in June 2008 Based on HDF Available from September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 91 NetCDF-4 Architecture netcdf-3 applications HDF5 applications netcdf files netcdf-3 Interface netcdf-4 HDF5 files HDF5 files HDF5 Library Supports access to NetCDF files and HDF5 files created through NetCDF-4 interface September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 92 46

47 NetCDF vs HDF5 terminology NetCDF HDF5 Dataset Variable Coordinate variable HDF5 file Dataset Dimension scale September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 93 Extended NetCDF model NetCDF-3 models multidimensional arrays of primitive types with Variables, Dimensions, and Attributes; only one unlimited dimension is allowed HDF5 models multidimensional arrays of complex structures with Datasets and Attributes; multiple unlimited dimensions are allowed. NetCDF-4 implements an extended data model with enhancements made possible with HDF5: Structure types: like C structures, except portable Multiple unlimited dimensions Groups Variable-length objects New primitive types: strings, unsigned types, opaque September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 94 47

48 NetCDF-3 Data Model location: URL Attribute name: String type: DataType value: 1 D Array Variable name: String shape: Dimension[ ] type: DataType name: length: String int char byte short int float double September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 95 HDF5 Data Model location: multiple Attribute name: String value: Variable name: String members: Variable[ ] Variable name: String shape: Dimension[ ] type: DataType Structure byte, unsigned byte short, unsigned short int, unsigned int long, unsigned long float double String BitField Enumeration DateTime Opaque Reference VariableLength name: String members: Variable[ ] September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 96 48

49 A Common Data Model location: URL name: length: String int Attribute name: String type: DataType value: 1 D Array name: String members: Variable[ ] Variable name: String shape: Dimension[ ] type: DataType Structure name: String members: Variable[ ] September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 97 byte, unsigned byte short, unsigned short int, unsigned int long, unsigned long float double char String Opaque NetCDF-4 Data Model location: URL name: length: String int Attribute name: String type: DataType value: 1 D Array name: String members: Variable[ ] Variable name: String shape: Dimension[ ] type: DataType Structure name: String members: Variable[ ] September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 98 byte, unsigned byte short, unsigned short int, unsigned int long, unsigned long float double char String Opaque 49

50 Glance at NetCDF-4 Performance September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 99 Sequential NetCDF-3 and NetCDF-4 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial

51 NetCDF-3 and NetCDF-4 Preliminary performance study NetCDF-4 performance report June 2008 Used real NASA data for benchmarks Compares NetCDF-3 and NetCDF-4 performance for reading and writing data of different dimensionality using different storage layouts and system caching parameters September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 101 NetCDF-3 and NetCDF-4 Summary For contiguous access patterns performance of NetCDF-4 is comparable with NetCDF-3 For non-contiguous access patterns chunking feature can improve performance (use the right size!) NetCDF-4 compression reduces data storage size and I/O time September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial

52 Non-contiguous Access Logical layout for 2-dimensional arrays September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 103 Data layout in a file Non-contiguous access non-adjacent data points Chunk size [4096][1] Chunk size [8192][1] Chunk size [16384][1] September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial

53 Non-contiguous write September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 105 Non-contiguous read September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial

54 Word of caution Non-contiguous access Shown chunk size will cause poor performance if access pattern is by row or several contiguous rows If access pattern is not known, choose chunk size to accommodate extreme cases September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 107 Parallel NetCDF-4, PNetCDF and HDF5 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial

55 HDF5, NetCDF-4 and PNetCDF Performance results for A parallel version of NetCDF-3 from ANL /Northwestern University (PnetCDF) HDF5 parallel library NetCDF-4 beta1 For more details see materials under September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 109 HDF5 and PnetCDF Performance Comparison Flash I/O Website Robb Ross, etc. Parallel NetCDF: A Scientific High-Performance I/O Interface September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial

56 HDF5 and PnetCDF performance comparison Bluesky: Power 4 up: Power 5 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 111 HDF5 and PnetCDF performance comparison Bluesky: Power 4 up: Power 5 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial

57 Parallel NetCDF-4 and PnetCDF PNetCDF from ANL NetCDF4 Bandwidth (MB/S) Number of processors Fixed problem size = 995 MB Performance of NetCDF-4 is close to PnetCDF September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 113 Thank you! Questions? September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial

Hierarchical Data Format 5:

Hierarchical Data Format 5: Hierarchical Data Format 5: Giusy Muscianisi g.muscianisi@cineca.it SuperComputing Applications and Innovation Department May 17th, 2013 Outline What is HDF5? Overview to HDF5 Data Model and File Structure

More information

Caching and Buffering in HDF5

Caching and Buffering in HDF5 Caching and Buffering in HDF5 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 1 Software stack Life cycle: What happens to data when it is transferred from application buffer to HDF5 file and from HDF5

More information

What NetCDF users should know about HDF5?

What NetCDF users should know about HDF5? What NetCDF users should know about HDF5? Elena Pourmal The HDF Group July 20, 2007 7/23/07 1 Outline The HDF Group and HDF software HDF5 Data Model Using HDF5 tools to work with NetCDF-4 programs files

More information

Introduction to HDF5

Introduction to HDF5 The HDF Group Introduction to HDF5 Quincey Koziol Director of Core Software & HPC The HDF Group October 15, 2014 Blue Waters Advanced User Workshop 1 Why HDF5? Have you ever asked yourself: How will I

More information

Parallel I/O and Portable Data Formats HDF5

Parallel I/O and Portable Data Formats HDF5 Parallel I/O and Portable Data Formats HDF5 Sebastian Lührs s.luehrs@fz-juelich.de Jülich Supercomputing Centre Forschungszentrum Jülich GmbH Jülich, March 13th, 2018 Outline Introduction Structure of

More information

COSC 6374 Parallel Computation. Scientific Data Libraries. Edgar Gabriel Fall Motivation

COSC 6374 Parallel Computation. Scientific Data Libraries. Edgar Gabriel Fall Motivation COSC 6374 Parallel Computation Scientific Data Libraries Edgar Gabriel Fall 2013 Motivation MPI I/O is good It knows about data types (=> data conversion) It can optimize various access patterns in applications

More information

Introduction to NetCDF

Introduction to NetCDF Introduction to NetCDF NetCDF is a set of software libraries and machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data. First released in 1989.

More information

NetCDF and Scientific Data Durability. Russ Rew, UCAR Unidata ESIP Federation Summer Meeting

NetCDF and Scientific Data Durability. Russ Rew, UCAR Unidata ESIP Federation Summer Meeting NetCDF and Scientific Data Durability Russ Rew, UCAR Unidata ESIP Federation Summer Meeting 2009-07-08 For preserving data, is format obsolescence a non-issue? Why do formats (and their access software)

More information

Parallel I/O and Portable Data Formats

Parallel I/O and Portable Data Formats Parallel I/O and Portable Data Formats Sebastian Lührs s.luehrs@fz-juelich.de Jülich Supercomputing Centre Forschungszentrum Jülich GmbH Reykjavík, August 25 th, 2017 Overview I/O can be the main bottleneck

More information

Adapting Software to NetCDF's Enhanced Data Model

Adapting Software to NetCDF's Enhanced Data Model Adapting Software to NetCDF's Enhanced Data Model Russ Rew UCAR Unidata EGU, May 2010 Overview Background What is netcdf? What is the netcdf classic data model? What is the netcdf enhanced data model?

More information

HDF5: An Introduction. Adam Carter EPCC, The University of Edinburgh

HDF5: An Introduction. Adam Carter EPCC, The University of Edinburgh HDF5: An Introduction Adam Carter EPCC, The University of Edinburgh What is HDF5? Hierarchical Data Format (version 5) From www.hdfgroup.org: HDF5 is a unique technology suite that makes possible the management

More information

Introduction to HDF5

Introduction to HDF5 Introduction to HDF5 Dr. Shelley L. Knuth Research Computing, CU-Boulder December 11, 2014 h/p://researchcompu7ng.github.io/meetup_fall_2014/ Download data used today from: h/p://neondataskills.org/hdf5/exploring-

More information

HDF5: theory & practice

HDF5: theory & practice HDF5: theory & practice Giorgio Amati SCAI Dept. 15/16 May 2014 Agenda HDF5: main issues Using the API (serial) Using the API (parallel) Tools Some comments PHDF5 Initial Target Support for MPI programming

More information

HDF5 File Space Management. 1. Introduction

HDF5 File Space Management. 1. Introduction HDF5 File Space Management 1. Introduction The space within an HDF5 file is called its file space. When a user first creates an HDF5 file, the HDF5 library immediately allocates space to store information

More information

The netcdf- 4 data model and format. Russ Rew, UCAR Unidata NetCDF Workshop 25 October 2012

The netcdf- 4 data model and format. Russ Rew, UCAR Unidata NetCDF Workshop 25 October 2012 The netcdf- 4 data model and format Russ Rew, UCAR Unidata NetCDF Workshop 25 October 2012 NetCDF data models, formats, APIs Data models for scienbfic data and metadata - classic: simplest model - - dimensions,

More information

NetCDF-4: : Software Implementing an Enhanced Data Model for the Geosciences

NetCDF-4: : Software Implementing an Enhanced Data Model for the Geosciences NetCDF-4: : Software Implementing an Enhanced Data Model for the Geosciences Russ Rew, Ed Hartnett, and John Caron UCAR Unidata Program, Boulder 2006-01-31 Acknowledgments This work was supported by the

More information

7C.2 EXPERIENCE WITH AN ENHANCED NETCDF DATA MODEL AND INTERFACE FOR SCIENTIFIC DATA ACCESS. Edward Hartnett*, and R. K. Rew UCAR, Boulder, CO

7C.2 EXPERIENCE WITH AN ENHANCED NETCDF DATA MODEL AND INTERFACE FOR SCIENTIFIC DATA ACCESS. Edward Hartnett*, and R. K. Rew UCAR, Boulder, CO 7C.2 EXPERIENCE WITH AN ENHANCED NETCDF DATA MODEL AND INTERFACE FOR SCIENTIFIC DATA ACCESS Edward Hartnett*, and R. K. Rew UCAR, Boulder, CO 1 INTRODUCTION TO NETCDF AND THE NETCDF-4 PROJECT The purpose

More information

Advanced Database Systems

Advanced Database Systems Lecture IV Query Processing Kyumars Sheykh Esmaili Basic Steps in Query Processing 2 Query Optimization Many equivalent execution plans Choosing the best one Based on Heuristics, Cost Will be discussed

More information

HDF5 I/O Performance. HDF and HDF-EOS Workshop VI December 5, 2002

HDF5 I/O Performance. HDF and HDF-EOS Workshop VI December 5, 2002 HDF5 I/O Performance HDF and HDF-EOS Workshop VI December 5, 2002 1 Goal of this talk Give an overview of the HDF5 Library tuning knobs for sequential and parallel performance 2 Challenging task HDF5 Library

More information

Parallel I/O Performance Study and Optimizations with HDF5, A Scientific Data Package

Parallel I/O Performance Study and Optimizations with HDF5, A Scientific Data Package Parallel I/O Performance Study and Optimizations with HDF5, A Scientific Data Package MuQun Yang, Christian Chilan, Albert Cheng, Quincey Koziol, Mike Folk, Leon Arber The HDF Group Champaign, IL 61820

More information

The HDF Group. Parallel HDF5. Quincey Koziol Director of Core Software & HPC The HDF Group.

The HDF Group. Parallel HDF5. Quincey Koziol Director of Core Software & HPC The HDF Group. The HDF Group Parallel HDF5 Quincey Koziol Director of Core Software & HPC The HDF Group Parallel HDF5 Success Story Recent success story Trillion particle simulation on hopper @ NERSC 120,000 cores 30TB

More information

The HDF Group. Parallel HDF5. Extreme Scale Computing Argonne.

The HDF Group. Parallel HDF5. Extreme Scale Computing Argonne. The HDF Group Parallel HDF5 Advantage of Parallel HDF5 Recent success story Trillion particle simulation on hopper @ NERSC 120,000 cores 30TB file 23GB/sec average speed with 35GB/sec peaks (out of 40GB/sec

More information

DRAFT. HDF5 Data Flow Pipeline for H5Dread. 1 Introduction. 2 Examples

DRAFT. HDF5 Data Flow Pipeline for H5Dread. 1 Introduction. 2 Examples This document describes the HDF5 library s data movement and processing activities when H5Dread is called for a dataset with chunked storage. The document provides an overview of how memory management,

More information

Parallel HDF5 (PHDF5)

Parallel HDF5 (PHDF5) Parallel HDF5 (PHDF5) Giusy Muscianisi g.muscianisi@cineca.it SuperComputing Applications and Innovation Department May 17th, 2013 Outline Overview of Parallel HDF5 design Programming model for Creating

More information

HDF- A Suitable Scientific Data Format for Satellite Data Products

HDF- A Suitable Scientific Data Format for Satellite Data Products HDF- A Suitable Scientific Data Format for Satellite Data Products Sk. Sazid Mahammad, Debajyoti Dhar and R. Ramakrishnan Data Products Software Division Space Applications Centre, ISRO, Ahmedabad 380

More information

C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites:

C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites: C Programming Code: MBD101 Duration: 10 Hours Prerequisites: You are a computer science Professional/ graduate student You can execute Linux/UNIX commands You know how to use a text-editing tool You should

More information

Part II: Data Center Software Architecture: Topic 2: Key-value Data Management Systems. SkimpyStash: Key Value Store on Flash-based Storage

Part II: Data Center Software Architecture: Topic 2: Key-value Data Management Systems. SkimpyStash: Key Value Store on Flash-based Storage ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part II: Data Center Software Architecture: Topic 2: Key-value Data Management Systems SkimpyStash: Key Value

More information

CS252 S05. Main memory management. Memory hardware. The scale of things. Memory hardware (cont.) Bottleneck

CS252 S05. Main memory management. Memory hardware. The scale of things. Memory hardware (cont.) Bottleneck Main memory management CMSC 411 Computer Systems Architecture Lecture 16 Memory Hierarchy 3 (Main Memory & Memory) Questions: How big should main memory be? How to handle reads and writes? How to find

More information

Introduction to High Performance Parallel I/O

Introduction to High Performance Parallel I/O Introduction to High Performance Parallel I/O Richard Gerber Deputy Group Lead NERSC User Services August 30, 2013-1- Some slides from Katie Antypas I/O Needs Getting Bigger All the Time I/O needs growing

More information

HDF5 User s Guide. HDF5 Release November

HDF5 User s Guide. HDF5 Release November HDF5 User s Guide HDF5 Release 1.8.8 November 2011 http://www.hdfgroup.org Copyright Notice and License Terms for HDF5 (Hierarchical Data Format 5) Software Library and Utilities HDF5 (Hierarchical Data

More information

CS3600 SYSTEMS AND NETWORKS

CS3600 SYSTEMS AND NETWORKS CS3600 SYSTEMS AND NETWORKS NORTHEASTERN UNIVERSITY Lecture 11: File System Implementation Prof. Alan Mislove (amislove@ccs.neu.edu) File-System Structure File structure Logical storage unit Collection

More information

Raima Database Manager Version 14.1 In-memory Database Engine

Raima Database Manager Version 14.1 In-memory Database Engine + Raima Database Manager Version 14.1 In-memory Database Engine By Jeffrey R. Parsons, Chief Engineer November 2017 Abstract Raima Database Manager (RDM) v14.1 contains an all new data storage engine optimized

More information

Motivation. Operating Systems. File Systems. Outline. Files: The User s Point of View. File System Concepts. Solution? Files!

Motivation. Operating Systems. File Systems. Outline. Files: The User s Point of View. File System Concepts. Solution? Files! Motivation Operating Systems Process store, retrieve information Process capacity restricted to vmem size When process terminates, memory lost Multiple processes share information Systems (Ch 0.-0.4, Ch.-.5)

More information

Introduction to serial HDF5

Introduction to serial HDF5 Introduction to serial HDF Matthieu Haefele Saclay, - March 201, Parallel filesystems and parallel IO libraries PATC@MdS Matthieu Haefele Training outline Day 1: AM: Serial HDF (M. Haefele) PM: Parallel

More information

Indexing. Jan Chomicki University at Buffalo. Jan Chomicki () Indexing 1 / 25

Indexing. Jan Chomicki University at Buffalo. Jan Chomicki () Indexing 1 / 25 Indexing Jan Chomicki University at Buffalo Jan Chomicki () Indexing 1 / 25 Storage hierarchy Cache Main memory Disk Tape Very fast Fast Slower Slow (nanosec) (10 nanosec) (millisec) (sec) Very small Small

More information

A program execution is memory safe so long as memory access errors never occur:

A program execution is memory safe so long as memory access errors never occur: A program execution is memory safe so long as memory access errors never occur: Buffer overflows, null pointer dereference, use after free, use of uninitialized memory, illegal free Memory safety categories

More information

File System: Interface and Implmentation

File System: Interface and Implmentation File System: Interface and Implmentation Two Parts Filesystem Interface Interface the user sees Organization of the files as seen by the user Operations defined on files Properties that can be read/modified

More information

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts Memory management Last modified: 26.04.2016 1 Contents Background Logical and physical address spaces; address binding Overlaying, swapping Contiguous Memory Allocation Segmentation Paging Structure of

More information

File Systems. CS170 Fall 2018

File Systems. CS170 Fall 2018 File Systems CS170 Fall 2018 Table of Content File interface review File-System Structure File-System Implementation Directory Implementation Allocation Methods of Disk Space Free-Space Management Contiguous

More information

Chapter 12: Indexing and Hashing

Chapter 12: Indexing and Hashing Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree Index Files Static Hashing Dynamic Hashing Comparison of Ordered Indexing and Hashing Index Definition in SQL

More information

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 CPU management Roadmap Process, thread, synchronization, scheduling Memory management Virtual memory Disk

More information

File Systems: Fundamentals

File Systems: Fundamentals File Systems: Fundamentals 1 Files! What is a file? Ø A named collection of related information recorded on secondary storage (e.g., disks)! File attributes Ø Name, type, location, size, protection, creator,

More information

Chapter 12: Query Processing

Chapter 12: Query Processing Chapter 12: Query Processing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Overview Chapter 12: Query Processing Measures of Query Cost Selection Operation Sorting Join

More information

HDF5 Single Writer/Multiple Reader Feature Design and Semantics

HDF5 Single Writer/Multiple Reader Feature Design and Semantics HDF5 Single Writer/Multiple Reader Feature Design and Semantics The HDF Group Document Version 5.2 This document describes the design and semantics of HDF5 s single writer/multiplereader (SWMR) feature.

More information

Chapter 12: Indexing and Hashing. Basic Concepts

Chapter 12: Indexing and Hashing. Basic Concepts Chapter 12: Indexing and Hashing! Basic Concepts! Ordered Indices! B+-Tree Index Files! B-Tree Index Files! Static Hashing! Dynamic Hashing! Comparison of Ordered Indexing and Hashing! Index Definition

More information

CSIT5300: Advanced Database Systems

CSIT5300: Advanced Database Systems CSIT5300: Advanced Database Systems L08: B + -trees and Dynamic Hashing Dr. Kenneth LEUNG Department of Computer Science and Engineering The Hong Kong University of Science and Technology Hong Kong SAR,

More information

BLAKE2b Stage 1 Stage 2 Stage 9

BLAKE2b Stage 1 Stage 2 Stage 9 The following outlines xenoncat s implementation of Equihash (n=200, k=9) solver. Original Equihash document: https://www.internetsociety.org/sites/default/files/blogs-media/equihash-asymmetric-proof-ofwork-based-generalized-birthday-problem.pdf

More information

Introduction to HDF5

Introduction to HDF5 Introduction to parallel HDF Maison de la Simulation Saclay, 0-0 March 201, Parallel filesystems and parallel IO libraries PATC@MdS Evaluation form Please do not forget to fill the evaluation form at https://events.prace-ri.eu/event/30/evaluation/evaluate

More information

Announcements. Reading Material. Recap. Today 9/17/17. Storage (contd. from Lecture 6)

Announcements. Reading Material. Recap. Today 9/17/17. Storage (contd. from Lecture 6) CompSci 16 Intensive Computing Systems Lecture 7 Storage and Index Instructor: Sudeepa Roy Announcements HW1 deadline this week: Due on 09/21 (Thurs), 11: pm, no late days Project proposal deadline: Preliminary

More information

CS 31: Intro to Systems Caching. Martin Gagne Swarthmore College March 23, 2017

CS 31: Intro to Systems Caching. Martin Gagne Swarthmore College March 23, 2017 CS 1: Intro to Systems Caching Martin Gagne Swarthmore College March 2, 2017 Recall A cache is a smaller, faster memory, that holds a subset of a larger (slower) memory We take advantage of locality to

More information

Advances in Memory Management and Symbol Lookup in pqr

Advances in Memory Management and Symbol Lookup in pqr Advances in Memory Management and Symbol Lookup in pqr Radford M. Neal, University of Toronto Dept. of Statistical Sciences and Dept. of Computer Science http://www.cs.utoronto.ca/ radford http://radfordneal.wordpress.com

More information

File Systems Management and Examples

File Systems Management and Examples File Systems Management and Examples Today! Efficiency, performance, recovery! Examples Next! Distributed systems Disk space management! Once decided to store a file as sequence of blocks What s the size

More information

Protocol Buffers, grpc

Protocol Buffers, grpc Protocol Buffers, grpc Szolgáltatásorientált rendszerintegráció Service-Oriented System Integration Dr. Balázs Simon BME, IIT Outline Remote communication application level vs. transport level protocols

More information

Chapter 8: Memory-Management Strategies

Chapter 8: Memory-Management Strategies Chapter 8: Memory-Management Strategies Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and

More information

OPERATING SYSTEM. Chapter 12: File System Implementation

OPERATING SYSTEM. Chapter 12: File System Implementation OPERATING SYSTEM Chapter 12: File System Implementation Chapter 12: File System Implementation File-System Structure File-System Implementation Directory Implementation Allocation Methods Free-Space Management

More information

Da-Wei Chang CSIE.NCKU. Professor Hao-Ren Ke, National Chiao Tung University Professor Hsung-Pin Chang, National Chung Hsing University

Da-Wei Chang CSIE.NCKU. Professor Hao-Ren Ke, National Chiao Tung University Professor Hsung-Pin Chang, National Chung Hsing University Chapter 11 Implementing File System Da-Wei Chang CSIE.NCKU Source: Professor Hao-Ren Ke, National Chiao Tung University Professor Hsung-Pin Chang, National Chung Hsing University Outline File-System Structure

More information

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition Chapter 8: Memory- Management Strategies Operating System Concepts 9 th Edition Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation

More information

Operating Systems Design Exam 2 Review: Spring 2011

Operating Systems Design Exam 2 Review: Spring 2011 Operating Systems Design Exam 2 Review: Spring 2011 Paul Krzyzanowski pxk@cs.rutgers.edu 1 Question 1 CPU utilization tends to be lower when: a. There are more processes in memory. b. There are fewer processes

More information

File Systems. CS 4410 Operating Systems. [R. Agarwal, L. Alvisi, A. Bracy, M. George, E. Sirer, R. Van Renesse]

File Systems. CS 4410 Operating Systems. [R. Agarwal, L. Alvisi, A. Bracy, M. George, E. Sirer, R. Van Renesse] File Systems CS 4410 Operating Systems [R. Agarwal, L. Alvisi, A. Bracy, M. George, E. Sirer, R. Van Renesse] The abstraction stack I/O systems are accessed through a series of layered abstractions Application

More information

FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 23

FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 23 FILE SYSTEMS CS124 Operating Systems Winter 2015-2016, Lecture 23 2 Persistent Storage All programs require some form of persistent storage that lasts beyond the lifetime of an individual process Most

More information

CS 416: Opera-ng Systems Design March 23, 2012

CS 416: Opera-ng Systems Design March 23, 2012 Question 1 Operating Systems Design Exam 2 Review: Spring 2011 Paul Krzyzanowski pxk@cs.rutgers.edu CPU utilization tends to be lower when: a. There are more processes in memory. b. There are fewer processes

More information

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture) EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture) Dept. of Computer Science & Engineering Chentao Wu wuct@cs.sjtu.edu.cn Download lectures ftp://public.sjtu.edu.cn User:

More information

Query Processing. Debapriyo Majumdar Indian Sta4s4cal Ins4tute Kolkata DBMS PGDBA 2016

Query Processing. Debapriyo Majumdar Indian Sta4s4cal Ins4tute Kolkata DBMS PGDBA 2016 Query Processing Debapriyo Majumdar Indian Sta4s4cal Ins4tute Kolkata DBMS PGDBA 2016 Slides re-used with some modification from www.db-book.com Reference: Database System Concepts, 6 th Ed. By Silberschatz,

More information

File Systems. ECE 650 Systems Programming & Engineering Duke University, Spring 2018

File Systems. ECE 650 Systems Programming & Engineering Duke University, Spring 2018 File Systems ECE 650 Systems Programming & Engineering Duke University, Spring 2018 File Systems Abstract the interaction with important I/O devices Secondary storage (e.g. hard disks, flash drives) i.e.

More information

Percona Live September 21-23, 2015 Mövenpick Hotel Amsterdam

Percona Live September 21-23, 2015 Mövenpick Hotel Amsterdam Percona Live 2015 September 21-23, 2015 Mövenpick Hotel Amsterdam TokuDB internals Percona team, Vlad Lesin, Sveta Smirnova Slides plan Introduction in Fractal Trees and TokuDB Files Block files Fractal

More information

Notes on the Exam. Question 1. Today. Comp 104:Operating Systems Concepts 11/05/2015. Revision Lectures (separate questions and answers)

Notes on the Exam. Question 1. Today. Comp 104:Operating Systems Concepts 11/05/2015. Revision Lectures (separate questions and answers) Comp 104:Operating Systems Concepts Revision Lectures (separate questions and answers) Today Here are a sample of questions that could appear in the exam Please LET ME KNOW if there are particular subjects

More information

Key Point. What are Cache lines

Key Point. What are Cache lines Caching 1 Key Point What are Cache lines Tags Index offset How do we find data in the cache? How do we tell if it s the right data? What decisions do we need to make in designing a cache? What are possible

More information

CS 525: Advanced Database Organization 04: Indexing

CS 525: Advanced Database Organization 04: Indexing CS 5: Advanced Database Organization 04: Indexing Boris Glavic Part 04 Indexing & Hashing value record? value Slides: adapted from a course taught by Hector Garcia-Molina, Stanford InfoLab CS 5 Notes 4

More information

CSCI 171 Chapter Outlines

CSCI 171 Chapter Outlines Contents CSCI 171 Chapter 1 Overview... 2 CSCI 171 Chapter 2 Programming Components... 3 CSCI 171 Chapter 3 (Sections 1 4) Selection Structures... 5 CSCI 171 Chapter 3 (Sections 5 & 6) Iteration Structures

More information

Database System Concepts, 6 th Ed. Silberschatz, Korth and Sudarshan See for conditions on re-use

Database System Concepts, 6 th Ed. Silberschatz, Korth and Sudarshan See  for conditions on re-use Chapter 11: Indexing and Hashing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B + -Tree Index Files Static

More information

SMD149 - Operating Systems - File systems

SMD149 - Operating Systems - File systems SMD149 - Operating Systems - File systems Roland Parviainen November 21, 2005 1 / 59 Outline Overview Files, directories Data integrity Transaction based file systems 2 / 59 Files Overview Named collection

More information

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES OBJECTIVES Detailed description of various ways of organizing memory hardware Various memory-management techniques, including paging and segmentation To provide

More information

Chapter 12: Query Processing. Chapter 12: Query Processing

Chapter 12: Query Processing. Chapter 12: Query Processing Chapter 12: Query Processing Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 12: Query Processing Overview Measures of Query Cost Selection Operation Sorting Join

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and 64-bit Architectures Example:

More information

File Layout and Directories

File Layout and Directories COS 318: Operating Systems File Layout and Directories Jaswinder Pal Singh Computer Science Department Princeton University (http://www.cs.princeton.edu/courses/cos318/) Topics File system structure Disk

More information

Chapter 8: Main Memory. Operating System Concepts 9 th Edition

Chapter 8: Main Memory. Operating System Concepts 9 th Edition Chapter 8: Main Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel

More information

Storage hierarchy. Textbook: chapters 11, 12, and 13

Storage hierarchy. Textbook: chapters 11, 12, and 13 Storage hierarchy Cache Main memory Disk Tape Very fast Fast Slower Slow Very small Small Bigger Very big (KB) (MB) (GB) (TB) Built-in Expensive Cheap Dirt cheap Disks: data is stored on concentric circular

More information

ORC Files. Owen O June Page 1. Hortonworks Inc. 2012

ORC Files. Owen O June Page 1. Hortonworks Inc. 2012 ORC Files Owen O Malley owen@hortonworks.com @owen_omalley owen@hortonworks.com June 2013 Page 1 Who Am I? First committer added to Hadoop in 2006 First VP of Hadoop at Apache Was architect of MapReduce

More information

16 Sharing Main Memory Segmentation and Paging

16 Sharing Main Memory Segmentation and Paging Operating Systems 64 16 Sharing Main Memory Segmentation and Paging Readings for this topic: Anderson/Dahlin Chapter 8 9; Siberschatz/Galvin Chapter 8 9 Simple uniprogramming with a single segment per

More information

This project must be done in groups of 2 3 people. Your group must partner with one other group (or two if we have add odd number of groups).

This project must be done in groups of 2 3 people. Your group must partner with one other group (or two if we have add odd number of groups). 1/21/2015 CS 739 Distributed Systems Fall 2014 PmWIki / Project1 PmWIki / Project1 The goal for this project is to implement a small distributed system, to get experience in cooperatively developing a

More information

Comp 204: Computer Systems and Their Implementation. Lecture 25a: Revision Lectures (separate questions and answers)

Comp 204: Computer Systems and Their Implementation. Lecture 25a: Revision Lectures (separate questions and answers) Comp 204: Computer Systems and Their Implementation Lecture 25a: Revision Lectures (separate questions and answers) 1 Today Here are a sample of questions that could appear in the exam Please LET ME KNOW

More information

Package rhdf5. April 5, 2014

Package rhdf5. April 5, 2014 Package rhdf5 April 5, 2014 Type Package Title HDF5 interface to R Version 2.6.0 Author, Gregoire Pau Maintainer This R/Bioconductor package provides an interface between HDF5 and

More information

LECTURE 11. Memory Hierarchy

LECTURE 11. Memory Hierarchy LECTURE 11 Memory Hierarchy MEMORY HIERARCHY When it comes to memory, there are two universally desirable properties: Large Size: ideally, we want to never have to worry about running out of memory. Speed

More information

RFC: HDF5 File Space Management: Paged Aggregation

RFC: HDF5 File Space Management: Paged Aggregation RFC: HDF5 File Space Management: Paged Aggregation Vailin Choi Quincey Koziol John Mainzer The current HDF5 file space allocation accumulates small pieces of metadata and raw data in aggregator blocks.

More information

Memory Management. Dr. Yingwu Zhu

Memory Management. Dr. Yingwu Zhu Memory Management Dr. Yingwu Zhu Big picture Main memory is a resource A process/thread is being executing, the instructions & data must be in memory Assumption: Main memory is infinite Allocation of memory

More information

Operating Systems. Lecture File system implementation. Master of Computer Science PUF - Hồ Chí Minh 2016/2017

Operating Systems. Lecture File system implementation. Master of Computer Science PUF - Hồ Chí Minh 2016/2017 Operating Systems Lecture 7.2 - File system implementation Adrien Krähenbühl Master of Computer Science PUF - Hồ Chí Minh 2016/2017 Design FAT or indexed allocation? UFS, FFS & Ext2 Journaling with Ext3

More information

Accelerated Library Framework for Hybrid-x86

Accelerated Library Framework for Hybrid-x86 Software Development Kit for Multicore Acceleration Version 3.0 Accelerated Library Framework for Hybrid-x86 Programmer s Guide and API Reference Version 1.0 DRAFT SC33-8406-00 Software Development Kit

More information

Main Memory and the CPU Cache

Main Memory and the CPU Cache Main Memory and the CPU Cache CPU cache Unrolled linked lists B Trees Our model of main memory and the cost of CPU operations has been intentionally simplistic The major focus has been on determining

More information

Avro Specification

Avro Specification Table of contents 1 Introduction...2 2 Schema Declaration... 2 2.1 Primitive Types... 2 2.2 Complex Types...2 2.3 Names... 5 2.4 Aliases... 6 3 Data Serialization...6 3.1 Encodings... 7 3.2 Binary Encoding...7

More information

Background. 20: Distributed File Systems. DFS Structure. Naming and Transparency. Naming Structures. Naming Schemes Three Main Approaches

Background. 20: Distributed File Systems. DFS Structure. Naming and Transparency. Naming Structures. Naming Schemes Three Main Approaches Background 20: Distributed File Systems Last Modified: 12/4/2002 9:26:20 PM Distributed file system (DFS) a distributed implementation of the classical time-sharing model of a file system, where multiple

More information

So, coming back to this picture where three levels of memory are shown namely cache, primary memory or main memory and back up memory.

So, coming back to this picture where three levels of memory are shown namely cache, primary memory or main memory and back up memory. Computer Architecture Prof. Anshul Kumar Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture - 31 Memory Hierarchy: Virtual Memory In the memory hierarchy, after

More information

Basic Memory Management

Basic Memory Management Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester 10/15/14 CSC 2/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it

More information

Thrift specification - Remote Procedure Call

Thrift specification - Remote Procedure Call Erik van Oosten Revision History Revision 1.0 2016-09-27 EVO Initial version v1.1, 2016-10-05: Corrected integer type names. Small changes to section headers. Table of Contents 1.

More information

File Systems: Fundamentals

File Systems: Fundamentals 1 Files Fundamental Ontology of File Systems File Systems: Fundamentals What is a file? Ø A named collection of related information recorded on secondary storage (e.g., disks) File attributes Ø Name, type,

More information

File System Performance (and Abstractions) Kevin Webb Swarthmore College April 5, 2018

File System Performance (and Abstractions) Kevin Webb Swarthmore College April 5, 2018 File System Performance (and Abstractions) Kevin Webb Swarthmore College April 5, 2018 Today s Goals Supporting multiple file systems in one name space. Schedulers not just for CPUs, but disks too! Caching

More information

Chapter 12: File System Implementation

Chapter 12: File System Implementation Chapter 12: File System Implementation Chapter 12: File System Implementation File-System Structure File-System Implementation Directory Implementation Allocation Methods Free-Space Management Efficiency

More information

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it to be run Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester Mono-programming

More information

IME (Infinite Memory Engine) Extreme Application Acceleration & Highly Efficient I/O Provisioning

IME (Infinite Memory Engine) Extreme Application Acceleration & Highly Efficient I/O Provisioning IME (Infinite Memory Engine) Extreme Application Acceleration & Highly Efficient I/O Provisioning September 22 nd 2015 Tommaso Cecchi 2 What is IME? This breakthrough, software defined storage application

More information

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure. File Systems I/O Management Hard Drive Management Virtual Memory Swap Memory Management Storage and I/O Introduction CSI3131 Topics Process Management Computing Systems Memory CPU Peripherals Processes

More information

Chapter 13: Query Processing

Chapter 13: Query Processing Chapter 13: Query Processing! Overview! Measures of Query Cost! Selection Operation! Sorting! Join Operation! Other Operations! Evaluation of Expressions 13.1 Basic Steps in Query Processing 1. Parsing

More information