May 30-31, 2012 HDF5 Workshop at PSI May 30-31 HDF5 File Image Operations Dana Robinson The HDF Group Efficient Use of HDF5 With High Data Rate X-Ray Detectors.

Slides:



Advertisements
Similar presentations
Writing Modern C++ Marc Grégoire Software Architect April 3 rd 2012.
Advertisements

C Lab 3 C Arraylist Implementation. Goals ●Review ○ Referencing/Dereferencing ○ Free ●realloc and memmove ●ArrayList ●Debugging with GDB.
Discussion: Week 3/26. Structs: Used to hold associated data together Used to group together different types of variables under the same name struct Telephone{
Spark: Cluster Computing with Working Sets
Allocation Methods - Contiguous
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
Chapter 3.5 Memory and I/O Systems. Memory Management 2 Only applies to languages with explicit memory management (C, C++) Memory problems are one of.
Chapter 3.7 Memory and I/O Systems. 2 Memory Management Only applies to languages with explicit memory management (C or C++) Memory problems are one of.
CSE 451 Section 4 Project 2 Design Considerations.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Dynamic Allocation and Linked Lists. Dynamic memory allocation in C C uses the functions malloc() and free() to implement dynamic allocation. malloc is.
File System. NET+OS 6 File System Architecture Design Goals File System Layer Design Storage Services Layer Design RAM Services Layer Design Flash Services.
POSIX: Files Introduction to Operating Systems: Discussion 1 Read Solaris System Interface Guide: Ch. 5.1 Basic File I/O.
System Calls 1.
2011 Embedded Systems Software Training Center BluRapport SDK.
HDF 1 HDF5 Advanced Topics Object’s Properties Storage Methods and Filters Datatypes HDF and HDF-EOS Workshop VIII October 26, 2004.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
LWIP TCP/IP Stack 김백규.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
CS212: Object Oriented Analysis and Design Lecture 6: Friends, Constructor and destructors.
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
The HDF Group HDF5 Datasets and I/O Dataset storage and its effect on performance May 30-31, 2012HDF5 Workshop at PSI 1.
May 30-31, 2012 HDF5 Workshop at PSI May Writing Your Own HDF5 Virtual File Driver (VFD) Dana Robinson The HDF Group Efficient Use of HDF5 With High.
May 30-31, 2012 HDF5 Workshop at PSI May Single Writer / Multiple Reader (SWMR) Dana Robinson The HDF Group Efficient Use of HDF5 With High Data.
HDF Dimension Scales in HDF5 HDF-EOS Workshop IX San Francisco, CA November 30 - December 2, 2005 Pedro Vicente Nunes THG/NCSA Champaign-Urbana, IL HDF.
October 15, 2008HDF and HDF-EOS Workshop XII1 What will be new in HDF5?
C++ Review (3) Structs, Classes, Data Abstraction.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
Copyright 2004 Scott/Jones Publishing Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 7 Structured Data and Classes.
1 File Systems: Consistency Issues. 2 File Systems: Consistency Issues File systems maintains many data structures  Free list/bit vector  Directories.
1 HDF5 Life cycle of data Boeing September 19, 2006.
1 Pointers to structs. 2 A pointer to a struct is used in the same way as a pointer to a simple type, such as an int. Pointers to structs were introduced.
May 30-31, 2012 HDF5 Workshop at PSI May Shared Object Headers Dana Robinson The HDF Group Efficient Use of HDF5 With High Data Rate X-Ray Detectors.
CE Operating Systems Lecture 17 File systems – interface and implementation.
HDF5 Q4 Demo. Architecture Friday, May 10, 2013 Friday Seminar2.
CSCI 330 UNIX and Network Programming Unit VII: I/O Management I.
The HDF Group HDF5 Chunking and Compression Performance tuning 10/17/15 1 ICALEPCS 2015.
Lecture 10 Page 1 CS 111 Summer 2013 File Systems Control Structures A file is a named collection of information Primary roles of file system: – To store.
May 30-31, 2012 HDF5 Workshop at PSI May Partial Edge Chunks Dana Robinson The HDF Group Efficient Use of HDF5 With High Data Rate X-Ray Detectors.
ICOM 4035 – Data Structures Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 – August 23, 2001.
May 30-31, 2012 HDF5 Workshop at PSI May Metadata Journaling Dana Robinson The HDF Group Efficient Use of HDF5 With High Data Rate X-Ray Detectors.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
The HDF Group Font Test: Consolas and Courier New 1Copyright © 2013 The HDF Group. All rights reserved.
May 30-31, 2012 HDF5 Workshop at PSI May The HDF5 Virtual File Layer (VFL) and Virtual File Drivers (VFDs) Dana Robinson The HDF Group Efficient.
File Systems - Part I CS Introduction to Operating Systems.
Lecturer: Nguyen Thi Hien Software Engineering Department Home page: hienngong.wordpress.com Chapter 2: Language C++
MORE POINTERS Plus: Memory Allocation Heap versus Stack.
Linux Kernel Development Memory Management Pavel Sorokin Gyeongsang National University
Month Day(s), Year Event Title and Customer Name Single Writer / Multiple Reader (SWMR) Dana Robinson The HDF Group Efficient Use of HDF5 With High Data.
Real Numbers Device driver process within the operating system that interacts with I/O controller logical record 1 logical record 2 logical record 3.
Copyright © 2010 The HDF Group. All Rights Reserved1 Data Storage and I/O in HDF5.
KID - KLOE Integrated Dataflow
Module 11: File Structure
Operator overloading Conversions friend inline
HDF5 Metadata and Page Buffering
Java Beans Sagun Dhakhwa.
Current status and future work
C Basics.
Pointers and References
Chapter 11: File System Implementation
Introduction to Classes
CS212: Object Oriented Analysis and Design
Memory Allocation CS 217.
CSE 333 – Section 3 POSIX I/O Functions.
Moving applications to HDF
File Input and Output.
Elena Pourmal The HDF Group HDF Workshop July 17, 2018
Outline Chapter 2 (cont) Chapter 3: Processes Virtual machines
Pointers and References
Dynamic Array: Implementation of Stack
Presentation transcript:

May 30-31, 2012 HDF5 Workshop at PSI May HDF5 File Image Operations Dana Robinson The HDF Group Efficient Use of HDF5 With High Data Rate X-Ray Detectors Paul Scherrer Institut

May 30-31, 2012 HDF5 Workshop at PSI Purpose Allow users to work with files like how they do on disk. No disk I/O when file images are opened, created, read from, or written to. Faster access to data. Need to be careful about minimizing your memory footprint when working with large files.

May 30-31, 2012 HDF5 Workshop at PSI Use in pipelines Processing 1 HDF5 file 1) Processing step 1 opens the HDF5 file with the core VFD. HDF5 file

May 30-31, 2012 HDF5 Workshop at PSI Process 2 Use in pipelines Process 1 2) Buffer is sent to processing step 2. This saves writing the file to the filesystem. HDF5 file IPC

May 30-31, 2012 HDF5 Workshop at PSI Useful for MPI Process 0 Process 1 Process n config file 1) Process 0 reads configuration file. 2) File image is broadcast to other processes to open in memory. Process 2

May 30-31, 2012 HDF5 Workshop at PSI New API Functions H5Pget/set_file_image H5Pget/set_file_image_callbacks H5Fget_file_image H5LTopen_file_image (high-level convenience function)

May 30-31, 2012 HDF5 Workshop at PSI H5Pget/set_file_image herr_t H5Pget/set_file_image(hid_t fapl_id, void *buffer, size_t buf_len) Requires allocating a buffer, which is passed to the function. Designed for the core VFD but most VFDs can be modified to support using an initial image file. The buffer is copied in/out of the HDF5 library, not passed by reference! We will discuss ways around this…

May 30-31, 2012 HDF5 Workshop at PSI Digression: Property Lists Used frequently in the HDF5 library. Allow us to be flexible in passing parameters to functions without breaking the API. Use "pass by value" semantics, not "pass by reference" - Designed for moving small amounts of data around. - Greatly simplifies copying and deletion of property lists.

May 30-31, 2012 HDF5 Workshop at PSI Digression: Property Lists Unfortunately, passing very large buffers by value can bring a severe performance penalty. We have a few ways around this: - Use the H5LTopen_image_file call (discussed later) - Ignore the problem if the overhead is low (small files) - Use file image callbacks to implement call-by-reference semantics (discussed later)

May 30-31, 2012 HDF5 Workshop at PSI H5Fget_file_image ssize_t H5Fget_file_image(hid_t fapl_id, void *buffer, size_t buf_len) Provides a simple way to retrieve a copy of the image of an open file. You provide the buffer and the size. You can call the function with a null buffer pointer to get the current file size. Can be used with files opened with the SEC2, STDIO, and core VFDs.

May 30-31, 2012 HDF5 Workshop at PSI H5P_get/set_file_image_callbacks herr_t H5Pget/set_file_image_callbacks(hid_t fapl_id, H5_file_image_callbacks_t *callbacks_ptr) H5_file_image_callbacks_t is a struct containing function pointers which can be invoked on: image re/allocationimage free image copy It also contains a void pointer for user-specific data and function pointers which can be invoked on: user data copyuser data free

May 30-31, 2012 HDF5 Workshop at PSI H5P_get/set_file_image_callbacks The purpose of the callback functions are twofold: 1) Allow the user more careful control over the image in memory when resources are scarce (e.g.: when handling large files). 2) Allow the user to implement pass-by-reference semantics for the buffer.

May 30-31, 2012 HDF5 Workshop at PSI H5_file_image_callbacks_t typedef struct { void *(image_malloc)(size_t size, H5_file_image_op_t file_image_op, void *udata), void *(image_memcpy)(void *dest, void *src, size_t size, H5_file_image_op_t file_image_op, void *udata), void *(image_realloc)(void *ptr, size_t size, H5_file_image_op_t file_image_op, void *udata), herr_t *(image_free)(void *ptr, H5_file_image_op_t file_image_op, void *udata), void *(udata_copy)(void *udata), herr_t *(udata_free)(void *udata), void *udata; } H5_file_image_callbacks_t;

May 30-31, 2012 HDF5 Workshop at PSI H5P_get/set_file_image_callbacks void *(image_malloc)(size_t size, H5_file_image_op_t file_image_op, void *udata), The file_image_op parameter indicates which operation is taking place when the function was invoked. The image_malloc, realloc, free, and memcpy functions must have the same semantics as their C counterparts. Note that the memcpy and free calls can indicate failure in their return values, unlike their C counterparts.

May 30-31, 2012 HDF5 Workshop at PSI H5_file_image_op_t typedef enum { H5_FILE_IMAGE_OP_PROPERTY_LIST_SET, H5_FILE_IMAGE_OP_PROPERTY_LIST_COPY, H5_FILE_IMAGE_OP_PROPERTY_LIST_GET, H5_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, H5_FILE_IMAGE_OP_FILE_OPEN, H5_FILE_IMAGE_OP_FILE_RESIZE, H5_FILE_IMAGE_OP_FILE_CLOSE, } H5_file_image_op_t; These values indicate the operation in progress when the callback was invoked.

May 30-31, 2012 HDF5 Workshop at PSI Warning!!! Creating a full set of callback functions to control the behavior of the file image is likely to be a difficult process! The high-level function H5LTopen_file_image (discussed later) should be suitable in most cases.

May 30-31, 2012 HDF5 Workshop at PSI H5LTopen_file_image hid_t H5LTopen_file_image (void *buffer, size_t buf_len, unsigned flags) High-level convenience function to simplify buffer use. Allows the library to take control of the buffer with reasonable default behavior. Suitable for most uses.

May 30-31, 2012 HDF5 Workshop at PSI H5LTopen_file_image Bitwise flags: H5LT_FILE_IMAGE_OPEN_RW Open the image file with read/write permissions. H5LT_FILE_IMAGE_DONT_COPY Pass the buffer by reference instead of by value. The library will call free on the buffer. H5LT_FILE_IMAGE_DONT_RELEASE Do not free the image when the library is done with it. Also prohibits resizing/reallocating the buffer.

May 30-31, 2012 HDF5 Workshop at PSI Reading an in-memory image H5Pset_file_image(fapl_id, buffer, buf_len);

May 30-31, 2012 HDF5 Workshop at PSI H5LTopen_file_image example hid_t file_id; unsigned flags = H5LT_FILE_IMAGE_DONT_COPY; file_id = H5LTopen_file_image(buffer, buf_len, flags);

May 30-31, 2012 HDF5 Workshop at PSI Status Complete. Appeared in HDF (May 2012). Java and Fortran equivalents are not available at this time.