Www.hdfgroup.org The HDF Group Single Writer/Multiple Reader (SWMR) 110/17/15.

Slides:



Advertisements
Similar presentations
Operating Systems Semaphores II
Advertisements

Lectures on File Management
Configuration Management
Synchronization. How to synchronize processes? – Need to protect access to shared data to avoid problems like race conditions – Typical example: Updating.
The HDF Group November 3-5, 2009HDF/HDF-EOS Workshop XIII1 HDF5 Advanced Topics Elena Pourmal The HDF Group The 13 th HDF and HDF-EOS.
Full-Datapath Secure Deletion Sarah Diesburg 1. Overview Problem  Current secure deletion methods do not work State of the art  Optimistic system-wide.
Recovery 10/18/05. Implementing atomicity Note, when a transaction commits, the portion of the system implementing durability ensures the transaction’s.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Concurrent Processes Lecture 5. Introduction Modern operating systems can handle more than one process at a time System scheduler manages processes and.
Concurrency: Mutual Exclusion, Synchronization, Deadlock, and Starvation in Representative Operating Systems.
Distributed File System: Design Comparisons II Pei Cao Cisco Systems, Inc.
Distributed File System: Design Comparisons II Pei Cao.
Definitions Collaboration – working together on team projects and sharing information, often through ad-hoc processes, to accomplish project goals. Document.
DEMONSTRATION FOR SIGMA DATA ACQUISITION MODULES Tempatron Ltd Data Measurements Division Darwin Close Reading RG2 0TB UK T : +44 (0) F :
Memory Consistency Models Some material borrowed from Sarita Adve’s (UIUC) tutorial on memory consistency models.
Transactions and Reliability. File system components Disk management Naming Reliability  What are the reliability issues in file systems? Security.
HDF5 Tools Update Peter Cao - The HDF Group November 6, 2007 This report is based upon work supported in part by a Cooperative Agreement.
Parallel HDF5 Introductory Tutorial May 19, 2008 Kent Yang The HDF Group 5/19/20081SCICOMP 14 Tutorial.
The HDF Group April 17-19, 2012HDF/HDF-EOS Workshop XV1 Introduction to HDF5 Barbara Jones The HDF Group The 15 th HDF and HDF-EOS Workshop.
Lesson No:9 MS-Word Tools, Mail Merge and working with Tables CHBT-01 Basic Micro process & Computer Operation.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
1 High level view of HDF5 Data structures and library HDF Summit Boeing Seattle September 19, 2006.
The HDF Group Parallel HDF5 Design and Programming Model May 30-31, 2012HDF5 Workshop at PSI 1.
RFC: Breaking Free from the Collective Requirement for HDF5 Metadata Operations.
The HDF Group Virtual Object Layer in HDF5 Exploring new HDF5 concepts May 30-31, 2012HDF5 Workshop at PSI 1.
The HDF Group Multi-threading in HDF5: Paths Forward Current implementation - Future directions May 30-31, 2012HDF5 Workshop at PSI 1.
May 30-31, 2012HDF5 Workshop at PSI1 HDF5 at Glance Quick overview of known topics.
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 Single Writer / Multiple Reader (SWMR) Dana Robinson The HDF Group Efficient Use of HDF5 With High Data.
Page 110/19/2015 CSE 30341: Operating Systems Principles Chapter 10: File-System Interface  Objectives:  To explain the function of file systems  To.
April 28, 2008LCI Tutorial1 Introduction to HDF5 Tools Tutorial Part II.
The HDF Group HDF5 Tools Updates Peter Cao, The HDF Group September 28-30, 20101HDF and HDF-EOS Workshop XIV.
GroupWise 6.5 Junk Mail Handling July 28, Configuring Junk Mail Handling Junk Mail Handling enables you to have actions taken automatically on any.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Introduction to Concurrency.
4061 Session 23 (4/10). Today Reader/Writer Locks and Semaphores Lock Files.
October 15, 2008HDF and HDF-EOS Workshop XII1 What will be new in HDF5?
SPECULATIVE EXECUTION IN A DISTRIBUTED FILE SYSTEM E. B. Nightingale P. M. Chen J. Flint University of Michigan.
1 HDF5 Life cycle of data Boeing September 19, 2006.
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
September 9, 2008SPEEDUP Workshop - HDF5 Tutorial1 Introduction to HDF5 Command-line Tools.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
The HDF Group HDF5 Chunking and Compression Performance tuning 10/17/15 1 ICALEPCS 2015.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
CS510 Concurrent Systems Jonathan Walpole. RCU Usage in Linux.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
The HDF Group 10/17/151 HDF5 Tools Tutorial ICALEPCS 2015.
March 9, th International LCI Conference - HDF5 Tutorial1 HDF5 Advanced Topics.
The HDF Group New Elements and Lessons Learned for New Mission HDF5 Products Ideas for new mission HDF5 data products 1July 8, 2013 Larry.
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.
Lecture 20 FSCK & Journaling. FFS Review A few contributions: hybrid block size groups smart allocation.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
The HDF Group 10/17/151 Introduction to HDF5 ICALEPCS 2015.
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.
The HDF Group Single Writer/Multiple Reader (SWMR) 110/17/15.
The HDF Group Introduction to HDF5 Session 7 Datatypes 1 Copyright © 2010 The HDF Group. All Rights Reserved.
Import existing part with drawing
Copyright © 2010 The HDF Group. All Rights Reserved1 Data Storage and I/O in HDF5.
The HDF Group Introduction to HDF5 Session ? High Performance I/O 1 Copyright © 2010 The HDF Group. All Rights Reserved.
The HDF Group Introduction to HDF5 Session Three HDF5 Software Overview 1 Copyright © 2010 The HDF Group. All Rights Reserved.
HDF and HDF-EOS Workshop XII
Chapter 13: File-System Interface
Single Writer/Multiple Reader (SWMR)
HDF5 Metadata and Page Buffering
HDF5 Virtual Dataset Elena Pourmal Copyright 2017, The HDF Group.
Peter Cao The HDF Group November 28, 2006
Introduction to HDF5 Mike McGreevy The HDF Group
Moving applications to HDF
Chapter 15: File System Internals
Creating Additional Input Items
Presentation transcript:

The HDF Group Single Writer/Multiple Reader (SWMR) 110/17/15

SWMR Outline Introduction Current implementation SWMR programming model File locking under SWMR SWMR demo 2

INTRODUCTION 3 10/17/15 ICALPECS 2015

Basic Idea

SWMR Approach All communications between processes are done through the HDF5 file HDF5 file under SWMR access has to reside on the file system that complies with the POSIX write() semantics 10/17/155

Data access to file being written 10/17/156 HDF5 File WriterReader … which can be read by a reader… with no IPC necessary. New data elements … … are added to a dataset in the file…

The Challenge 10/17/157 HDF5 File Writer Reader The basic engineering challenge is to ensure that the readers always see a coherent (though possibly not up to date) HDF5 file. Data

Metadata Flush Dependencies (2 ) Suppose we have a metadata item which refers to another metadata item in the file. metadata item 1 metadata item 2 reference to address of metadata item 2

Metadata Flush Dependencies (3 ) If we add a new metadata item to the file and update the reference to point to it, we have to be careful about the order in which the metadata is flushed out of the cache. metadata item 1 metadata item 3 reference to address of new metadata item metadata item 2

HDF5 File WriterReader 1 1 (3 ) garbage? 2 2 If the reference-containing item is flushed before the new item, the reader may read the new reference before the item, creating an invalid state. BAD 10 Metadata Flush Dependencies

HDF5 File WriterReader 1 1 (3 ) (2 ) 2 2 If the new metadata item is flushed before the reference- containing item, the reader will not be fully up to date, but will still be consistent. 3 3 OK 11 Metadata Flush Dependencies

HDF5 File WriterReader 1 1 (3 ) (2 ) 2 2 Solution: HDF5 implements flush dependencies in the internal data structures to ensure that metadata cache flush operations occur in the proper order. 3 3 OK 12 Metadata Flush Dependencies

Data access to file being written 10/17/1513 Implemented for raw data “append only” scenario No creation or deletion of the datasets, groups, and attributes is allowed at this time Works on GPFS, Lustre, Linux Ext3, Ext4, FreeBSD USF2, OS X HDFS+ Does not work on NFS or Samba Documentation Source ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/SWMR/ ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/SWMR/ Testers are needed!

SWMR PROGRAMMING MODEL 10/17/1514 ICALPECS 2015

Setting SWMR writer 10/17/1515 Precondition Create a file with the latest file format; close the file. Writer Call H5Fopen using the H5F_ACC_SWMR_WRITE flag. Start writing datasets. or Writer Call H5Fcreate using the latest file format flag. Create groups, datasets; add attributes and close attributes. Call H5Fstart_swmr_write to start SWMR access to the file. Periodically flush data.

Setting SWMR reader 10/17/1516 Reader Call H5Fopen using the H5F_ACC_SWMR_READ flag. Poll, checking the size of the dataset to see if there is new data available for reading. Read new data, if any. Side affect of SWMR access Fault tolerance

Example of SWMR writer 10/17/1517 //Create the file using the latest file format property as shown fapl = H5Pcreate(H5P_FILE_ACCESS); H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); // Create file objects such as datasets and groups. // Close attributes and named datatypes objects. Groups and // datasets may remain open before starting SWMR access to // them. // Start SWMR access the file status = H5Fstart_swmr_write(fid); // Reopen datasets and start writing H5Dwrite(dset_id); H5Dflush(dset_id); // periodically to flush the data for a particular dataset.

Example of SWMR reader 10/17/1518 // Open the file using SWMR read flag fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, H5P_DEFAULT); // Open the dataset, poll dimensions, read new data and refresh; repeat. dset_id = H5Dopen(…); space_id = H5Dget_space; while (…) { H5Dread(…); // read if any new data arrives H5Drefresh; H5Dget_space(…); }

CONTROLLING SWMR ACCESS 10/17/1519 ICALPECS 2015

APIs for controlling SWMR writing and reading 10/17/1520 Application can control when data is visible using data flushing and refreshing: H5Dflush – flushes all buffers associated with a daatset H5Drefresh – clear the buffers and reload from the disk Application can control MDC flushing of an object: H5Odisable_mdc_flushes H5Oenable_mdc_flushes

APIs for controlling SWMR writing 10/17/1521 H5DOappend to append data to a dataset Extends dataspace and writes new elements APIs to control flush behavior when append reaches a specified boundary H5Pget(set)_append_flush() for a dataset access property list Calls the specified callback function Flushes the dataset H5Pget(set)_object_flush_cb() for a file access property list Sets a callback function to invoke when a object flush occurs in the files

H5WATCH AND OTHER TOOLS 10/17/1522 ICALPECS 2015

h5watch 10/17/1523 Allows to monitor the growth of a dataset Prints new elements whenever the application extends the size and adds data For compound datasets prints data for specified fields Example: h5watch --help h5watch --polling=5./f.h5/g/ds

Other command-line tools 10/17/1524 We plan to make h5dump and h5ls SWMR enabled The rest of the tools will exit gracefully reporting that the file is under constructions h5diff, h5repack, h5copy, h5jam, etc.

FILE LOCKING UNDER SWMR 10/17/1525 ICALPECS 2015

Concurrent Access to HDF5 file 10/17/1526 The HDF5 library will employ two means to regulate access to HDF5 files: File locking API calls to apply or remove an advisory lock on an open file. Setting a flag in the file’s superblock to mark the file as open for writing.

Concurrent Access to HDF5 file 10/17/1527 File locking API calls to apply or remove an advisory lock on an open file. Files will be locked during the H5Fopen() or H5Fcreate() call. Locks can be shared (read) or exclusive (write). Locks will lock the entire file, not regions in the file. When non-blocking lock calls are available, locks will not block. Locks will be released automatically when the file closes. Alternatively, the user can unlock the file using the system's unlock call, however care will have to be taken to match the HDF5 library's file locking scheme.

Concurrent Access to HDF5 file 10/17/1528 Setting a flag in the file’s superblock to mark the file as open for writing. The library will mark the file when opened for writing based on file open access flags. This will happen for both SWMR and non-SWMR reading. This marking ensures file consistency for concurrent accesses. The library will clear the flag when the file closes.

Writer Actions 10/17/1529 When a writer process creates/opens a file without SWMR: Place an exclusive lock on the file—the file will remain locked until it closes. Ensure the file's superblock is not already marked for writing or SWMR writing mode. Mark the file's superblock for writing mode. When a writer process creates/opens a file with SWMR write access: Place an exclusive lock on the file. Ensure the file's superblock is not already marked for writing or SWMR writing mode. Mark the file for writing and SWMR writing mode. Release the lock before returning from H5Fopen/H5Fcreate.

Reader Actions 10/17/1530 When a reader process opens a file without SWMR: Place a shared lock on the file. Ensure the file is not already marked for writing or SWMR writing mode. When a reader process opens a file with SWMR read: Place a shared lock on the file. Ensure the file is marked in writing and SWMR writing mode

SWMR Compatibility Matrix 10/17/1531

SWMR Compatibility Matrix 10/17/1532

Is an HDF5 file under SWMR access? 10/17/1533 We provide APIs to get information on a file access under SWMR: Does H5Fopen fails because of the existing file lock? H5LTcheck_lock_error (under implementation) When H5Fopen succeeds, is a file accessed by a SWMR writer? H5Fget_intent

Demo 10/17/1534 HDF5 provides some tests you may try; see SWMR UG, section 6. We will be using test/use_append_chunk to write 3D dataset by planes (chunks 1x2056x256). Use h5watch to see data coming Interrupt use_append_chunk Use h5clear tool to clear the flags Use h5dump to see data chunksize

The HDF Group Thank You! Questions? 3510/17/15