1 Error Handling Interface HDF-EOS Workshop IX Quincey Koziol and Ray Lu 30 Nov 2005.

Slides:



Advertisements
Similar presentations
L7: Exceptions Problem Description Error Handling –terminate the program –return a value representing an error –return a legal value and leave the program.
Advertisements

Linux device-driver issues
MPI Message Passing Interface
R4 Dynamically loading processes. Overview R4 is closely related to R3, much of what you have written for R3 applies to R4 In R3, we executed procedures.
CS 450 Module R3. Next Week R2 is due next Friday ▫Make sure to correct all errors with R1 ▫Correct errors in the documentation as well, it will be checked.
David Notkin Autumn 2009 CSE303 Lecture 13 This space for rent.
The HDF Group HDF/HDF-EOS Workshop XIV1 Easy Remote Access via OPeNDAP Kent Yang and Joe Lee The HDF Group The 14 th HDF/HDF-EOS Workshop.
The HDF Group November 3-5, 2009HDF/HDF-EOS Workshop XIII1 HDF-Java Products Peter Cao The HDF Group The 13 th HDF and HDF-EOS Workshop.
The HDF Group November 3-5, 2009HDF/HDF-EOS Workshop XIII1 Using visualization tools to access HDF data via OPeNDAP Joe Lee and Kent Yang.
HDF5 OPeNDAP Project Update and Demo MuQun Yang and Hyo-Kyung Lee (The HDF Group) James Gallagher (OPeNDAP, Inc.)
Chapter 11: Data Files & File Processing In this chapter, you will learn about Files and streams Creating a sequential access file Reading data from a.
The HDF Group HDF4 Mapping Status and Proposal Mike Folk, Ruth Aydt The HDF Group Oct. 17, 2012 Apr , 2012HDF/HDF-EOS Workshop XV.
Exceptions in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
© 2007 The MathWorks, Inc. ® ® Using HDF5 in MATLAB Jeff Mather The MathWorks HDF/HDF-EOS Workshop XI (Nov. 2007)
CSE 451 Section 4 Project 2 Design Considerations.
The HDF Group July 8, 2014HDF 2014 ESIP Summer Meeting HDF Product Designer Aleksandar Jelenak, H. Joe Lee, Ted Habermann The.
Ensuring Long Term Access to Remotely Sensed HDF4 Data with Layout Maps Mike Folks, The HDF Group Ruth Duerr, NSIDC 1.
IDigBio is funded by a grant from the National Science Foundation’s Advancing Digitization of Biodiversity Collections Program (Cooperative Agreement EF ).
HDF5 Tools Update Peter Cao - The HDF Group November 6, 2007 This report is based upon work supported in part by a Cooperative Agreement.
Experiments with Remote Access to Scientific Data using HDF5 Kun Yan Robert E. McGrath NCSA May 15, 2002.
EOSDIS User survey follow-up Mike Folk, Kent Yang, Elena Pourmal The HDF Group Oct. 17, 2012 Annual HDF Briefing to ESDIS1.
HDF Windows Support MuQun Yang, Xuan Bai, Elena Pourmal, Barbara Jones, Pedro Vincent, Robert E. McGrath National Center for Supercomputing Applications.
NASA EOS DATA COMPRESSION WITH HDF5 SCALEOFFSET FILTER This work was funded by the NASA Earth Science Technology Office under NASA award AIST and.
Important ESDIS 2009 tasks review Kent Yang, Mike Folk The HDF Group April 1st, /1/20151Annual briefing to ESDIS.
1 Introduction to HDF5 Data Model, Programming Model and Library APIs HDF and HDF-EOS Workshop VIII October 26, 2004.
December 1, 2005HDF & HDF-EOS Workshop IX P eter Cao, NCSA December 1, 2005 Sponsored by NLADR, NFS PACI Project in Support of NCSA-SDSC Collaboration.
HDF Converting between HDF4 and HDF5 MuQun Yang, Robert E. McGrath, Mike Folk National Center for Supercomputing Applications University of Illinois,
Operating Systems Chapter 2
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.
Support for NPP/NPOESS by The HDF Group Mike Folk The HDF Group HDF and HDF-EOS Workshop XII October 17, 2008 Oct HDF and HDF-EOS Workshop XII1.
11/7/2007HDF and HDF-EOS Workshop XI, Landover, MD1 HDF5 Software Process MuQun Yang, Quincey Koziol, Elena Pourmal The HDF Group.
The HDF Group November 3-5, 2009 HDF-OPeNDAP Project Update HDF/HDF-EOS Workshop XIII1 Joe Lee and Kent Yang The HDF Group James Gallagher.
Ensuring Long Term Access to Remotely Sensed HDF4 Data with Layout Maps Ruth Duerr, NSIDC Christopher Lynnes, GES DISC The HDF Group Oct HDF and.
October 15, 2008HDF and HDF-EOS Workshop XII1 What will be new in HDF5?
Integrating HDF5 with SRB The HDF5-SRB Architecture Peter Cao, HDF, NCSA February 24, 2005.
HDF5 OPeNDAP Project Update and Demo MuQun Yang and Hyo-Kyung Lee (The HDF Group) James Gallagher (OPeNDAP, Inc.) 1HDF and HDF-EOS Workshop XII10/17/2008.
CS252: Systems Programming Ninghui Li Based on Slides by Prof. Gustavo Rodriguez-Rivera Topic 8: Opening Files and Starting Processes.
1 N-bit and ScaleOffset filters MuQun Yang National Center for Supercomputing Applications University of Illinois at Urbana-Champaign Urbana, IL
HDF OPeNDAP Project Update MuQun Yang and Hyo-Kyung Lee The HDF Group March 31, Annual briefing to ESDIS10/31/2015.
1 Introduction to HDF5 Data Model, Programming Model and Library APIs HDF and HDF-EOS Workshop IX November 30, 2005.
- 1 - HDF5, HDF-EOS and Geospatial Data Archives HDF and HDF-EOS Workshop VII September 24, 2003.
The HDF Group Support for NPP/NPOESS by The HDF Group Mike Folk, Elena Pourmal, Peter Cao The HDF Group November 5, 2009 November 3-5,
HDF Windows Support MuQun Yang, Xuan Bai, Elena Pourmal, Barbara Jones, Pedro Vincent, Robert E. McGrath National Center for Supercomputing Applications.
Multi-Tasking The Multi-Tasking service is offered by VxWorks with its real- time kernel “WIND”.
HDF5 OPeNDAP Project Update and Demo MuQun Yang and Hyo-Kyung Lee (The HDF Group) James Gallagher (OPeNDAP, Inc.) 1 HDF and HDF-EOS Workshop XII10/17/2008.
Using a Friendly OPeNDAP Client Library to Access HDF5 Data MuQun Yang and Hyo-Kyung Lee (The HDF Group) 1 25th IIPS Conference01/14/2009.
HDF5 OPeNDAP Project Update and Demo MuQun Yang and Hyo-Kyung Lee (The HDF Group) James Gallagher (OPeNDAP, Inc.) 1HDF and HDF-EOS Workshop XII, Aurora,
HDF and HDF-EOS Workshop VIII, October 26-28, /12 Peter Cao, National Center for Supercomputing Applications Ray Milnurn, Dave Buto, L-3 Communications.
HDF5 Q4 Demo. Architecture Friday, May 10, 2013 Friday Seminar2.
HDF and HDF-EOS Workshop VII September 24, 2003 HDF5, HDF-EOS and Geospatial Data Archives Don Keefer Illinois State Geological Survey Mike Folk Univ.
10/16/2012Annual HDF briefing1 HDF OPeNDAP support Kent Yang, Joe Lee, Mike Folk The HDF Group Oct. 16, 2012.
11/8/2007HDF and HDF-EOS Workshop XI, Landover, MD1 Software to access HDF5 Datasets via OPeNDAP MuQun Yang, Hyo-Kyung Lee The HDF Group.
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.
October 15-17, 2008HDF and HDF-EOS Workshop XII1 HDF-Java Products Peter Cao The HDF Group HDF and HDF-EOS Workshop XII October 15, 2008.
The HDF Group November 3-5, 2009HDF/HDF-EOS Workshop XIII1 The New HDF-EOS Web Site - How it can help you Kent Yang, Joe Lee The HDF Group.
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
Support for NPP/NPOESS by The HDF Group Mike Folk, Elena Pourmal The HDF Group Annual HDF Briefing to ESDIS March 31, 2009 March Annual HDF Briefing.
EPICS Device Support Library Motivating factorsMotivating factors Quick tour of the APIQuick tour of the API Some examplesSome examples.
1 Introduction to HDF5 Programming and Tools Boeing September 19, 2006.
Process Related System Calls By Neha Hulkoti & Kavya Bhat.
HDF5 OPeNDAP Project Update and Demo MuQun Yang and Hyo-Kyung Lee (The HDF Group) James Gallagher (OPeNDAP, Inc.) 1HDF and HDF-EOS Workshop XII, Aurora,
Adding CF Attributes to an HDF5 File
Parallel HDF5 Introductory Tutorial
Access HDF5 Datasets via OPeNDAP’s Data Access Protocol (DAP)
Moving applications to HDF
CSE 333 – Section 3 POSIX I/O Functions.
Dimension Scales in HDF-EOS2 & HDF-EOS5
HDF5 Tools Updates and Discussions
LabVenture! Redesigning to Maximize Transfer Inside/Outside School
This material is based upon work supported by the National Science Foundation under Grant #XXXXXX. Any opinions, findings, and conclusions or recommendations.
Presentation transcript:

1 Error Handling Interface HDF-EOS Workshop IX Quincey Koziol and Ray Lu 30 Nov 2005

2 Contents I.Basic concepts II.Basic error operations III.Advanced error operations

3 Basic Concepts An example: HDF5-DIAG: Error detected in HDF5 (1.7.52) thread 0: #000:../../hdf5_1.7/src/H5D.c line 1175 in H5Dcreate(): not a location ID #000:../../hdf5_1.7/src/H5D.c line 1175 in H5Dcreate(): not a location ID major: Invalid arguments to routine major: Invalid arguments to routine minor: Inappropriate type minor: Inappropriate type #001:../../hdf5_1.7/src/H5Gloc.c line 162 in H5G_loc(): invalid object ID #001:../../hdf5_1.7/src/H5Gloc.c line 162 in H5G_loc(): invalid object ID major: Invalid arguments to routine major: Invalid arguments to routine minor: Bad value minor: Bad value Library’s error report: automatic automatic reset for each API function call. reset for each API function call.Concepts: Error stack Error stack Error record Error record Error message: major and minor Error message: major and minor Error description Error description

4 Basic Error Operations 1. To print error stack explicitly: H5Eprint_stack(hid_t error_stack, FILE* stream) 2. To clear error stack: H5Eclear_stack(hid_t error_stack) 3. To disable error stack printing: H5Eset_auto_stack(hid_t error_stack, H5E_auto_stack_t func, void *client_data) H5Eget_auto_stack(hid_t error_stack, H5E_auto_stack_t *func, void *client_data) typedef herr_t (*H5E_auto_stack_t)(hid_t estack, void *client_data)

5 Basic Error Operations Example: Turn off error printing while “probing” a function. /* Save old error handler */ H5E_auto_stack_t old_func; void *old_client_data; H5Eget_auto_stack(error_stack, &old_func, &old_client_data); /* Turn off error handling */ H5Eset_auto_stack(error_stack, NULL, NULL); /* Probe. Likely to fail, but that’s okay */ status = H5Fopen(……); : /* Restore previous error handler */ H5Eset_auto_stack(error_stack, old_func, old_client_data); Another example: the library provides a cleaner way to do the same. H5E_BEGIN_TRY { status = H5Fopen(……); } H5E_END_TRY;

6 Basic Error Operations 4. To customize printing of error stack: Example: herr_t my_hdf5_error_print(hid_t err_stack, void *unused){ fprintf (stderr, "An HDF5 error was detected. Bye.\n"); exit (1); } The function is installed as the error handler by saying H5Eset_auto_stack(H5E_DEFAULT, my_hdf5_error_handler, NULL);

7 Basic Error Operations 5. To walk through error stack: H5Ewalk_stack(hid_t err_stack, H5E_direction_t dir, H5E_walk_t func, void *client_data) typedef herr_t (*H5E_walk_t)(unsigned n, H5E_error_t *eptr, void *client_data) typedef struct { hid_t cls_id; hid_t maj_num; hid_t min_num; const char *func_name; const char *file_name; unsigned line; const char *desc; } H5E_error_t;

8 Advanced Error Operations A new feature to allow application to push its own error records onto the HDF5 error stack. Example: Error Test-DIAG: Error detected in Error Program (1.0) thread 0: #000:../../hdf5_1.7/test/error_example.c line 164 in advanced_operations(): H5Dcreate failed #000:../../hdf5_1.7/test/error_example.c line 164 in advanced_operations(): H5Dcreate failed major: Error in API major: Error in API minor: Error in H5Dcreate minor: Error in H5Dcreate HDF5-DIAG: Error detected in HDF5 (1.7.52) thread 0: #001:../../hdf5_1.7/src/H5D.c line 1175 in H5Dcreate(): not a location ID #001:../../hdf5_1.7/src/H5D.c line 1175 in H5Dcreate(): not a location ID major: Invalid arguments to routine major: Invalid arguments to routine minor: Inappropriate type minor: Inappropriate type #002:../../hdf5_1.7/src/H5Gloc.c line 162 in H5G_loc(): invalid object ID #002:../../hdf5_1.7/src/H5Gloc.c line 162 in H5G_loc(): invalid object ID major: Invalid arguments to routine major: Invalid arguments to routine minor: Bad value minor: Bad value More concepts: Error class Error class Library name Library name Library version Library version

9 Advanced Error Operations 1. To register application with error API: H5Eregister_class(const char* cls_name, const char* lib_name, const char* version) H5Ecreate_msg(hid_t class, H5E_type_t msg_type, const char* mesg) H5Eget_class_name(hid_t class_id, char* name, size_t size) H5Eget_msg(hid_t mesg_id, H5E_type_t* mesg_type, char* mesg, size_t size) H5Eclose_msg(hid_t mesg_id) H5Eunregister_class(hid_t class_id)

10 Advance Error Operations Example: An application creates an error class and error messages. /* Create an error class */ class_id = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS); /* Create a major error message in the class */ maj_id = H5Ecreate_msg(class_id, H5E_MAJOR, “… …”); /* Create a minor error message in the class */ min_id = H5Ecreate_msg(class_id, H5E_MINOR, “… …”); Application closes error messages and un-registers error class. H5Eclose_msg(maj_id);H5Eclose_msg(min_id);H5Eunregister_class(class_id);

11 Advanced Error Operations 2. To manipulate error stack: H5Eget_current_stack(void) H5Eset_current_stack(hid_t error_stack) H5Epush_stack(hid_t error_stack, const char* file, const char* func, unsigned line, hid_t cls_id, hid_t major_id, hid_t minor_id, const char* desc, … ) H5Epop(hid_t error_stack, size_t count) H5Eget_num(hid_t error_stack) H5Eclear_stack(hid_t error_stack) H5Eclose_stack(hid_t error_stack)

12 Advanced Error Operations Example: /* Make call to HDF5 I/O routine */ if((dataset = H5Dcreate(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT))<0) { /* Push client error onto error stack */ H5Epush_stack(H5E_DEFAULT, __FILE__, FUNC_adv, __LINE__, ERR_CLS, ERR_MAJ_API, ERR_MIN_CREATE, "H5Dcreate failed"); "H5Dcreate failed"); /* Print the error stack explicitly */ H5Eprint_stack(H5E_DEFAULT, stderr); }

13 Advanced Error Operations Another example: H5E_BEGIN_TRY { ret = H5Dwrite(dset_id, mem_type_id, mem_space_id, file_space_id, dset_xfer_plist_id, buf); } H5E_END_TRY; if(ret<0) { /* Push client error onto error stack */ H5Epush_stack(H5E_DEFAULT,FILE,FUNC,LINE,cls_id, CLIENT_ERR_MAJ_IO, CLIENT_ERR_MINOR_HDF5,"H5Dwrite failed"); /* Preserve the error stack by assigning an object handle to it */ error_stack = H5Eget_current_stack(); /* Close dataset */ H5Dclose(dset_id); /* Replace the current error stack with the preserved one */ H5Eset_current_stack(error_stack);Return(1);}

14 Contents I.Basic concepts II.Basic error operations III.Advanced error operations

15 Documents User ’ s Guide: ErrorAPI,DataConversion/ErrorHandling-H5E-July05.pdf Reference Manual: Acknowledgement: This presentation is based upon work supported in part by a Cooperative Agreement with the National Aeronautics and Space Administration (NASA) under NASA grant NNG05GC60A. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of NASA. Other support provided by NCSA and other sponsors and agencies ( This presentation is based upon work supported in part by a Cooperative Agreement with the National Aeronautics and Space Administration (NASA) under NASA grant NNG05GC60A. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of NASA. Other support provided by NCSA and other sponsors and agencies (