diff options
-rw-r--r-- | pablo/HDFentries.txt | 976 | ||||
-rw-r--r-- | pablo/Makefile.in | 1423 | ||||
-rw-r--r-- | pablo/PabloHDF.c | 862 | ||||
-rw-r--r-- | pablo/PabloHDF_RT.c | 1473 | ||||
-rw-r--r-- | pablo/PabloHDF_SDDF.c | 1028 |
5 files changed, 5762 insertions, 0 deletions
diff --git a/pablo/HDFentries.txt b/pablo/HDFentries.txt new file mode 100644 index 0000000..578eb58 --- /dev/null +++ b/pablo/HDFentries.txt @@ -0,0 +1,976 @@ +DFANaddfds +DFANaddfid +DFANgetdesc +DFANgetdesclen +DFANgetfds +DFANgetfdslen +DFANgetfid +DFANgetfidlen +DFANgetlabel +DFANgetlablen +DFANlablist +DFANlastref +DFANputdesc +DFANputlabel +DFANclear +DFPaddpal +DFPgetpal +DFPlastref +DFPnpals +DFPputpal +DFPreadref +DFPrestart +DFPwriteref +DFR8addimage +DFR8getdims +DFR8getimage +DFR8lastref +DFR8nimages +DFR8putimage +DFR8readref +DFR8restart +DFR8setcompress +DFR8setpalette +DFR8writeref +DFR8Istart +DFSDadddata +DFSDclear +DFSDendslab +DFSDendslice +DFSDgetcal +DFSDgetdata +DFSDgetdatalen +DFSDgetdatastrs +DFSDgetdimlen +DFSDgetdims +DFSDgetdimscale +DFSDgetdimstrs +DFSDgetfillvalue +DFSDgetNT +DFSDgetrange +DFSDgetslice +DFSDlastref +DFSDndatasets +DFSDpre32sdg +DFSDputdata +DFSDputslice +DFSDreadref +DFSDreadslab +DFSDrestart +DFSDsetcal +DFSDsetdatastrs +DFSDsetdims +DFSDsetdimscale +DFSDsetdimstrs +DFSDsetfillvalue +DFSDsetlengths +DFSDsetNT +DFSDsetrange +DFSDstartslab +DFSDstartslice +DFSDwriteref +DFSDwriteslab +DF24addimage +DF24getdims +DF24getimage +DF24lastref +DF24nimages +DF24putimage +DF24readref +DF24reqil +DF24restart +DF24setcompress +DF24setdims +DF24setil +Happendable +Hclose +Hdeldd +Hdupdd +Hendaccess +Hfind +Hgetelement +Hgetfileversion +Hgetlibversion +Hinquire +Hishdf +HLcreate +Hlength +Hnewref +Hnextread +Hnumber +Hoffset +Hopen +Hputelement +Hread +Hseek +Hstartread +Hstartwrite +Hsync +Htrunc +Hwrite +HXcreate +HXsetcreatedir +HXsetdir +HLconvert +Hstartaccess +Hisappendable +Htell +Htagnewref +Hcache +Hsetaccesstype +Hexist +Hsetlength +Hfidinquire +HDdont_atexit +HDreuse_tagref +HIstart +HPregister_term_func +HIbitstart +HMCcreate +HMCsetMaxcache +HMCPstread +HMCPstwrite +HMCPseek +HMCPchunkread +HMCreadChunk +HMCPread +HMCPchunkwrite +HMCwriteChunk +HMCPwrite +HMCPendaccess +HMCPinfo +HMCPinquire +HEclear +HEprint +HEpush +HEreport +HEstring +SDattrinfo +SDcreate +SDdiminfo +SDend +SDendaccess +SDfileinfo +SDfindattr +SDgetcal +SDgetchunkinfo +SDgetdatastrs +SDgetdimid +SDgetdimscale +SDgetdimstrs +SDgetfillvalue +SDgetinfo +SDgetrange +SDidtoref +SDiscoordvar +SDisdimval_bwcomp +SDisrecord +SDnametoindex +SDreadattr +SDreadchunk +SDreaddata +SDreftoindex +SDselect +SDsetaccesstype +SDsetattr +SDsetblocksize +SDsetcal +SDsetchunk +SDsetchunkcache +SDsetcompress +SDsetdatastrs +SDsetdimname +SDsetdimscale +SDsetdimstrs +SDsetdimval_comp +SDsetexternalfile +SDsetfillmode +SDsetfillvalue +SDsetnbitdataset +SDsetrag +SDsetrange +SDstart +SDwritechunk +SDwritedata +VFfieldesize +VFfieldisize +VFfieldname +VFfieldorder +VFfieldtype +VFnfields +Vaddtagref +Vattach +Vdeletetagref +Vdetach +Vgetclass +Vgetid +Vgetname +Vgettagref +Vgettagrefs +Vinqtagref +Vinquire +Vinsert +Vlone +Vntagrefs +Vsetclass +Vsetname +Vinitialize +Vfinish +Vfind +Vfindclass +vpackvs +vunpackvs +vpackvg +vunpackvg +Vsetattr +Vgetversion +Vnattrs +Vfindattr +Vattrinfo +Vgetattr +VHmakegroup +VHstoredata +VHstoredatam +VSattach +VSdetach +VSelts +VSfdefine +VSfexist +VSfind +VSgetclass +VSgetfields +VSgetid +VSgetinterlace +VSgetname +VSinquire +VSlone +VSread +VSseek +VSsetclass +VSsetfields +VSsetinterlace +VSsetname +VSsizeof +VSwrite +VSappendable +VSdelete +VSfindclass +VSfpack +VSfindex +VSsetattr +VSnattrs +VSfnattrs +VSfindattr +VSattrinfo +VSgetattr +VSisattr +ANstart +ANfileinfo +ANend +ANcreate +ANcreatef +ANselect +ANnumann +ANannlist +ANannlen +ANreadann +ANwriteann +ANendaccess +GRstart +GRfileinfo +GRend +GRcreate +GRselect +GRnametoindex +GRgetiminfo +GRwriteimage +GRreadimage +GRendaccess +GRgetdimid +GRsetdimname +GRdiminfo +GRidtoref +GRreftoindex +GRreqlutil +GRreqimageil +GRgetlutid +GRgetlutinfo +GRwritelut +GRreadlut +GRsetexternalfile +GRsetaccesstype +GRsetcompress +GRsetattr +GRattrinfo +GRgetattr +GRfindattr +GRluttoref +GRsetchunk +GRgetchunkinfo +GRsetchunkcache +HAinit_group +HAdestroy_group +HAregister_atom +HAatom_object +HAatom_group +HAremove_atom +HAsearch_atom +DAcreate_array +DAdestroy_array +DAsize_array +DAget_elem +DAset_elem +DAdel_elem +HULcreate_list +HULdestroy_list +HULadd_node +HULsearch_node +HULfirst_node +HULnext_node +HULremove_node +HDFnewentry +SDcheckempty +H5AC_create +H5AC_debug +H5AC_dest +H5AC_find +H5AC_flush +H5AC_protect +H5AC_rename +H5AC_set +H5AC_unprotect +H5A_close +H5A_copy +H5A_create +H5A_entof +H5A_get_index +H5A_init_interface +H5A_open +H5A_read +H5A_write +H5Aclose +H5Acreate +H5Aget_name +H5Aget_num_attrs +H5Aget_space +H5Aget_type +H5Aiterate +H5Aopen_idx +H5Aopen_name +H5Aread +H5Awrite +H5B_assert +H5B_create +H5B_debug +H5B_decode_key +H5B_decode_keys +H5B_find +H5B_flush +H5B_insert +H5B_insert_child +H5B_insert_helper +H5B_iterate +H5B_load +H5B_nodesize +H5B_remove +H5B_remove_helper +H5B_split +H5D_allocate +H5D_close +H5D_create +H5D_extend +H5D_get_space +H5D_init_interface +H5D_init_storage +H5D_open +H5D_read +H5D_typeof +H5D_write +H5Dclose +H5Dcreate +H5Dextend +H5Dget_create_plist +H5Dget_space +H5Dget_type +H5Dopen +H5Dread +H5Dwrite +H5E_clear +H5E_walk +H5Eclear +H5Eget_auto +H5Eprint +H5Eset_auto +H5Ewalk +H5F_addr_cmp +H5F_addr_defined +H5F_addr_zerop +H5F_arr_create +H5F_arr_read +H5F_arr_write +H5F_block_read +H5F_block_write +H5F_close +H5F_compare_files +H5F_core_access +H5F_core_close +H5F_core_open +H5F_core_read +H5F_core_write +H5F_debug +H5F_dest +H5F_fam_access +H5F_fam_close +H5F_fam_flush +H5F_fam_open +H5F_fam_read +H5F_fam_write +H5F_flush +H5F_init_interface +H5F_istore_allocate +H5F_istore_cmp2 +H5F_istore_cmp3 +H5F_istore_create +H5F_istore_debug +H5F_istore_debug_key +H5F_istore_decode_key +H5F_istore_dest +H5F_istore_encode_key +H5F_istore_flush +H5F_istore_flush_entry +H5F_istore_found +H5F_istore_get_addr +H5F_istore_init +H5F_istore_insert +H5F_istore_lock +H5F_istore_new_node +H5F_istore_preempt +H5F_istore_prune +H5F_istore_read +H5F_istore_stats +H5F_istore_unlock +H5F_istore_write +H5F_locate_signature +H5F_low_alloc +H5F_low_class +H5F_low_close +H5F_low_flush +H5F_low_open +H5F_low_read +H5F_low_seteof +H5F_low_size +H5F_low_write +H5F_mount +H5F_mountpoint +H5F_mpio_access +H5F_mpio_close +H5F_mpio_flush +H5F_mpio_open +H5F_mpio_read +H5F_mpio_tas_allsame +H5F_mpio_write +H5F_new +H5F_open +H5F_sec2_close +H5F_sec2_open +H5F_sec2_read +H5F_sec2_write +H5F_split_access +H5F_split_alloc +H5F_split_close +H5F_split_extend +H5F_split_flush +H5F_split_open +H5F_split_read +H5F_split_write +H5F_stdio_close +H5F_stdio_flush +H5F_stdio_open +H5F_stdio_read +H5F_stdio_write +H5F_unmount +H5Fclose +H5Fcreate +H5Fflush +H5Fget_access_plist +H5Fget_create_plist +H5Fis_hdf5 +H5Fmount +H5Fopen +H5Funmount +H5G_basename +H5G_close +H5G_create +H5G_ent_cache +H5G_ent_debug +H5G_ent_decode +H5G_ent_decode_vec +H5G_ent_encode +H5G_ent_encode_vec +H5G_ent_modified +H5G_find +H5G_get_comment +H5G_get_objinfo +H5G_getcwg +H5G_init_interface +H5G_insert +H5G_link +H5G_linkval +H5G_loc +H5G_mkroot +H5G_move +H5G_namei +H5G_node_cmp2 +H5G_node_cmp3 +H5G_node_create +H5G_node_debug +H5G_node_decode_key +H5G_node_encode_key +H5G_node_flush +H5G_node_found +H5G_node_insert +H5G_node_iterate +H5G_node_load +H5G_node_remove +H5G_open +H5G_pop +H5G_push +H5G_reopen +H5G_set +H5G_set_comment +H5G_stab_create +H5G_stab_find +H5G_stab_insert +H5G_stab_remove +H5G_traverse_slink +H5G_unlink +H5Gclose +H5Gcreate +H5Gget_comment +H5Gget_linkval +H5Gget_objinfo +H5Giterate +H5Glink +H5Gmove +H5Gopen +H5Gpop +H5Gpush +H5Gset +H5Gset_comment +H5Gunlink +H5HG_alloc +H5HG_create +H5HG_debug +H5HG_flush +H5HG_insert +H5HG_link +H5HG_load +H5HG_peek +H5HG_read +H5HG_remove +H5HL_create +H5HL_debug +H5HL_flush +H5HL_insert +H5HL_load +H5HL_peek +H5HL_read +H5HL_remove +H5HL_write +H5I_dec_ref +H5I_destroy_group +H5I_find_id +H5I_get_id_node +H5I_get_type +H5I_group +H5I_inc_ref +H5I_init_group +H5I_init_interface +H5I_object +H5I_register +H5I_release_id_node +H5I_remove +H5I_search +H5Iget_type +H5MF_acceptable +H5MF_alloc +H5MF_realloc +H5MF_xfree +H5MM_strdup +H5O_alloc +H5O_alloc_extend_chunk +H5O_alloc_new_chunk +H5O_attr_copy +H5O_attr_debug +H5O_attr_decode +H5O_attr_encode +H5O_attr_reset +H5O_attr_size +H5O_close +H5O_cont_debug +H5O_cont_decode +H5O_cont_encode +H5O_copy +H5O_count +H5O_create +H5O_debug +H5O_dtype_copy +H5O_dtype_debug +H5O_dtype_decode +H5O_dtype_decode_helper +H5O_dtype_encode +H5O_dtype_encode_helper +H5O_dtype_get_share +H5O_dtype_reset +H5O_dtype_set_share +H5O_dtype_size +H5O_efl_copy +H5O_efl_debug +H5O_efl_decode +H5O_efl_encode +H5O_efl_read +H5O_efl_reset +H5O_efl_size +H5O_efl_total_size +H5O_efl_write +H5O_find_in_ohdr +H5O_fill_decode +H5O_fill_encode +H5O_fill_copy +H5O_fill_size +H5O_fill_reset +H5O_fill_debug +H5O_fill_convert +H5O_flush +H5O_free +H5O_init_interface +H5O_layout_copy +H5O_layout_debug +H5O_layout_decode +H5O_layout_encode +H5O_layout_size +H5O_link +H5O_load +H5O_modify +H5O_mtime_copy +H5O_mtime_debug +H5O_mtime_decode +H5O_mtime_encode +H5O_mtime_size +H5O_name_copy +H5O_name_debug +H5O_name_decode +H5O_name_encode +H5O_name_reset +H5O_name_size +H5O_open +H5O_pline_copy +H5O_pline_debug +H5O_pline_decode +H5O_pline_encode +H5O_pline_reset +H5O_pline_size +H5O_read +H5O_remove +H5O_reset +H5O_sdspace_copy +H5O_sdspace_debug +H5O_sdspace_decode +H5O_sdspace_encode +H5O_sdspace_reset +H5O_sdspace_size +H5O_share +H5O_shared_debug +H5O_shared_decode +H5O_shared_encode +H5O_shared_size +H5O_stab_copy +H5O_stab_debug +H5O_stab_decode +H5O_stab_encode +H5O_stab_fast +H5O_stab_size +H5O_touch +H5O_touch_oh +H5P_close +H5P_copy +H5P_create +H5P_get_class +H5P_init_interface +H5Pclose +H5Pcopy +H5Pcreate +H5Pget_alignment +H5Pget_btree_ratios +H5Pget_buffer +H5Pget_cache +H5Pget_chunk +H5Pget_class +H5Pget_core +H5Pget_driver +H5Pget_external +H5Pget_external_count +H5Pget_family +H5Pget_fill_value +H5Pget_filter +H5Pget_hyper_cache +H5Pget_istore_k +H5Pget_layout +H5Pget_mpi +H5Pget_nfilters +H5Pget_sec2 +H5Pget_sizes +H5Pget_split +H5Pget_stdio +H5Pget_sym_k +H5Pget_userblock +H5Pget_version +H5Pget_xfer +H5Pset_alignment +H5Pset_buffer +H5Pset_cache +H5Pset_chunk +H5Pset_core +H5Pset_deflate +H5Pset_external +H5Pset_family +H5Pset_fill_value +H5Pset_filter +H5Pset_hyper_cache +H5Pset_istore_k +H5Pset_layout +H5Pset_mpi +H5Pset_preserve +H5Pset_sec2 +H5Pset_sizeof_addr +H5Pset_split +H5Pset_stdio +H5Pset_sym_k +H5Pset_userblock +H5Pset_xfer +H5R_close +H5R_create +H5R_fix_overflow +H5R_init_interface +H5R_open +H5R_read +H5R_write +H5Rclose +H5Rcreate +H5Ropen +H5Rread +H5Rwrite +H5RAcreate +H5RA_create +H5RAopen +H5RA_open +H5RAclose +H5RA_close +H5RA_init_interface +H5RAwrite +H5RA_write +H5RA_fix_overflow +H5RAread +H5RA_read +H5S_all_favail +H5S_all_fgath +H5S_all_fscat +H5S_all_init +H5S_all_mgath +H5S_all_mscat +H5S_all_npoints +H5S_all_release +H5S_close +H5S_cmp +H5S_copy +H5S_create +H5S_debug +H5S_extend +H5S_extent_copy +H5S_extent_release +H5S_find +H5S_get_npoints_max +H5S_get_select_npoints +H5S_get_simple_extent_dims +H5S_get_simple_extent_ndims +H5S_get_simple_extent_npoints +H5S_hyper_add +H5S_hyper_block_cache +H5S_hyper_block_read +H5S_hyper_block_write +H5S_hyper_bsearch +H5S_hyper_clip +H5S_hyper_copy +H5S_hyper_favail +H5S_hyper_fgath +H5S_hyper_fread +H5S_hyper_fscat +H5S_hyper_fwrite +H5S_hyper_get_regions +H5S_hyper_init +H5S_hyper_mgath +H5S_hyper_mread +H5S_hyper_mscat +H5S_hyper_mwrite +H5S_hyper_node_add +H5S_hyper_node_prepend +H5S_hyper_npoints +H5S_hyper_release +H5S_hyper_sel_iter_release +H5S_hyper_select_valid +H5S_init_interface +H5S_is_simple +H5S_modify +H5S_mpio_all_type +H5S_mpio_hyper_type +H5S_mpio_space_type +H5S_mpio_spaces_read +H5S_mpio_spaces_write +H5S_mpio_spaces_xfer +H5S_point_add +H5S_point_copy +H5S_point_favail +H5S_point_fgath +H5S_point_fscat +H5S_point_init +H5S_point_mgath +H5S_point_mscat +H5S_point_npoints +H5S_point_release +H5S_point_select_valid +H5S_read +H5S_register +H5S_release_simple +H5S_sel_iter_release +H5S_select_copy +H5S_select_hyperslab +H5S_select_init +H5S_select_release +H5S_select_valid +H5S_set_extent_simple +H5Sclose +H5Scopy +H5Screate +H5Screate_simple +H5Sget_select_npoints +H5Sget_simple_extent_dims +H5Sget_simple_extent_ndims +H5Sget_simple_extent_npoints +H5Sget_simple_extent_type +H5Sis_simple +H5Soffset_simple +H5Sselect_all +H5Sselect_elements +H5Sselect_hyperslab +H5Sselect_none +H5Sselect_valid +H5Sset_extent_none +H5Sset_extent_simple +H5TB_buf_ptr +H5TB_close +H5TB_garbage_coll +H5TB_get_buf +H5TB_init_interface +H5TB_release_buf +H5TB_resize_buf +H5T_bit_get_d +H5T_close +H5T_commit +H5T_conv_double_float +H5T_conv_f_f +H5T_conv_float_double +H5T_conv_i32le_f64le +H5T_conv_i_i +H5T_conv_noop +H5T_conv_order +H5T_conv_s_s +H5T_conv_struct +H5T_conv_struct_init +H5T_copy +H5T_create +H5T_debug +H5T_entof +H5T_equal +H5T_find +H5T_get_size +H5T_init +H5T_init_interface +H5T_insert +H5T_is_atomic +H5T_lock +H5T_open +H5T_pack +H5T_path_find +H5T_sort_by_offset +H5T_unlock_cb +H5Tclose +H5Tcommit +H5Tcommitted +H5Tconvert +H5Tcopy +H5Tcreate +H5Tequal +H5Tfind +H5Tget_class +H5Tget_cset +H5Tget_ebias +H5Tget_fields +H5Tget_inpad +H5Tget_member_dims +H5Tget_member_name +H5Tget_member_offset +H5Tget_member_type +H5Tget_norm +H5Tget_num_members +H5Tget_offset +H5Tget_order +H5Tget_overflow +H5Tget_pad +H5Tget_precision +H5Tget_sign +H5Tget_size +H5Tget_strpad +H5Tinsert +H5Tinsert_array +H5Tlock +H5Topen +H5Tpack +H5Tregister_hard +H5Tregister_soft +H5Tset_cset +H5Tset_ebias +H5Tset_fields +H5Tset_inpad +H5Tset_norm +H5Tset_offset +H5Tset_order +H5Tset_overflow +H5Tset_pad +H5Tset_prec +H5Tset_sign +H5Tset_size +H5Tset_strpad +H5Tunregister +H5V_array_fill +H5V_hyper_copy +H5V_hyper_fill +H5V_hyper_stride +H5V_stride_copy +H5V_stride_copy2 +H5V_stride_fill +H5V_stride_optimize1 +H5V_stride_optimize2 +H5Z_append +H5Z_filter_deflate +H5Z_find +H5Z_init_interface +H5Z_pipeline +H5Z_register +H5Zregister +H5_add_exit +H5_init_interface +H5_init_library +H5_init_thread +H5dont_atexit +H5get_libversion +H5open diff --git a/pablo/Makefile.in b/pablo/Makefile.in new file mode 100644 index 0000000..af4e160 --- /dev/null +++ b/pablo/Makefile.in @@ -0,0 +1,1423 @@ +# HDF5 Library Makefile(.in) +# +# Copyright (C) 1997 National Center for Supercomputing Applications. +# All rights reserved. +# +# +@COMMENCE@ +TRACE=perl ../bin/trace +PABLO_INC = +#PABLO_FLAGS = -I$(PABLO_INC) -DHAVE_PABLO + +# Add `-I.' to the C preprocessor flags. +CPPFLAGS=-I. -I../src $(PABLO_FLAGS) @CPPFLAGS@ + +# This is our main target: +LIB=libhdf5-inst.a + +# Source and object files for the library (lexicographically)... +LIB_SRC=H5.c H5A.c H5AC.c H5B.c H5D.c H5E.c H5F.c H5Farray.c H5Fcore.c \ + H5Ffamily.c H5Fistore.c H5Flow.c H5Fmpio.c H5Fsec2.c H5Fsplit.c \ + H5Fstdio.c H5G.c H5Gent.c H5Gnode.c H5Gstab.c H5HG.c H5HL.c H5I.c H5MF.c \ + H5MM.c H5O.c H5Oattr.c H5Ocomp.c H5Ocont.c H5Odtype.c H5Oefl.c H5Ofill.c \ + H5Olayout.c H5Omtime.c H5Oname.c H5Onull.c H5Osdspace.c H5Oshared.c \ + H5Ostab.c H5P.c H5R.c H5RA.c H5S.c H5Sall.c H5Shyper.c H5Smpio.c H5Spoint.c \ + H5Sselect.c H5T.c H5Tbit.c H5Tconv.c H5Tinit.c H5TB.c H5V.c H5Z.c \ + PabloHDF.c PabloHDF_RT.c PabloHDF_SDDF.c + +LIB_OBJ=$(LIB_SRC:.c=.o) + +# Temporary files +MOSTLYCLEAN=H5detect.o H5detect H5Tinit.o H5Tinit.c + +# Public header files (to be installed)... +PUB_HDR=H5public.h H5Apublic.h H5ACpublic.h H5Bpublic.h H5Dpublic.h \ + H5Epublic.h H5Fpublic.h H5Gpublic.h H5HGpublic.h H5HLpublic.h \ + H5Ipublic.h H5MFpublic.h H5MMpublic.h H5Opublic.h H5Ppublic.h \ + H5Rpublic.h H5RApublic.h H5Spublic.h H5Tpublic.h H5Zpublic.h H5config.h \ + hdf5.h + +# Other header files (not to be installed)... +PRIVATE_HDR=H5private.h H5Aprivate.h H5Apkg.h H5ACprivate.h H5Bprivate.h \ + H5Dprivate.h H5Eprivate.h H5Fprivate.h H5Gprivate.h H5Gpkg.h \ + H5HGprivate.h H5HLprivate.h H5Iprivate.h H5MFprivate.h H5MMprivate.h \ + H5Oprivate.h H5Pprivate.h H5Rprivate.h H5RAprivate.h H5Sprivate.h \ + H5Tprivate.h H5TBprivate.h H5Tpkg.h H5Vprivate.h H5Zprivate.h + +# Number format detection +H5Tinit.c: ../src/H5detect + $(RUNTEST) ../src/H5detect >H5Tinit.c + +#------------------------------------------------------------- -*- makefile -*- +# The following section of this makefile comes from the +# `./config/conclude' file which was generated with config.status +# from `./config/conclude.in'. +#------------------------------------------------------------------------------ + +# This is the target for the library described in the main body of the +# makefile. +# +lib: $(LIB) +$(LIB) __no_library__: $(LIB_OBJ) + $(AR) -rc $@ $(LIB_OBJ) + $(RANLIB) $@ + +progs: $(LIB) $(PROGS) + +# Build a tags file in this directory. +TAGS: $(LIB_SRC) + $(RM) $@ + -etags $(LIB_SRC) + +# Runs each test in order, passing $(TEST_FLAGS) to the program. +tests: $(LIB) $(TESTS) +test _test: tests + @for test in $(TESTS) dummy; do \ + if test $$test != dummy; then \ + echo "============================"; \ + echo "Testing $$test $(TEST_FLAGS)"; \ + echo "============================"; \ + $(RUNTEST) ./$$test $(TEST_FLAGS) || exit 1; \ + echo ""; \ + fi; \ + done; + +# Install the library, the public header files, and programs. +install: $(LIB) $(PUB_HDR) $(PROGS) + @test -d $(libdir) || mkdir $(libdir) + @for f in X $(LIB); do \ + if test $$f != X; then \ + (set -x; $(INSTALL_DATA) $$f $(libdir)/. || exit 1); \ + fi; \ + done + @test -d $(includedir) || mkdir $(includedir) + @for f in X $(PUB_HDR); do \ + if test $$f != X; then \ + (set -x; $(INSTALL_DATA) $$f $(includedir)/. || exit 1); \ + fi \ + done + @test -d $(bindir) || mkdir $(bindir) + @for f in X $(PROGS); do \ + if test $$f != X; then \ + (set -x; $(INSTALL_PROGRAM) $$f $(bindir)/. || exit 1); \ + fi; \ + done + +# Removes those things that `make install' (would have) installed. +uninstall: + @if test "X$(LIB)" != X; then \ + set -x; cd $(libdir) && $(RM) $(LIB); \ + fi + @if test "X$(PUBHDR)" != X; then \ + set -x; cd $(includedir) && $(RM) $(PUB_HDR); \ + fi + @if test "X$(PROGS)" != X; then \ + set -x; cd $(bindir) && $(RM) $(PROGS); \ + fi + +# Removes temporary files without removing the final target files. That is, +# remove things like object files but not libraries or executables. +# +mostlyclean: + $(RM) $(LIB_OBJ) $(TEST_OBJ) $(PROG_OBJ) $(MOSTLYCLEAN) + +# Like `mostlyclean' except it also removes the final targets: things like +# libraries and executables. This target doesn't remove any file that +# is part of the HDF5 distribution. +# +clean: mostlyclean + $(RM) $(LIB) $(TESTS) $(PROGS) $(CLEAN) + +# Like `clean' except it also removes files that were created by running +# configure. If you've unpacked the source and built HDF5 without creating +# any other files, then `make distclean' will leave only the files that were +# in the distribution. +# +distclean: clean + $(RM) .depend TAGS *~ core *.core *.bak *.old *.new $(DISTCLEAN) + @if test -f Makefile.in; then \ + (set -x; $(RM) Makefile); \ + fi + +# Like `distclean' except it deletes all files that can be regenerated from +# the makefile, including those generated from autoheader and autoconf. +# +maintainer-clean: distclean + $(RM) *~ core core.* *.core *.bak *.contrib gmon.out + +# Implicit rules +.c.a: + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + $(AR) -rc $@ $*.o + $(RM) $*.o + +.c.o: + $(CC) $(CFLAGS) $(CPPFLAGS) -c ../src/$*.o + +PabloHDF.o: PabloHDF.c + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + +PabloHDF_RT.o: PabloHDF_RT.c + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + +PabloHDF_SDDF.o: PabloHDF_SDDF.c + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< + +#------------------------------------------------------------------------------ +# The following section of this makefile contains dependencies between the +# source files and the header files. If GNU make and GCC are being used then +# the dependencies are in the form of rules that cause the information to +# be kept updated automatically. Otherwise the dependencies are listed +# explicitly and come from the `.distdep' files in the various directories. +# These files are part of the distribution and are generated automatically on +# GNU/GCC systems. +#------------------------------------------------------------------------------ + +H5A.c: ../src/H5A.c +H5A.o: \ +H5A.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Dprivate.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Pprivate.h \ +../src/H5Ppublic.h \ +../src/H5Apkg.h \ +../src/H5Aprivate.h +H5AC.c: ../src/H5AC.c +H5AC.o: \ +H5AC.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Ipublic.h \ +../src/H5Dpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h +H5B.c: ../src/H5B.c +H5B.o: \ +H5B.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Ipublic.h \ +../src/H5Dpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MFprivate.h \ +../src/H5MFpublic.h \ +../src/H5MMprivate.h +H5D.c: ../src/H5D.c +H5D.o: \ +H5D.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Dprivate.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5HLprivate.h \ +../src/H5HLpublic.h \ +../src/H5MFprivate.h \ +../src/H5MFpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Pprivate.h \ +../src/H5Ppublic.h \ +../src/H5TBprivate.h +H5E.c: ../src/H5E.c +H5E.o: \ +H5E.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5Eprivate.h +H5F.c: ../src/H5F.c +H5F.o: \ +H5F.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Aprivate.h \ +../src/H5Apublic.h \ +../src/H5Ipublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Dprivate.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Iprivate.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h +H5Farray.c: ../src/H5Farray.c +H5Farray.o: \ +H5Farray.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Dprivate.h \ +../src/H5Dpublic.h \ +../src/H5Ipublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MFprivate.h \ +../src/H5MFpublic.h +H5Fcore.c: ../src/H5Fcore.c +H5Fcore.o: \ +H5Fcore.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h +H5Ffamily.c: ../src/H5Ffamily.c +H5Ffamily.o: \ +H5Ffamily.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h +H5Fistore.c: ../src/H5Fistore.c +H5Fistore.o: \ +H5Fistore.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Dprivate.h \ +../src/H5Dpublic.h \ +../src/H5Ipublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MFprivate.h \ +../src/H5MFpublic.h +H5Flow.c: ../src/H5Flow.c +H5Flow.o: \ +H5Flow.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h +H5Fmpio.c: ../src/H5Fmpio.c +H5Fmpio.o: \ +H5Fmpio.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Dprivate.h \ +../src/H5Dpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h +H5Fsec2.c: ../src/H5Fsec2.c +H5Fsec2.o: \ +H5Fsec2.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h +H5Fsplit.c: ../src/H5Fsplit.c +H5Fsplit.o: \ +H5Fsplit.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5MFprivate.h \ +../src/H5MFpublic.h +H5Fstdio.c: ../src/H5Fstdio.c +H5Fstdio.o: \ +H5Fstdio.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h +H5G.c: ../src/H5G.c +H5G.o: \ +H5G.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Aprivate.h \ +../src/H5Apublic.h \ +../src/H5Ipublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Dprivate.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Gpkg.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5HLprivate.h \ +../src/H5HLpublic.h +H5Gent.c: ../src/H5Gent.c +H5Gent.o: \ +H5Gent.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Gpkg.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h +H5Gnode.c: ../src/H5Gnode.c +H5Gnode.o: \ +H5Gnode.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Ipublic.h \ +../src/H5Dpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Gpkg.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5HLprivate.h \ +../src/H5HLpublic.h \ +../src/H5MFprivate.h \ +../src/H5MFpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h +H5Gstab.c: ../src/H5Gstab.c +H5Gstab.o: \ +H5Gstab.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Ipublic.h \ +../src/H5Dpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Gpkg.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HLprivate.h \ +../src/H5HLpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h +H5HG.c: ../src/H5HG.c +H5HG.o: \ +H5HG.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Ipublic.h \ +../src/H5Dpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5MFprivate.h \ +../src/H5MFpublic.h \ +../src/H5MMprivate.h +H5HL.c: ../src/H5HL.c +H5HL.o: \ +H5HL.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Ipublic.h \ +../src/H5Dpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5HLprivate.h \ +../src/H5HLpublic.h \ +../src/H5MFprivate.h \ +../src/H5MFpublic.h \ +../src/H5MMprivate.h +H5MF.c: ../src/H5MF.c +H5MF.o: \ +H5MF.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h +H5MM.c: ../src/H5MM.c +H5MM.o: \ +H5MM.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h +H5O.c: ../src/H5O.c +H5O.o: \ +H5O.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Ipublic.h \ +../src/H5Dpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MFprivate.h \ +../src/H5MFpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h +H5Oattr.c: ../src/H5Oattr.c +H5Oattr.o: \ +H5Oattr.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Apkg.h +H5Ocomp.c: ../src/H5Ocomp.c +H5Ocomp.o: \ +H5Ocomp.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Ocont.c: ../src/H5Ocont.c +H5Ocont.o: \ +H5Ocont.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Odtype.c: ../src/H5Odtype.c +H5Odtype.o: \ +H5Odtype.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Oefl.c: ../src/H5Oefl.c +H5Oefl.o: \ +H5Oefl.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5HLprivate.h \ +../src/H5HLpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h +H5Ofill.c: ../src/H5Ofill.c +H5Ofill.o: \ +H5Ofill.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Olayout.c: ../src/H5Olayout.c +H5Olayout.o: \ +H5Olayout.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Dprivate.h \ +../src/H5Dpublic.h \ +../src/H5Ipublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h +H5Omtime.c: ../src/H5Omtime.c +H5Omtime.o: \ +H5Omtime.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Oname.c: ../src/H5Oname.c +H5Oname.o: \ +H5Oname.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Onull.c: ../src/H5Onull.c +H5Onull.o: \ +H5Onull.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Ipublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h +H5Osdspace.c: ../src/H5Osdspace.c +H5Osdspace.o: \ +H5Osdspace.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Oshared.c: ../src/H5Oshared.c +H5Oshared.o: \ +H5Oshared.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Ostab.c: ../src/H5Ostab.c +H5Ostab.o: \ +H5Ostab.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5P.c: ../src/H5P.c +H5P.o: \ +H5P.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Dprivate.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MMprivate.h +H5R.c: ../src/H5R.c +H5R.o: \ +H5R.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5Eprivate.h +H5RA.c: ../src/H5RA.c +H5RA.o: \ +H5RA.c \ +../src/H5RAprivate.h \ +../src/H5RApublic.h \ +../src/H5Ipublic.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Dprivate.h \ +../src/H5Dpublic.h \ +../src/H5private.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h +H5S.c: ../src/H5S.c +H5S.o: \ +H5S.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h +H5Sall.c: ../src/H5Sall.c +H5Sall.o: \ +H5Sall.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Shyper.c: ../src/H5Shyper.c +H5Shyper.o: \ +H5Shyper.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Vprivate.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h +H5Smpio.c: ../src/H5Smpio.c +H5Smpio.o: \ +H5Smpio.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5Spoint.c: ../src/H5Spoint.c +H5Spoint.o: \ +H5Spoint.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Vprivate.h +H5Sselect.c: ../src/H5Sselect.c +H5Sselect.o: \ +H5Sselect.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Iprivate.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h +H5T.c: ../src/H5T.c +H5T.o: \ +H5T.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Dprivate.h \ +../src/H5Dpublic.h \ +../src/H5Ipublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h \ +../src/H5Iprivate.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MMprivate.h +H5Tbit.c: ../src/H5Tbit.c +H5Tbit.o: \ +H5Tbit.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Iprivate.h \ +../src/H5Tpkg.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Gprivate.h +H5Tconv.c: ../src/H5Tconv.c +H5Tconv.o: \ +H5Tconv.c \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5private.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Tpkg.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h +H5Tinit.c: ../src/H5Tinit.c +H5Tinit.o: \ +H5Tinit.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Tpkg.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Tprivate.h +H5TB.c: ../src/H5TB.c +H5TB.o: \ +H5TB.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5Eprivate.h +H5V.c: ../src/H5V.c +H5V.o: \ +H5V.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h +H5Z.c: ../src/H5Z.c +H5Z.o: \ +H5Z.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Ipublic.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Dpublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Zprivate.h \ +../src/H5Zpublic.h +H5.c: ../src/H5.c +H5.o: \ +H5.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5ACprivate.h \ +../src/H5ACpublic.h \ +../src/H5Fprivate.h \ +../src/H5Fpublic.h \ +../src/H5Ipublic.h \ +../src/H5Dpublic.h \ +../src/H5Bprivate.h \ +../src/H5Bpublic.h \ +../src/H5Eprivate.h \ +../src/H5Epublic.h \ +../src/H5Iprivate.h \ +../src/H5MMprivate.h \ +../src/H5MMpublic.h \ +../src/H5Pprivate.h \ +../src/H5Ppublic.h \ +../src/H5Zpublic.h \ +../src/H5Sprivate.h \ +../src/H5Spublic.h \ +../src/H5Gprivate.h \ +../src/H5Gpublic.h \ +../src/H5Oprivate.h \ +../src/H5Opublic.h \ +../src/H5HGprivate.h \ +../src/H5HGpublic.h \ +../src/H5Tprivate.h \ +../src/H5Tpublic.h +H5I.c: ../src/H5I.c +H5I.o: \ +H5I.c \ +../src/H5private.h \ +../src/H5public.h \ +../src/H5config.h \ +../src/H5Iprivate.h \ +../src/H5Ipublic.h \ +../src/H5Eprivate.h diff --git a/pablo/PabloHDF.c b/pablo/PabloHDF.c new file mode 100644 index 0000000..4907e28 --- /dev/null +++ b/pablo/PabloHDF.c @@ -0,0 +1,862 @@ +/* This file is part of the Pablo Performance Analysis Environment +// +// (R) +// The Pablo Performance Analysis Environment software is NOT in +// the public domain. However, it is freely available without fee for +// education, research, and non-profit purposes. By obtaining copies +// of this and other files that comprise the Pablo Performance Analysis +// Environment, you, the Licensee, agree to abide by the following +// conditions and understandings with respect to the copyrighted software: +// +// 1. The software is copyrighted in the name of the Board of Trustees +// of the University of Illinois (UI), and ownership of the software +// remains with the UI. +// +// 2. Permission to use, copy, and modify this software and its documentation +// for education, research, and non-profit purposes is hereby granted +// to Licensee, provided that the copyright notice, the original author's +// names and unit identification, and this permission notice appear on +// all such copies, and that no charge be made for such copies. Any +// entity desiring permission to incorporate this software into commercial +// products should contact: +// +// Professor Daniel A. Reed reed@cs.uiuc.edu +// University of Illinois +// Department of Computer Science +// 2413 Digital Computer Laboratory +// 1304 West Springfield Avenue +// Urbana, Illinois 61801 +// USA +// +// 3. Licensee may not use the name, logo, or any other symbol of the UI +// nor the names of any of its employees nor any adaptation thereof in +// advertizing or publicity pertaining to the software without specific +// prior written approval of the UI. +// +// 4. THE UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE +// SOFTWARE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS +// OR IMPLIED WARRANTY. +// +// 5. The UI shall not be liable for any damages suffered by Licensee from +// the use of this software. +// +// 6. The software was developed under agreements between the UI and the +// Federal Government which entitle the Government to certain rights. +// +// ************************************************************************* +// +// Developed by: The Pablo Research Group +// University of Illinois at Urbana-Champaign +// Department of Computer Science +// 1304 W. Springfield Avenue +// Urbana, IL 61801 +// +// http://www-pablo.cs.uiuc.edu +// +// Send comments to: pablo-feedback@guitar.cs.uiuc.edu +// +// Copyright (c) 1987-1998 +// The University of Illinois Board of Trustees. +// All Rights Reserved. +// +// PABLO is a registered trademark of +// The Board of Trustees of the University of Illinois +// registered in the U.S. Patent and Trademark Office. +// +// Project Manager and Principal Investigator: +// Daniel A. Reed (reed@cs.uiuc.edu) +// +// Funded in part by the Defense Advanced Research Projects Agency under +// DARPA contracts DABT63-94-C0049 (SIO Initiative), F30602-96-C-0161, +// and DABT63-96-C-0027 by the National Science Foundation under the PACI +// program and grants NSF CDA 94-01124 and ASC 97-20202, and by the +// Department of Energy under contracts DOE B-341494, W-7405-ENG-48, and +// 1-B-333164. +//========================================================================*/ + +#include <stdio.h> +#include <stdlib.h> +#include <fcntl.h> +#ifndef fileno +int fileno ( FILE * ); +#endif +/* on ipsc/860 don't include this or you'll get multiply defined SEEK_* */ +#ifndef __NX +#include <unistd.h> +#endif + +#define HDFtrace3OPEN__ +int HDFtrace3OPEN( const char *, int, mode_t ); + +/*#include "Assert_TrLib.h"*/ +#include "SDDFparam.h" +#include "TraceParam.h" + +#include "SystemDepend.h" +#include "Trace.h" + +#include "IO_TraceParams.h" +#include "HDFIOTrace.h" + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +/* mode_t is not defined on the ipsc/860 so we define it here */ +#ifdef __NX +typedef unsigned int mode_t; +#endif + +int OUTPUT_SWITCH; +extern void preInitIOTrace( void ); + +#include "ProcIDs.h" +#include "HDFTrace.h" +#include "IOTrace.h" +#define NO_OUTPUT 0 +#define SDDF_OUTPUT 1 +#define RT_OUTPUT 2 +void HDFinitTrace_RT ( const char *, unsigned int ); +void HDFinitTrace_SDDF ( const char *, unsigned int ); +void hinittracex_ ( int [], int *, unsigned *, int * ); +void hdfendtrace_ ( void ) ; +void HDFendTrace (void); +void HDFendTrace_RT (void); +void HDFendTrace_SDDF(void); +void startHDFtraceEvent (int ); +int computeProcMask (int eventID); +int computePacketTag(int eventID); +void endHDFtraceEvent (int , int , char *, int ); +void traceEvent ( int , char *, unsigned ); +void HDFtraceEvent_RT ( int , HDFsetInfo *, unsigned ); +void HDFtraceIOEvent( int , void *, unsigned ); +uint procTrace; +extern int IOtracingEnabled; +char *hdfRecordPointer; +/*======================================================================* +// NAME * +// HDFinitTrace -- initialize HDF tracing * +// USAGE * +// VOID HDFinitTrace( traceFileName, procTraceMask, out_sw ) * +// char *traceFileName; IN: name of the generated trace output * +// file * +// uint32 procTraceMask; IN: families of procedures to trace * +// int out_sw IN: indicates whether to produce SDDF * +// file or Final Summary * +// RETURNS * +// None. * +//======================================================================*/ +/*======================================================================* +// fortran to C interface. To insure portability, the character array * +// passed in Fortran is converted to an integer array using the ICHAR * +// function. This program converts it from integer to char, then * +// passes it to the C initialization routine. * +//======================================================================*/ +void hinittracex_( int *file, int *len, unsigned *procMask, int *out_sw ) +{ + char *fileName; + int i; + fileName = (char *)malloc(*len+1); + for ( i = 0; i < *len; ++i ) { + fileName[i] = file[i]; + } + fileName[*len+1] = 0; + HDFinitTrace ( fileName, *procMask, *out_sw ); +} +void HDFinitTrace( const char *traceFileName, unsigned procTraceMask, + unsigned out_sw ) +{ + OUTPUT_SWITCH = out_sw; + if ( out_sw == SDDF_OUTPUT ) { + HDFinitTrace_SDDF( traceFileName, procTraceMask ); + IOtracingEnabled = 1; + } else if ( out_sw == RT_OUTPUT ) { + HDFinitTrace_RT( traceFileName, procTraceMask ); + IOtracingEnabled = 1; + } else if ( out_sw == NO_OUTPUT ) { + procTrace = 0; + IOtracingEnabled = 0; + } else { + fprintf(stderr,">> Error in HDFinitTrace: the third argument "); + fprintf(stderr,"must have the value 0, 1, <<<\n"); + fprintf(stderr,">> or 2. The value received was %u.", out_sw); + fprintf(stderr," Exiting program. <<<\n"); + exit (-1); + } +} +/*======================================================================* +// NAME * +// HDFendTrace -- end HDF tracing * +// USAGE * +// VOID HDFendTrace(VOID) * +// RETURNS * +// None. * +//======================================================================*/ +void hdfendtrace_( void ) +{ + HDFendTrace (); +} +void HDFendTrace(void) +{ + if ( OUTPUT_SWITCH == SDDF_OUTPUT ) { + HDFendTrace_SDDF( ); + } else if ( OUTPUT_SWITCH == RT_OUTPUT ) { + HDFendTrace_RT( ); + } + procTrace = 0; +} +void startHDFtraceEvent(int eventID) +{ + if ( OUTPUT_SWITCH == SDDF_OUTPUT ) { + traceEvent( eventID, NULL, 0 ) ; + } else { + HDFtraceEvent_RT( eventID, NULL, 0 ) ; + } +} +void endHDFtraceEvent(int eventID, int setID, char *setName, int IDtype ) +{ + HDFsetInfo info; + info.setID = setID; + info.setName = setName; + if ( OUTPUT_SWITCH == SDDF_OUTPUT ) { + traceEvent( eventID, (char *)&info, 0 ) ; + } else if (OUTPUT_SWITCH == RT_OUTPUT ) { + HDFtraceEvent_RT( eventID, &info, 0 ) ; + } else if ( OUTPUT_SWITCH < 0 ) { + fprintf(stderr,"endHDFtraceEvent: "); + fprintf(stderr,"invalid OUTPUT_SWITCH %d, IDtype = %d\n", + OUTPUT_SWITCH, IDtype ) ; + } +} +/******************************************************************************/ + +/*+ Open routines +*/ +/*+ ------------- +*/ +/*+ +*/ +/*+ Routine: FILE *HDFtraceFOPEN( const char *filename, const char *type ) +*/ +/*+ substitute for fopen() +*/ +/*+ generates fopenBeginID, fopenEndID +*/ +/*+ record Open (fopenBegin) +*/ +/*+ Mode = -1 +*/ +/*+ +*/ +FILE *HDFtraceFOPEN( const char *filename, const char *type ) +{ + FILE *fp; + int fd, id; + int flags = 0; + struct open_args openArgs; + size_t typeLen; + + if ( IOtracingEnabled ) { + strcpy( openArgs.filename, filename ); + + /* check for 'b' - usually if 2 chars, second is '+' */ + typeLen = strlen( type ); + if ( ( typeLen == 2 ) && ( type [1] == 'b' ) ) { + typeLen = 1; + } + + if ( typeLen == 1 ) { + switch( type[0] ) { + case 'r': + flags = flags | O_RDONLY; + break; + case 'w': + flags = O_TRUNC | O_CREAT | O_WRONLY; + break; + case 'a': + flags = flags | O_APPEND | O_CREAT | O_WRONLY; + break; + } + } else { + switch( type[0] ) { + case 'r': + flags = O_RDWR; + break; + case 'w': + flags = O_TRUNC | O_CREAT | O_RDWR; + break; + case 'a': + flags = O_APPEND | O_CREAT | O_RDWR; + break; + } + } + openArgs.flags = flags; + openArgs.mode= -1; + + HDFtraceIOEvent( fopenBeginID, (void *)&openArgs, sizeof(openArgs) ); + } + + fp = fopen( filename, type ); + if ( fp != NULL ) { + fd = fileno( fp ); + id = set_c_mappedID( fd ); + } else { + id = -1; + } + + if ( IOtracingEnabled ) { + HDFtraceIOEvent( fopenEndID, (void *) &id, int_SIZE ); + } + + return( fp ); +} + +/*+ Routine: int HDFtraceCREAT( const char *path, mode_t mode ) +*/ +/*+ substitute for creat() +*/ +/*+ generates openBeginID, openEndID +*/ +/*+ record Open (openBeginID) +*/ +/*+ +*/ +int HDFtraceCREAT( const char *path, mode_t mode ) +{ + struct open_args openArgs; + int fd; + int id; + + if ( IOtracingEnabled ) { + strcpy( openArgs.filename, path ); + openArgs.flags = O_WRONLY | O_CREAT | O_TRUNC; + openArgs.mode = (int) mode; + + HDFtraceIOEvent( openBeginID, (void *)&openArgs, sizeof(openArgs) ); + } + + fd = creat( path, mode ); + id = set_c_mappedID( fd ); + + if ( IOtracingEnabled ) { + HDFtraceIOEvent( openEndID, (void *) &id, int_SIZE ); + } + + return( fd ); +} + +/******************************************************************************/ + +/*+ Flush routines +*/ +/*+ -------------- +*/ +/*+ +*/ +/*+ Routine: int HDFtraceFFLUSH( FILE *stream ) +*/ +/*+ substitute for fflush() +*/ +/*+ generates fflushBeginID, fflushEndID +*/ +/*+ record Flush (fflushBeginID) +*/ +/*+ +*/ +int HDFtraceFFLUSH( FILE *stream ) +{ + int ret; + int id; + int fd; + + if ( IOtracingEnabled ) { + /* + * If stream is NULL, all files open for write are flushed. + * We show this with a -2 in the trace record as too much overhead + * to try and tell what files those are and generate individual + * trace records. + */ + if ( stream == NULL ) { + id = -2; + } else { + fd = fileno( stream ); + id = c_mappedID( fd ); + HDFtraceIOEvent( fflushBeginID, (void *) 0, int_SIZE ); + } + } + + ret = fflush( stream ); + + if ( IOtracingEnabled ) { + HDFtraceIOEvent( fflushEndID, (void *) &id, 0 ); + } + + /* + * Note that if fflush called on stream open for reading, the file pointer + * is moved to EOF if it isn't there already. We don't account for that + * in our file positioning information. + */ + + return( ret ); +} + +/******************************************************************************/ +/*+ Close routines +*/ +/*+ -------------- +*/ +/*+ +*/ +/*+ Routine: int HDFtraceFCLOSE( FILE *stream ) +*/ +/*+ substitute for fclose() +*/ +/*+ generates fcloseBeginID, fcloseEndID +*/ +/*+ record Close (fcloseBeginID) +*/ +/*+ +*/ +int HDFtraceFCLOSE( FILE *stream ) +{ + int ret; + int id; + int fd = fileno( stream ); + + if ( IOtracingEnabled ) { + id = c_mappedID( fd ); + HDFtraceIOEvent( fcloseBeginID, (void *) &id, int_SIZE ); + } + + ret = fclose( stream ); + + if ( IOtracingEnabled ) { + HDFtraceIOEvent( fcloseEndID, (void *) 0, 0 ); + } + + return( ret ); +} + +/*+ Routine: int HDFtrace3OPEN( char *path, int flags, mode_t mode ) +*/ +/*+ substitute for open() when called with 3 arguments +*/ +/*+ generates openBeginID, openEndID +*/ +/*+ record Open (openBeginID) +*/ +/*+ +*/ +int HDFtrace3OPEN( const char *path, int flags, mode_t mode ) +{ + struct open_args openArgs; + int fd; + int id; + + if ( IOtracingEnabled ) { + strcpy( openArgs.filename, path ); + openArgs.flags = flags; + openArgs.mode = (int) mode; + + HDFtraceIOEvent( openBeginID, (char *)&openArgs, sizeof(openArgs) ); + } + + fd = open( path, flags, mode ); + id = set_c_mappedID( fd ); + + if ( IOtracingEnabled ) { + HDFtraceIOEvent( openEndID, (char *) &id, int_SIZE ); + } + + return( fd ); +} + +/*+ Routine: int HDFtraceCLOSE( int fd ) +*/ +/*+ substitute for close() +*/ +/*+ generates closeBeginID, closeEndID +*/ +/*+ record Close (closeBeginID) +*/ +/*+ +*/ +int HDFtraceCLOSE( int fd ) +{ + int ret; + int id; + + if ( IOtracingEnabled ) { + id = c_mappedID( fd ); + HDFtraceIOEvent( closeBeginID, (void *) &id, int_SIZE ); + } + + ret = close( fd ); + + if ( IOtracingEnabled ) { + HDFtraceIOEvent( closeEndID, (void *) 0, 0 ); + } + + return( ret ); +} + +/******************************************************************************/ +/*+ Read routines +*/ +/*+ ------------- +*/ +/*+ +*/ +/*+ Routine: int HDFtraceREAD( int fd, char *buf, int nbyte ) +*/ +/*+ substitute for read() +*/ +/*+ generates readBeginID, readEndID +*/ +/*+ record Read (readBeginID) +*/ +/*+ Number Variables = 1 +*/ +/*+ Cause = -1 +*/ +/*+ +*/ +size_t HDFtraceREAD( int fd, char *buf, int nbyte ) +{ + struct read_write_args readArgs; + size_t ret; + int bytes; + + if ( IOtracingEnabled ) { + readArgs.fileID = c_mappedID( fd ); + readArgs.numVariables = 1; + readArgs.cause = -1; + + HDFtraceIOEvent( readBeginID, (void *) &readArgs, sizeof(readArgs) ); + } + + ret = read( fd, buf, nbyte ); + + if ( IOtracingEnabled ) { + if ( ret > 0 ) { + bytes = (int)ret; + } else { + bytes = 0; + } + HDFtraceIOEvent( readEndID, (void *) &bytes, int_SIZE ); + } + + return( ret ); +} + +/*+ Routine: int HDFtraceFREAD( char *ptr, int size, int nitems, +*/ +/*+ FILE *stream) +*/ +/*+ substitute for fread() +*/ +/*+ generates freadBeginID, freadEndID +*/ +/*+ record Read (freadBeginID) +*/ +/*+ Number Variables = nitems +*/ +/*+ Cause = -1 +*/ +/*+ +*/ +size_t HDFtraceFREAD( void *ptr, int size, int nitems, FILE *stream ) +{ + struct read_write_args readArgs; + size_t ret; + int nbytes; + int fd = fileno( stream ); + + if ( IOtracingEnabled ) { + readArgs.fileID = c_mappedID( fd ); + readArgs.numVariables = nitems; + readArgs.cause = -1; + HDFtraceIOEvent( freadBeginID, (void *) &readArgs, sizeof(readArgs) ); + } + + ret = fread( ptr, size, nitems, stream ); + + if ( IOtracingEnabled ) { + if ( ret > 0 ) { + nbytes = (int)ret * size ; + } else { + nbytes = 0; + } + HDFtraceIOEvent( freadEndID, (void *) &nbytes, int_SIZE ); + } + + return( ret ); +} + + +/******************************************************************************/ +/*+ Seek routines +*/ +/*+ ------------- +*/ +/*+ +*/ +/*+ Routine: off_t HDFtraceLSEEK( int fd, off_t offset, int whence ) +*/ +/*+ substitute for lseek() +*/ +/*+ generates lseekBeginID, lseekEndID +*/ +/*+ record Seek (lseekBeginID) +*/ +/*+ +*/ +off_t HDFtraceLSEEK( int fd, off_t offset, int whence ) +{ + struct seek_args seekArgs; + off_t ret; + long arg; + + if ( IOtracingEnabled ) { + seekArgs.fileID = c_mappedID( fd ); + seekArgs.offset = (int) offset; + seekArgs.whence = whence; + + HDFtraceIOEvent( lseekBeginID, (void *) &seekArgs, sizeof(seekArgs) ); + } + + ret = lseek( fd, offset, whence ); + + if ( IOtracingEnabled ) { + arg = (long) ret; + HDFtraceIOEvent( lseekEndID, (void *)&arg, long_SIZE ); + } + + return( ret ); +} + +/*+ routine: int HDF traceFSEEK( FILE *stream, long offset, int whence ) +*/ +/*+ substitute for fseek() +*/ +/*+ generates fseekBeginID, fseekEndID +*/ +/*+ record Seek (fseekBeginID) +*/ +/*+ +*/ +int HDFtraceFSEEK( FILE *stream, long offset, int whence ) +{ + struct seek_args seekArgs; + int ret; + long arg; + int fd = fileno( stream ); + + if ( IOtracingEnabled ) { + seekArgs.fileID = c_mappedID( fd );; + seekArgs.offset = (int) offset; + seekArgs.whence = whence; + + HDFtraceIOEvent( fseekBeginID, (void *) &seekArgs, sizeof(seekArgs) ); + } + + ret = fseek( stream, offset, whence ); + + if ( IOtracingEnabled ) { + arg = ftell( stream ); + HDFtraceIOEvent( fseekEndID, (void *)&arg, long_SIZE ); + } + + return( ret ); +} + +#ifdef fpos_t +/*+ Routine: int HDFtraceFSETPOS( FILE *stream, const fpos_t *position ) +*/ +/*+ substitute for fsetpos() +*/ +/*+ generates fsetposBeginID, fsetposEndID +*/ +/*+ record Seek (fsetposBeginID) +*/ +/*+ +*/ +int HDFtraceFSETPOS( FILE stream, const fpos_t *position ) +{ + struct seek_args seekArgs; + int ret; + long arg; + int fd = fileno( stream ); + + if ( IOtracingEnabled ) { + seekArgs.fileID = c_mappedID( fd );; + seekArgs.offset = (int) *position; + seekArgs.whence = SEEK_SET; + + HDFtraceIOEvent( fsetposBeginID, (void *) &seekArgs, sizeof(seekArgs) ); + } + + ret = fsetpos( stream, position ); + + if ( IOtracingEnabled ) { + arg = (long) *position; + HDFtraceIOEvent( fsetposEndID, (void *)&arg, long_SIZE ); + } + + return( ret ); +} +#endif /* fpos_t */ + +/*+ Routine: void HDFtraceREWIND ( FILE *stream ) +*/ +/*+ substitute for rewind() +*/ +/*+ generates rewindBeginID, rewindEndID +*/ +/*+ record Seek (rewindBeginID) +*/ +/*+ Offset = 0 +*/ +/*+ Whence = SEEK_SET +*/ +/*+ +*/ +void HDFtraceREWIND( FILE *stream ) +{ + struct seek_args seekArgs; + long arg; + int fd = fileno( stream ); + + if ( IOtracingEnabled ) { + seekArgs.fileID = c_mappedID( fd ); + seekArgs.offset = 0; + seekArgs.whence = SEEK_SET; + + HDFtraceIOEvent( rewindBeginID, (void *) &seekArgs, sizeof(seekArgs) ); + } + + rewind( stream ); + + if ( IOtracingEnabled ) { + arg = 0; + HDFtraceIOEvent( rewindEndID, (void *)&arg, long_SIZE ); + } + + return; +} + +/******************************************************************************/ +/*+ Write routines +*/ +/*+ -------------- +*/ +/*+ +*/ +/*+ Routine: int HDFtraceWRITE( int fd, char *buf, int nbyte ) +*/ +/*+ substitute for write() +*/ +/*+ generates writeBeginID, writeEndID +*/ +/*+ record Write (writeBeginID) +*/ +/*+ Number Variables = 1 +*/ +/*+ Cause = -1 +*/ +/*+ +*/ +size_t HDFtraceWRITE( int fd, const char *buf, int nbyte ) +{ + struct read_write_args writeArgs; + size_t ret; + int bytes; + + if ( IOtracingEnabled ) { + writeArgs.fileID = c_mappedID( fd ); + writeArgs.numVariables = 1; + writeArgs.cause = -1; + + HDFtraceIOEvent( writeBeginID, (void *) &writeArgs, sizeof(writeArgs) ); + } + + ret = write( fd, buf, nbyte ); + + if ( IOtracingEnabled ) { + if ( ret > 0 ) { + bytes = (int)ret; + } else { + bytes = 0; + } + HDFtraceIOEvent( writeEndID, (void *) &bytes, int_SIZE ); + } + return( ret ); +} + +/*+ Routine: size_t HDFtraceFWRITE( const char *ptr, int size, int nitems, +*/ +/*+ FILE *stream ) +*/ +/*+ substitute for fwrite() +*/ +/*+ generates fwriteBeginID, fwriteEndID +*/ +/*+ record Write (fwriteBeginID) +*/ +/*+ Number Variables = nitems +*/ +/*+ Cause = -1 +*/ +/*+ +*/ +size_t HDFtraceFWRITE( const char *ptr, int size, int nitems, FILE *stream ) +{ + struct read_write_args writeArgs; + size_t ret; + int nbytes; + int fd = fileno( stream ); + + if ( IOtracingEnabled ) { + writeArgs.fileID = c_mappedID( fd ); + writeArgs.numVariables = nitems; + writeArgs.cause = -1; + + HDFtraceIOEvent( fwriteBeginID, (void *) &writeArgs, sizeof(writeArgs) ); + } + + ret = fwrite( ptr, size, nitems, stream ); + + if ( IOtracingEnabled ) { + if ( ret > 0 ) { + nbytes = (int)ret * size ; + } else { + nbytes = 0; + } + HDFtraceIOEvent( fwriteEndID, (void *) &nbytes, int_SIZE ); + } + + return( ret ); +} + +/*+ Routine: int HDFtracePUTS( char *s ) +*/ +/*+ substitute for puts() +*/ +/*+ generates fwriteBeginID, fwriteEndID +*/ +/*+ record Write (fwriteBeginID) +*/ +/*+ Number Variables = 1 +*/ +/*+ Cause = -1 +*/ +/*+ +*/ +int HDFtracePUTS( char *s ) +{ + struct read_write_args writeArgs; + int ret; + int fd = fileno( stdout ); + + if ( IOtracingEnabled ) { + writeArgs.fileID = c_mappedID( fd ); + writeArgs.numVariables = 1; + writeArgs.cause = -1; + + HDFtraceIOEvent( fwriteBeginID, (void *) &writeArgs, sizeof(writeArgs) ); + } + + ret = puts( s ); + + if ( IOtracingEnabled ) { + HDFtraceIOEvent( fwriteEndID, (void *) &ret, int_SIZE ); + } + + return( ret ); +} + +/*+ Routine: int HDFtraceFPUTC( int c, FILE *stream ) +*/ +/*+ substitute for fputc() +*/ +/*+ generates fwriteBeginID, fwriteEndID +*/ +/*+ record Write (fwriteBeginID) +*/ +/*+ Number Variables = 1 +*/ +/*+ Cause = -1 +*/ +/*+ +*/ +int HDFtraceFPUTC( int c, FILE *stream ) +{ + struct read_write_args writeArgs; + int ret; + int nbytes = char_SIZE; + int fd = fileno( stream ); + + if ( IOtracingEnabled ) { + writeArgs.fileID = c_mappedID( fd ); + writeArgs.numVariables = 1; + writeArgs.cause = -1; + + HDFtraceIOEvent( fwriteBeginID, (void *) &writeArgs, sizeof(writeArgs) ); + } + + ret = fputc( c, stream ); + + if ( IOtracingEnabled ) { + if ( ret == EOF ) { + nbytes = 0; + HDFtraceIOEvent( fwriteEndID, (void *) &nbytes, int_SIZE ); + } + } + + return( ret ); +} +/*+ Routine: int HDFtraceFPUTS( char *s, FILE *stream ) +*/ +/*+ substitute for fputs() +*/ +/*+ generates fwriteBeginID, fwriteEndID +*/ +/*+ record Write (fwriteBeginID) +*/ +/*+ Number Variables = 1 +*/ +/*+ Cause = -1 +*/ +/*+ +*/ +int HDFtraceFPUTS( const char *s, FILE *stream ) +{ + struct read_write_args writeArgs; + int ret; + int fd = fileno( stream ); + + if ( IOtracingEnabled ) { + writeArgs.fileID = c_mappedID( fd ); + writeArgs.numVariables = 1; + writeArgs.cause = -1; + + HDFtraceIOEvent(fwriteBeginID, (void *)&writeArgs, sizeof(writeArgs)); + } + + ret = fputs( s, stream ); + + if ( IOtracingEnabled ) { + HDFtraceIOEvent( fwriteEndID, (void *) &ret, int_SIZE ); + } + + return( ret ); +} +void *HDFtraceMALLOC(size_t bytes ) +{ + void *ptr; + size_t byte_req; + byte_req = bytes; + if ( IOtracingEnabled ) { + HDFtraceIOEvent ( ID_malloc, &byte_req, sizeof(size_t) ); + } + + ptr = malloc( bytes ); + + if ( IOtracingEnabled ) { + HDFtraceIOEvent ( -ID_malloc, NULL, 0 ); + } + + return ptr ; + +} + +void HDFtraceIOEvent( int eventType, void *dataPtr, unsigned dataLen ) +{ + if ( OUTPUT_SWITCH == 1 ) { + traceEvent( eventType, dataPtr, dataLen ); + } else { + HDFtraceEvent_RT( eventType, (HDFsetInfo *)dataPtr, dataLen ); + } +} diff --git a/pablo/PabloHDF_RT.c b/pablo/PabloHDF_RT.c new file mode 100644 index 0000000..66ecc72 --- /dev/null +++ b/pablo/PabloHDF_RT.c @@ -0,0 +1,1473 @@ +/* This file is part of the Pablo Performance Analysis Environment +// +// (R) +// The Pablo Performance Analysis Environment software is NOT in +// the public domain. However, it is freely available without fee for +// education, research, and non-profit purposes. By obtaining copies +// of this and other files that comprise the Pablo Performance Analysis +// Environment, you, the Licensee, agree to abide by the following +// conditions and understandings with respect to the copyrighted software: +// +// 1. The software is copyrighted in the name of the Board of Trustees +// of the University of Illinois (UI), and ownership of the software +// remains with the UI. +// +// 2. Permission to use, copy, and modify this software and its documentation +// for education, research, and non-profit purposes is hereby granted +// to Licensee, provided that the copyright notice, the original author's +// names and unit identification, and this permission notice appear on +// all such copies, and that no charge be made for such copies. Any +// entity desiring permission to incorporate this software into commercial +// products should contact: +// +// Professor Daniel A. Reed reed@cs.uiuc.edu +// University of Illinois +// Department of Computer Science +// 2413 Digital Computer Laboratory +// 1304 West Springfield Avenue +// Urbana, Illinois 61801 +// USA +// +// 3. Licensee may not use the name, logo, or any other symbol of the UI +// nor the names of any of its employees nor any adaptation thereof in +// advertizing or publicity pertaining to the software without specific +// prior written approval of the UI. +// +// 4. THE UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE +// SOFTWARE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS +// OR IMPLIED WARRANTY. +// +// 5. The UI shall not be liable for any damages suffered by Licensee from +// the use of this software. +// +// 6. The software was developed under agreements between the UI and the +// Federal Government which entitle the Government to certain rights. +// +// ************************************************************************* +// +// Developed by: The Pablo Research Group +// University of Illinois at Urbana-Champaign +// Department of Computer Science +// 1304 W. Springfield Avenue +// Urbana, IL 61801 +// +// http://www-pablo.cs.uiuc.edu +// +// Send comments to: pablo-feedback@guitar.cs.uiuc.edu +// +// Copyright (c) 1987-1998 +// The University of Illinois Board of Trustees. +// All Rights Reserved. +// +// PABLO is a registered trademark of +// The Board of Trustees of the University of Illinois +// registered in the U.S. Patent and Trademark Office. +// +// Project Manager and Principal Investigator: +// Daniel A. Reed (reed@cs.uiuc.edu) +// +// Funded in part by the Defense Advanced Research Projects Agency +// under DARPA contracts DABT63-94-C0049 (SIO Initiative), +// F30602-96-C-0161, and DABT63-96-C-0027 by the National Science +// Foundation under the PACI program and grants NSF CDA 94-01124 and +// ASC 97-20202, and by the Department of Energy under contracts +// DOE B-341494, W-7405-ENG-48, and 1-B-333164. +*/ +/*======================================================================* +// File: PabloHDF_RT * +// Purpose: support use of Pablo trace library to analyze HDF * +// performance * +// Contents: * +// HDFinitTrace_RT : initialize real-time tracing * +// HDFendTrace_RT : complete trace * +// initHDFProcTrace_RT : sets up data structures at init time. * +// initproctracert_() : fortran interface * +// HDFtraceEvent_RT : called to record event information * +// HDFrecordSum : adds fields of one record to those of * +// another * +// HDFnodeInit : initializes linked list node * +// HDFrecordFileName : records named HDF identifiers * +// BeginIOEventRecord : initialize before I/O call * +// EndIOEventRecord : finalize after I/O call * +// BeginMPIOEventRecord : initialize before MPI-I/O call * +// EndMPIOEventRecord : finalize after MPI-I/O call * +// BeginHDFEventRecord : initialize before HDF call * +// EndHDFEventRecord : finalizie after HDF call * +// HDFrecordFileName : record named identifier information * +// HDFassignPabloIDs : assigns a number to named identifiers * +// writeHDFNamePacketsRT : write SDDF packets for identifier names * +// HDFupdateProcLists : adds records in queue to entries in * +// tables * +// HDFupdateProcs : called by HDFupdateProcLists to do * +// addition * +// HDFSummarySDDF : write SDDF event summary packets * +// HDFnodeInit : initialize event node * +// HDFrecordSum : add one event record to another * +// getHDFFieldIndex : get Field Index for counts and times * +// getHDFByteFieldIndex : get field index for bytes * +// writeHDFRecDescrptrsRT : write HDF Record Descriptor packets * +// printFileMappingsRT : print map of named identifiers * +// _hdfNameDescriptor() : writes SDDF descriptor packet for names * +//======================================================================*/ +#include "H5config.h" +#include "SystemDepend.h" +#include "Trace.h" +#include "TraceParam.h" +#include "ProcIDs.h" +#include "HDFTrace.h" +#include "SDDFparam.h" +#include <string.h> +#include <stdio.h> +#include <fcntl.h> +/*======================================================================* +// on ipsc/860 don't include this or you'll get multiply defined SEEK_ * +//======================================================================*/ +#ifndef __NX +#include <unistd.h> +#endif + +#ifndef SUCCESS +#define SUCCESS 0 +#define FAILURE 1 +#endif + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif +#define NEG_THREAD_ID -999 + +#include "HDFrecord_RT.h" + +#ifdef HAVE_PARALLEL +#include "MPIO_Init.h" +#include "MPIO_EventArgs.h" +#include "MPIO_TraceParams.h" +#endif + +#ifndef TRgetThreadID +#define TRgetThreadID TRgetNode +#endif + +#ifndef TRnumNodes +#define TRnumNodes 1 +#endif + +#define AllThreads -1 + +#define set_c_mappedID( fd ) (fd) +#define c_mappedID( fd ) (fd) +/*======================================================================* +// User output file pointer. * +//======================================================================*/ +FILE *outP; +/*======================================================================* +// Data Structures: * +// * +// HDFQueues: an array of linked list. Each list corresponds to an * +// HDF event and contains an entry for each different * +// thread and data set referenced by a call to that event * +// * +// CallStack: a stack of HDFnode_t objects. At any given time, the * +// stack represents the calling stack of the HDF routines * +// * +// HDFfileList: a linked list of named identifiers and identifier * +// numbers. This is processed later to assign a single * +// numbers to identifiers with the same name. * +//======================================================================*/ +HDFnode_t **HDFQueues; +HDFnode_t *CallStack; +HDFnode_t *TagQueue; +fileRec_t *HDFfileList; +/*======================================================================* +// Internal Function prototypes * +//======================================================================*/ +void HDFinitTrace_RT( char *, unsigned ); +void HDFendTrace_RT( void ); +int initproctracert_( void ); +int initHDFProcTrace_RT( void ); +void HDFtraceEvent_RT( int , char *, unsigned ) ; +void BeginIOEventRecord ( int, double , void * ); +void EndIOEventRecord ( int , double , void *); +void BeginMPIOEventRecord ( int, double, void * ); +void EndMPIOEventRecord ( int , double , void *); +void BeginHDFEventRecord( int , double ); +void EndHDFEventRecord ( int , double ,void * ); +void HDFrecordFileName( HDFsetInfo * ); +void HDFassignPabloIDs( int *, char *** ); +void writeHDFNamePacketsRT( char **, int ); +void HDFupdateProcLists( void ); +void HDFupdateProcs( HDFnode_t * ); +void HDFSummarySDDF( HDFnode_t *, int ); +void HDFnodeInit ( HDFnode_t * ) ; +void HDFrecordSum ( HDFrec_t *, HDFrec_t * ); +int getHDFFieldIndex( int ); +int getHDFByteFieldIndex( int ); +void writeHDFRecDescrptrsRT( void ); +void printFileMappingsRT( char *, char **, int ); +void _hdfNameDescriptor( void ); +void _hdfDescriptorRT( char *, char *, int ); +/*======================================================================* +// Global variables * +//======================================================================*/ +HDFnode_t InitNode; /* Node used in initialization */ +HDFrec_t Tally; /* Node used to get total */ +char *FileName; /* Name of Trace file */ +HDFsetInfo openInfo; /* Info about file opened */ +char openName[256]; /* Name of opened file */ +extern char *hdfRecordPointer; +/*======================================================================* +// NAME * +// HDFinitTrace_RT-- initialize HDF real-time tracing * +// USAGE * +// VOID HDFinitTrace_RT( fileName, procTraceMask) * +// * +// char *fileName; IN: name of output file * +// unsigned procTraceMask; IN: families of procedures to trace * +// RETURNS * +// None. * +//======================================================================*/ +void HDFinitTrace_RT( char *fileName, unsigned procTraceMask ) +{ + int error; + TR_LOCK criticalSection; + TRgetClock( &epoch ); + criticalSection = TRlock(); + error = initHDFProcTrace_RT() ; + procTrace = procTraceMask; + TRunlock( criticalSection ); + if ( error != SUCCESS ) { + fprintf (stderr,"Unable to Initialize properly. Exiting program\n"); + exit(-1); + } + FileName = ( char * ) malloc ( strlen( fileName ) + 1 ); + strcpy( FileName, fileName ) ; +#ifdef HAVE_PARALLEL + /*==============================================================* + // In the parallel case, initialize MPI-IO tracing. This will * + // set the trace file name. * + //==============================================================*/ +/* initMPIOTrace( FileName, RUNTIME_TRACE ); */ +#else + /*==============================================================* + // In the non-parallel case, set the trace file name and * + // initialize the trace library. * + //==============================================================*/ + setTraceFileName(FileName); + basicLibraryInit( ); +#endif /* HAVE_PARALLEL */ +} +/*======================================================================* +// NAME * +// HDFendTrace-- end HDF tracing * +// USAGE * +// VOID HDFendTrace_RT(void) * +// RETURNS * +// None. * +//======================================================================*/ +void HDFendTrace_RT( ) +{ + int j, numSetIDs; + HDFnode_t *P; + char **Names; + char* mapFile; + + /*==============================================================* + // Assing pablo ids to named identifiers and tag records * + //==============================================================*/ + HDFassignPabloIDs( &numSetIDs, &Names ); + mapFile = (char *)malloc( strlen(FileName) + 5 ); + strcpy(mapFile,FileName); + strcat(mapFile,".map"); + printFileMappingsRT( mapFile, Names, numSetIDs ); + /*==============================================================* + // Print SDDF summary records * + //==============================================================*/ + writeHDFRecDescrptrsRT(); + writeHDFNamePacketsRT( Names, numSetIDs ); + for ( j = 0; j < NumHDFProcs; ++j ) { + HDFSummarySDDF( HDFQueues[j], j ); + } + endTracing(); + /*==============================================================* + // Clean up storage * + //==============================================================*/ + free( (void *)mapFile ); + for ( j = 0; j < numSetIDs; ++j ) { + if ( Names[j] != NULL ) { + free((void *)Names[j]); + } + } + free( (void *)Names ); + P = CallStack; + if ( P->ptr != NULL ) { + fprintf(stderr,"CallStack not empty at termination\n"); + } else { + free((void *)P); + } + free((void *)HDFQueues) ; +} +/*======================================================================* +// initHFDProcTrace_RT * +// This function initializes data structures specific to * +// the HDF real-time procedure entry/exit tracing extensions of * +// the Pablo instrumentation library. * +//======================================================================*/ +int initproctracert_( void ) + +{ + return initHDFProcTrace_RT(); +} + +int initHDFProcTrace_RT( void ) + +{ + int i, j, size; + int numProcs = NumHDFProcs; + + if ( traceProcessorNumber == -1 ) { + traceProcessorNumber = TRgetDefaultProcessor(); + } + /*==============================================================* + // Initialize InitNode used for node initialization. * + //==============================================================*/ + InitNode.ptr = NULL; + InitNode.eventID = 0; + InitNode.lastIOtime = 0; + InitNode.record.nCalls = 0; + InitNode.record.lastCall = 0; + InitNode.record.incDur = 0; + InitNode.record.excDur = 0; + InitNode.record.hdfID = 0; + InitNode.record.xRef = 0; + for ( j = 0; j < nTallyFields; ++j ) { + InitNode.record.times[j] = 0; + } + for ( j = 0; j < nTallyFields; ++j ) { + InitNode.record.counts[j] = 0; + } + for ( j = 0; j < nByteFields; ++j ) { + InitNode.record.bytes[j] = 0; + } + for ( i = 0; i < nByteFields; ++i ) { + for ( j = 0; j < nBkts; ++j ) { + InitNode.record.Hists[i][j] = 0; + } + } + /*==============================================================* + // initialize linked list used to keep track of named hdf * + // identifiers. * + //==============================================================*/ + HDFfileList = NULL; + /*==============================================================* + // Allocate a one dimensional array of pointers to queues of * + // HDFnodes. There is one queue for each thread and one for * + // each HDF procedure. Each queue will be a list of summary * + // records distinquished by file type and * + //==============================================================*/ + size = numProcs*sizeof( HDFnode_t * ); + HDFQueues = (HDFnode_t **)malloc( size ); + if ( HDFQueues == NULL ) { + fprintf(stderr,"Failed to allocate HDFQueues in initHDFProcTrace\n"); + return FAILURE; + } + for ( j = 0; j < numProcs; ++j ) { + HDFQueues[j] = NULL; + } + /*==============================================================* + // Initialize call stack to a dummy node and TagQueue to NULL * + //==============================================================*/ + CallStack = (HDFnode_t *)malloc( sizeof(HDFnode_t) ); + *CallStack = InitNode; + TagQueue = NULL ; + return SUCCESS; +} +/*======================================================================* +// This is called from the HDF and I/O routines when real-time summary * +// tracing is used. It sets up a call stack for the specific thread in * +// use if no stack is yet set up. It then calls calls a routine to * +// handle the event based on whether it is an I/O or HDF call. * +//======================================================================*/ +void HDFtraceEvent_RT( int eventType, char *dataPtr, unsigned dataLen ) +{ + TR_LOCK criticalSection; + CLOCK currentTime; + double seconds; + + criticalSection = TRlock(); + currentTime = getClock(); + seconds = clockToSeconds( currentTime ); + + if ( isBeginIOEvent ( eventType ) ) { + BeginIOEventRecord ( eventType, seconds, dataPtr ) ; + } else if ( isEndIOEvent( eventType ) ) { + EndIOEventRecord ( eventType, seconds, dataPtr ); + } else if ( isBeginHDFEvent( eventType ) ) { + BeginHDFEventRecord ( eventType , seconds ) ; + } else if ( isEndHDFEvent( eventType ) ) { + EndHDFEventRecord ( eventType, seconds, dataPtr ); +#ifdef HAVE_PARALLEL + } else if ( isBeginMPIOEvent( eventType ) ) { + BeginMPIOEventRecord ( eventType, seconds, dataPtr ) ; + } else if ( isEndMPIOEvent( eventType ) ) { + EndMPIOEventRecord ( eventType, seconds, dataPtr ); +#endif /* HAVE_PARALLEL */ + } else { + fprintf(stderr,"eventType %d, dataLen = %d\n",eventType,dataLen); + } + TRunlock( criticalSection ); +} +/*======================================================================* +// BeginIOEventRecord: * +// This routine simply records the time in the record on the top of * +// the stack. * +//======================================================================*/ +void BeginIOEventRecord ( int eventType, double seconds, void *dataPtr ) +{ + char *name; + /*==============================================================* + // save the time value temporarily in top of stack * + // When the end record is received, the duration can be * + // computed. * + //==============================================================*/ + CallStack->lastIOtime = seconds; + /*==============================================================* + // get the ID or name of the file accessed from the structure * + // passed as dataPtr. * + //==============================================================*/ + switch ( eventType ) + { + case fopenBeginID: + case openBeginID: + name = (char *)(dataPtr) + 2*sizeof(int); + strcpy( openName, name ); + break; + case fcloseBeginID: + case closeBeginID: + CallStack->record.hdfID = *( long *)dataPtr; + break; + case readBeginID: + case freadBeginID: + case writeBeginID: + case fwriteBeginID: + case lseekBeginID: + case fseekBeginID: + case fsetposBeginID: + case rewindBeginID: + CallStack->record.hdfID = *(int *)dataPtr; + break; + default: + break; + } +} +/*======================================================================* +// EndIOEventRecord: * +// This routine retrieves the entry time saved on the top of the stack * +// and computes the duration of the I/O event. This is added to the * +// record field corresponding to this type of I/O. The Bytes field in * +// the record is updated if this is a read or write operation. * +//======================================================================*/ +void EndIOEventRecord ( int eventType, double secs, void *dataPtr ) +{ + double incDur; + int i, Field, ByteField, bytes; + + incDur = secs - CallStack->lastIOtime; + Field = getHDFFieldIndex( eventType ) ; + CallStack->record.times[Field] += incDur; + ++CallStack->record.counts[Field]; + ByteField = getHDFByteFieldIndex( Field ) ; + switch ( eventType ) + { + case readEndID: + case freadEndID: + case writeEndID: + case fwriteEndID: + case -ID_malloc: + bytes = *((int *)dataPtr); + CallStack->record.bytes[ByteField] += bytes; + /*==================================================== + // update histogram * + //===================================================*/ + i = -1; + while ( bytes >= BktLim[i+1] ) ++i ; + if ( i >= 0 ) ++CallStack->record.Hists[ByteField][i]; + break; + case fopenEndID: + case openEndID: + openInfo.setName = openName; + openInfo.setID = *((long *)dataPtr); + CallStack->record.hdfID = openInfo.setID; + HDFrecordFileName ( &openInfo ); + break; + default: + break; + } + +} +#ifdef HAVE_PARALLEL +/*======================================================================* +// BeginMPIOEventRecord: * +// This routine simply records the time in the record on the top of * +// the stack. * +//======================================================================*/ +void BeginMPIOEventRecord( int eventType, double seconds, void *dataPtr ) +{ + /*==============================================================* + // save the time value temporarily in top of stack * + // When the end record is received, the duration can be * + // computed. * + //==============================================================*/ + CallStack->lastIOtime = seconds; + /*==============================================================* + // get useful info from the structure pointed to by dataPtr. * + // in most cases, this is the file ID. For mpiOpen, it is the * + // name of the file. For mpiDelete, no information is of any * + // use. * + //==============================================================*/ + switch ( eventType ) + { + case mpiGetSizeBeginID: + CallStack->record.hdfID + = ((struct mpiGetSizeBeginArgs *)dataPtr)->fileID; + break; + case mpiGetGroupBeginID: + CallStack->record.hdfID + = ((struct mpiGetGroupBeginArgs *)dataPtr)->fileID; + break; + case mpiGetAmodeBeginID: + CallStack->record.hdfID + = ((struct mpiGetAmodeBeginArgs *)dataPtr)->fileID; + break; + case mpiGetViewBeginID: + CallStack->record.hdfID + = ((struct mpiGetViewBeginArgs *)dataPtr)->fileID; + break; + case mpiGetPositionBeginID: + CallStack->record.hdfID + = ((struct mpiGetPositionBeginArgs *)dataPtr)->fileID; + break; + case mpiGetByteOffsetBeginID: + CallStack->record.hdfID + = ((struct mpiGetByteOffsetBeginArgs *)dataPtr)->fileID; + break; + case mpiGetTypeExtentBeginID: + CallStack->record.hdfID + = ((struct mpiGetTypeExtentBeginArgs *)dataPtr)->fileID; + break; + case mpiGetAtomicityBeginID: + CallStack->record.hdfID + = ((struct mpiGetAtomicityBeginArgs *)dataPtr)->fileID; + break; + case mpiOpenBeginID: + strcpy( openName, + ((struct mpiOpenBeginArgs *)dataPtr)->fileName); + break; + case mpiCloseBeginID: + CallStack->record.hdfID + = ((struct mpiCloseBeginArgs *)dataPtr)->fileID; + break; + case mpiDeleteBeginID: + break; + case mpiSetSizeBeginID: + CallStack->record.hdfID + = ((struct mpiSetSizeBeginArgs *)dataPtr)->fileID; + break; + case mpiPreallocateBeginID: + CallStack->record.hdfID + = ((struct mpiPreallocateBeginArgs *)dataPtr)->fileID; + break; + case mpiSetViewBeginID: + CallStack->record.hdfID + = ((struct mpiSetViewBeginArgs *)dataPtr)->fileID; + break; + case mpiReadAtBeginID: + CallStack->record.hdfID + = ((struct mpiReadAtBeginArgs *)dataPtr)->fileID; + break; + case mpiReadAtAllBeginID: + CallStack->record.hdfID + = ((struct mpiReadAtAllBeginArgs *)dataPtr)->fileID; + break; + case mpiWriteAtBeginID: + CallStack->record.hdfID + = ((struct mpiWriteAtBeginArgs *)dataPtr)->fileID; + break; + case mpiWriteAtAllBeginID: + CallStack->record.hdfID + = ((struct mpiWriteAtAllBeginArgs *)dataPtr)->fileID; + break; + case mpiIreadAtBeginID: + CallStack->record.hdfID + = ((struct mpiIreadAtBeginArgs *)dataPtr)->fileID; + break; + case mpiIwriteAtBeginID: + CallStack->record.hdfID + = ((struct mpiIwriteAtBeginArgs *)dataPtr)->fileID; + break; + case mpiReadBeginID: + CallStack->record.hdfID + = ((struct mpiReadBeginArgs *)dataPtr)->fileID; + break; + case mpiReadAllBeginID: + CallStack->record.hdfID + = ((struct mpiReadAllBeginArgs *)dataPtr)->fileID; + break; + case mpiWriteBeginID: + CallStack->record.hdfID + = ((struct mpiWriteBeginArgs *)dataPtr)->fileID; + break; + case mpiWriteAllBeginID: + CallStack->record.hdfID + = ((struct mpiWriteAllBeginArgs *)dataPtr)->fileID; + break; + case mpiIreadBeginID: + CallStack->record.hdfID + = ((struct mpiIreadBeginArgs *)dataPtr)->fileID; + break; + case mpiIwriteBeginID: + CallStack->record.hdfID + = ((struct mpiIwriteBeginArgs *)dataPtr)->fileID; + break; + case mpiSeekBeginID: + CallStack->record.hdfID + = ((struct mpiSeekBeginArgs *)dataPtr)->fileID; + break; + case mpiSetAtomicityBeginID: + CallStack->record.hdfID + = ((struct mpiSetAtomicityBeginArgs *)dataPtr)->fileID; + break; + case mpiSyncBeginID: + CallStack->record.hdfID + = ((struct mpiSyncBeginArgs *)dataPtr)->fileID; + break; + default: + break; + } +} +/*======================================================================* +// EndMPIOEventRecord: * +// This routine retrieves the entry time saved on the top of the stack * +// and computes the duration of the MPI-I/O event. This is added to * +// the record field corresponding MPI-I/O. * +//======================================================================*/ +void EndMPIOEventRecord ( int eventType, double seconds, void *dataPtr ) +{ + double incDur; + + incDur = seconds - CallStack->lastIOtime; + CallStack->record.times[MPI] += incDur; + ++CallStack->record.counts[MPI]; + if ( eventType == mpiOpenEndID ) { + /*===========================================================* + // complete the file information for the case of a file * + // open and record the information. * + //===========================================================*/ + openInfo.setName = openName; + openInfo.setID = ((struct mpiOpenEndArgs *)dataPtr)->fileID; + CallStack->record.hdfID = openInfo.setID; + HDFrecordFileName ( &openInfo ); + } +} +#endif /* HAVE_PARALLEL */ +/*======================================================================* +// BeginHDFEventRecord: * +// This function puts a trace record on the stack corresponding to * +// this thread. If no stack exists, one is created. If no record * +// exist, a record is created. * +//======================================================================*/ +void BeginHDFEventRecord( int eventID, double secs ) +{ + HDFnode_t *HDFrec; + /*==============================================================* + // Create a record. Push it onto the call stack. * + //==============================================================*/ + HDFrec = (HDFnode_t *)malloc( sizeof(HDFnode_t) ); + HDFnodeInit( HDFrec ) ; + HDFrec->eventID = eventID; + HDFrec->ptr = CallStack; + CallStack = HDFrec ; + /*==============================================================* + // save time stamp in record. * + //==============================================================*/ + HDFrec->record.lastCall = secs; +} +/*======================================================================* +// EndHDFEventRecord: * +// This routine pops the HDF record from the top of the stack * +// corresponding to this thread and computes the inclusive duration * +// and adds it to the inclusive duration field of this record and to * +// the HDF time field of the calling routines record. * +//======================================================================*/ +void EndHDFEventRecord ( int eventID, double seconds, void *dataPtr ) +{ + HDFsetInfo *info; + HDFnode_t *HDFrec; + double incSecs; + static int dummyIDs = -4; + int procIndex; + /*==============================================================* + // Find the procIndex in the table. * + //==============================================================*/ + procIndex = ProcIndexForHDFExit( eventID ); + /*==============================================================* + // pop record from top of the stack, compute inclusive duration * + // and set the corresponding record field and increment nCalls. * + //==============================================================*/ + HDFrec = CallStack; + CallStack = CallStack->ptr; + if ( CallStack == NULL ) { + fprintf(stderr,">>> EndHDFEventRecord: Call Stack is empty. <<<\n"); + return; + } + incSecs = seconds - HDFrec->record.lastCall; + HDFrec->record.incDur = +incSecs; + ++HDFrec->record.nCalls; + /*==============================================================* + // add old record to chain to have its xRef field tagged. * + //==============================================================*/ + HDFrec->ptr = TagQueue; + TagQueue = HDFrec; + /*==============================================================* + // Add set ID information. * + //==============================================================*/ + if ( dataPtr != NULL ) { + info = (HDFsetInfo *)dataPtr; + if ( info->setName != NULL ) { + if ( info->setID == 0 ) { + info->setID = dummyIDs--; + } + HDFrecordFileName ( info ); + } + HDFrec->record.hdfID = info->setID; + } + /*==============================================================* + // Update the HDF totals for the calling program. * + //==============================================================*/ + CallStack->record.times[ HDF_ ] += incSecs ; + ++CallStack->record.counts[ HDF_ ] ; + /*==============================================================* + // If the stack has only one record it represents the main * + // program. Tag all of the records on the TagQueue and tally * + // them up. * + //==============================================================*/ + if ( CallStack->ptr == NULL ) { + HDFupdateProcLists( ); + } +} +/*======================================================================* +// This routine keeps track of the identifier names and tags. Some * +// names may be associated with more than one tag. This will be * +// rectified when final tallies are done. * +//======================================================================*/ +void HDFrecordFileName( HDFsetInfo *info ) +{ + fileRec_t *P; + char *t; + int match, id; + P = HDFfileList; + match = FALSE; + id = info->setID; + while ( P != NULL && match == FALSE ) { + if ( strcmp( P->fileName, info->setName ) != 0 && P->hdfID == id ) { + match = TRUE; + } else { + P = P->ptr; + } + } + if ( match == FALSE ) { + P = ( fileRec_t *) malloc( sizeof( fileRec_t ) ); + P->ptr = HDFfileList; + HDFfileList = P; + t = (char *)malloc( strlen( info->setName ) + 1 ); + strcpy ( t, info->setName ) ; + P->fileName = t; + P->hdfID = info->setID; + P->PabloID = 0; + } +} +/*======================================================================* +// This routine assigns a unique Pablo ID to each unique name * +// regardless of the HDF tag. * +// It then goes through the HDFRecordQueue and marks each record with * +// the PabloID corresponding to the hdfID and xRef fields or 0. * +//======================================================================*/ +void HDFassignPabloIDs( int *nSetIDs, char ***Names ) +{ + fileRec_t *F, *G; + HDFnode_t *P; + int j, hdfID, xRef, PabloID = 1; + char *fName, **T; + + F = HDFfileList; + /*==============================================================* + // Assign the same ID to identical names. * + //==============================================================*/ + while ( F != NULL ) { + if ( F->PabloID == 0 ) { + F->PabloID = PabloID++; + fName = F->fileName; + G = F->ptr; + while ( G != NULL ) { + if ( strcmp( G->fileName , fName ) == 0 ) { + G->PabloID = F->PabloID; + } + G = G->ptr; + } + } + F = F->ptr; + } + *nSetIDs = PabloID - 1; + if ( *nSetIDs <= 0 ) return; + /*==============================================================* + // Repace hdfID and xRef fields with corresponding Pablo ID * + //==============================================================*/ + for ( j = 0; j < NumHDFProcs; ++j ) { + P = HDFQueues[j] ; + while ( P != NULL ) { + hdfID = P->record.hdfID; + if ( hdfID != 0 ) { + PabloID = 0; + F = HDFfileList; + while ( F != NULL && PabloID == 0 ) { + if ( hdfID == F->hdfID ) { + PabloID = F->PabloID; + } + F = F->ptr; + } + P->record.hdfID = PabloID; + } + xRef = P->record.xRef; + if ( xRef != 0 ) { + PabloID = 0; + F = HDFfileList; + while ( F != NULL && PabloID == 0 ) { + if ( xRef == F->hdfID ) { + PabloID = F->PabloID; + } + F = F->ptr; + } + P->record.xRef = PabloID; + } + P = P->ptr; + } /* end while ( P != NULL ) */ + } /* end for */ + /*==============================================================* + // get a list of all the unique names and order them according * + // to their Pablo IDs. * + //==============================================================*/ + T = ( char ** )malloc( (*nSetIDs+1) * sizeof( char * ) ); + for ( j = 0; j <= *nSetIDs; ++j ) { + T[j] = NULL; + } + F = HDFfileList; + while ( F != NULL ) { + PabloID = F->PabloID ; + if ( T[PabloID] == NULL ) { + T[PabloID] = ( char * )malloc( strlen( F->fileName ) + 1 ); + strcpy( T[PabloID], F->fileName ) ; + } + free((void *)(F->fileName)); + G = F; + F = F->ptr; + free ( (void *)G ); + } + *Names = T; +} +/*======================================================================* +// This routine writes SDDF packets to SDDF file containing information * +// about the named identifiers found in the program. * +//======================================================================*/ +void writeHDFNamePacketsRT( char **Names, int numSetIDs ) +{ + int j; + HDFNamePacket_t NamePkt; + char *BUFF, *fName; + int buffSize; + /*==============================================================* + // Allocate a buffer to hold the packet. Allow 80 chars for * + // identifier name. * + //==============================================================*/ + buffSize = sizeof(HDFNamePacket_t) + 80; + BUFF = (char *)malloc(buffSize); + /*==============================================================* + // Fill in constant information * + //==============================================================*/ + NamePkt.packetType = PKT_DATA; + NamePkt.packetTag = FAMILY_NAME; + /*==============================================================* + // Fill in named identifier information and write to SDDF file * + //==============================================================*/ + for ( j = 1; j <= numSetIDs; ++j ) { + fName = Names[j]; + NamePkt.packetLength = sizeof(NamePkt) + strlen(fName) ; + NamePkt.fileType = 0; /* not currently used */ + NamePkt.fileID = j; + NamePkt.nameLen = strlen(fName) ; + if ( buffSize < NamePkt.packetLength ) { + free((void *)BUFF) ; + buffSize = NamePkt.packetLength + 80; + BUFF = (char *)malloc( buffSize ) ; + } + /*===========================================================* + // Copy packet data and tack on identifier name * + //===========================================================*/ + memcpy( BUFF, &NamePkt, sizeof(NamePkt) ); + memcpy( BUFF + sizeof(NamePkt) , fName, strlen(fName) ); + putBytes( BUFF , NamePkt.packetLength ) ; + } + free((void *)BUFF); +} +/*======================================================================* +// Tag xRef field of all records in this queue with the hdfID of the * +// highest level caller. Also * +// This routine takes the records after they have been tagged and adds * +// their fields to the apporopriate position in the HDFQueues structure * +//======================================================================*/ +void HDFupdateProcLists( ) +{ + HDFnode_t *P, *Q; + int hdfID; + + hdfID = TagQueue->record.hdfID; + P = TagQueue; + while ( P != NULL ) { + P->record.xRef = hdfID; + Q = P->ptr; + HDFupdateProcs( P ); + P = Q; + } + TagQueue = NULL; +} +/*======================================================================* +// This routine takes as input a node pointer P and looks for a Total * +// record with this same eventID, hdfID and xRef. If such a record * +// exists, P is added to the record, otherwise a record is created and * +// its values are set to P's. * +//======================================================================*/ +void HDFupdateProcs( HDFnode_t *P ) +{ + int procIndex, hdfID, xRef, eventID; + HDFnode_t *Q; + eventID = P->eventID; + procIndex = ProcIndexForHDFEntry( eventID ); + hdfID = P->record.hdfID; + xRef = P->record.xRef; + Q = HDFQueues[ procIndex ]; + /*==============================================================* + // First determine if a tally node exists that matches the * + // eventID, hdfID and xRef of P. * + //==============================================================*/ + while ( Q != NULL && + (( Q->record.hdfID != hdfID ) || ( Q->record.xRef != xRef )) ) { + Q = Q->ptr; + } + if ( Q == NULL ) { + /*===========================================================* + // No tally record matches the hdfID and xRef so put P in * + // the queue. * + //===========================================================*/ + P->ptr = HDFQueues[ procIndex ]; + HDFQueues[ procIndex ] = P; + } else { + /*===========================================================* + // add P to the exiting record and free it. * + //===========================================================*/ + HDFrecordSum ( &Q->record , &P->record ); + free((void *)P); + } +} +/*======================================================================* +// Print SDDF records for all records in this linked list. * +//======================================================================*/ +void HDFSummarySDDF( HDFnode_t *P, int procIndex ) +{ + int i, arrayLen; + char buff[1024]; + char *Packet; + HDFnode_t *Q; + struct { + int packetLen, + packetTag, + packetType, + eventID, + threadID, + nCalls; + double Seconds, + IncDur, + ExcDur; + long HDFid, + XREFid; + } Header; + + Packet = buff; + Header.packetLen = sizeof(Header) + + sizeof(int) /* array len */ + + nTallyFields*sizeof(double) /* times array */ + + sizeof(int) /* array len */ + + nTallyFields*sizeof(int) /* count array */ + + sizeof(int) /* array len */ + + nByteFields*sizeof(int) /* bytes array */ + + nByteFields*sizeof(int) /* array lens */ + + nByteFields*nBkts*sizeof(int) /* byte hist */ + + sizeof(int) ; /* Name len */ + Header.packetTag = ( procIndex + 1 )*HDF_FAMILY | RECORD_TRACE ; + Header.packetType = PKT_DATA; + Header.threadID = TRgetNode(); + while ( P != NULL ) { + Q = P->ptr; + Header.eventID = Q->eventID; + Header.Seconds = Q->record.lastCall; + Header.IncDur = Q->record.incDur; + Header.ExcDur = Q->record.excDur; + Header.HDFid = Q->record.hdfID; + Header.XREFid = Q->record.xRef; + memcpy( Packet, &Header, sizeof(Header) ); + Packet += sizeof(Header); + /*===========================================================* + // copy length of times array and times array to Packet. * + //===========================================================*/ + arrayLen = nTallyFields; + memcpy( Packet, &arrayLen, sizeof(int) ); + Packet += sizeof(int); + memcpy( Packet, Q->record.times, nTallyFields*sizeof(int) ); + Packet += nTallyFields*sizeof(int); + /*===========================================================* + // copy length of counts array and counts array to Packet. * + //===========================================================*/ + arrayLen = nTallyFields; + memcpy( Packet, &arrayLen, sizeof(int) ); + Packet += sizeof(int); + memcpy( Packet, Q->record.counts, nTallyFields*sizeof(int) ); + Packet += nTallyFields*sizeof(int); + /*===========================================================* + // copy length of bytes array and bytes array to Packet. * + //===========================================================*/ + arrayLen = nByteFields; + memcpy( Packet, &arrayLen, sizeof(int) ); + Packet += sizeof(int); + memcpy( Packet, Q->record.counts, nByteFields*sizeof(int) ); + Packet += nByteFields*sizeof(int); + /*===========================================================* + // copy length of historgram arrays and arrays to Packet. * + //===========================================================*/ + arrayLen = nBkts; + for ( i = 0; i < nByteFields; ++i ) { + memcpy( Packet, &arrayLen, sizeof(int) ); + Packet += sizeof(int); + memcpy( Packet, Q->record.Hists[i], nBkts*sizeof(int) ); + Packet += nBkts*sizeof(int); + } + arrayLen = 0; /* name length */ + memcpy( Packet, &arrayLen, sizeof(int) ); + putBytes( buff, Header.packetLen ); + free((void *)P); + P = Q; + } +} +/*======================================================================* +// Initialize a node. * +//======================================================================*/ +void HDFnodeInit ( HDFnode_t *S ) +{ + *S = InitNode; +} +/*======================================================================* +// Compute IO totals, exclusive durations of the input record T * +// then add the fields of T to that of S. * +//======================================================================*/ +void HDFrecordSum ( HDFrec_t *S, HDFrec_t *T ) +{ + int i, j, allIOCount; + double allIOTime; + allIOTime = 0; + for ( j = FirstIO; j <= LastIO; ++j ) { + allIOTime += T->times[j]; + } + T->times[AllIO] = allIOTime; + + allIOCount = 0; + for ( j = FirstIO; j <= LastIO; ++j ) { + allIOCount += T->counts[j]; + } + T->counts[AllIO] = allIOCount; + + T->excDur = T->incDur - ( T->times[HDF_] + T->times[MPI] + + T->times[AllIO] ); + + S->nCalls += T->nCalls; + S->lastCall = max( S->lastCall, T->lastCall ); + S->incDur += T->incDur; + S->excDur += T->excDur; + for ( j = 0; j < nTallyFields; ++j ) { + S->times[j] += T->times[j] ; + } + for ( j = 0; j < nTallyFields; ++j ) { + S->counts[j] += T->counts[j] ; + } + for ( j = 0; j < nByteFields; ++j ) { + S->bytes[j] += T->bytes[j] ; + } + for ( j = 0; j < nByteFields; ++j ) { + for ( i = 0; i < nBkts; ++i ) { + S->Hists[j][i] += T->Hists[j][i] ; + } + } +} +/*======================================================================* +// Return the field index corresponding to an IO event ID. The fields * +// are specified in an enum statement in an include file. * +//======================================================================*/ +int getHDFFieldIndex( int eventID ) +{ + int result = -1; + switch ( eventID ) + { + case ID_malloc: + case -ID_malloc: + result = Malloc; + break; + case openBeginID: + case openEndID: + case fopenBeginID: + case fopenEndID: + result = Open; + break; + case closeBeginID: + case closeEndID: + case fcloseBeginID: + case fcloseEndID: + result = Close; + break; + case readBeginID: + case readEndID: + case freadBeginID: + case freadEndID: + result = Read; + break; + case lseekBeginID: + case lseekEndID: + case fseekBeginID: + case fseekEndID: + result = Seek; + break; + case writeBeginID: + case writeEndID: + case fwriteBeginID: + case fwriteEndID: + result = Write; + break; + case fflushBeginID: + case fflushEndID: + case flushBeginID: + case flushEndID: + result = Misc; + break; + case rewindBeginID: + case rewindEndID: + case fsetposBeginID: + case fsetposEndID: + result = Misc; + break; +#ifdef creadBeginID + case creadBeginID: + case creadEndID: + case creadvBeginID: + case creadvEndID: + result = Read; + break; + case cwriteBeginID: + case cwriteEndID: + case cwritevBeginID: + case cwritevEndID: + result = Write; + break; + case ireadBeginID: + case ireadEndID: + case ireadvBeginID: + case ireadvEndID: + result = ARead; + break; + case iwriteBeginID: + case iwriteEndID: + case iwritevBeginID: + case iwritevEndID: + result = AWrite; + break; + case iowaitBeginID: + case iowaitEndID: + result = Wait; + break; + case iodoneBeginID: + case iodoneEndID: + result = Misc; + break; + case gopenBeginID: + case gopenEndID: + result = Open; + break; + case iomodeBeginID: + case iomodeEndID: + case setiomodeBeginID: + case setiomodeEndID: + case lsizeBeginID: + case lsizeEndID: + case forflushBeginID: + case forflushEndID: + result = Misc; + break; +#endif + } + return result; +} +/*======================================================================* +// This routine determines the field index in the bytes array of the * +// HDF records which correspond to a given IO operation. If the * +// operation does not transfer bytes, (e.g., open operation), -1 is * +// returned. * +//======================================================================*/ +int getHDFByteFieldIndex( int Operation ) +{ + int result; + switch ( Operation ) + { + case Malloc: + result = MallocBytes; + break; + case Read: + result = ReadBytes; + break; + case Write: + result = WriteBytes; + break; + case ARead: + result = AReadBytes; + break; + case AWrite: + result = AWriteBytes; + break; + default: + result = -1; + break; + } + return result; +} +/*======================================================================* +// This routine writes the SDDF packet descriptors for the HDF summary * +// records to the output file. * +//======================================================================*/ +void _hdfDescriptorRT( char *recordName, char *recordDescription, + int recordFamily ) +{ + static char recordBuffer[ 4096 ]; + int recordLength; + + hdfRecordPointer = recordBuffer; + /*==================================================================* + // Allow space at the beginning of the record for the packet * + //length which will be computed after the packet is complete. * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 0 ); + /*==================================================================* + // The record type, tag, and name * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, PKT_DESCRIPTOR ); + sddfWriteInteger( &hdfRecordPointer, ( recordFamily | RECORD_TRACE ) ); + sddfWriteString( &hdfRecordPointer, recordName ); + /*==================================================================* + // The record attribute count and string pair * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 1 ); + sddfWriteString( &hdfRecordPointer, "description" ); + sddfWriteString( &hdfRecordPointer, recordDescription ); + /*==================================================================* + // The record field count * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 17 ); + WRITE_HDF_FIELD( "Event Identifier", + "Event ID", + "Corresponding Event", + INTEGER, 0 ); + WRITE_HDF_FIELD( "Processor Number", + "Node", + "Processor number", + INTEGER, 0 ); + WRITE_HDF_FIELD( "N Calls", + "N Calls", + "Number of Calls to this Proc", + INTEGER, 0 ); + WRITE_HDF_FIELD( "Seconds", + "Seconds", + "Floating Point Timestamp", + DOUBLE, 0 ); + WRITE_HDF_FIELD( "Inclusive Duration", + "Inclusive Duration", + "Inclusive Duration of this Procedure", + DOUBLE, 0 ); + WRITE_HDF_FIELD( "Exclusive Duration", + "Exclusive Duration", + "Excludes IO, MPI-IO and other HDF calls", + DOUBLE, 0 ); + WRITE_HDF_FIELD2("HDF ID", + "HDF ID", "Identifier number", + "0", "No HDF ID specified", + LONG, 0 ); + WRITE_HDF_FIELD( "Xref ID", + "Cross Reference", + "Index of related HDF ID or 0 if none", + LONG, 0 ); + WRITE_HDF_FIELD( "Times Array", + "Times Array", + "Array of Total Operation Times", + DOUBLE, 1 ); + WRITE_HDF_FIELD( "Counts Array", + "Counts Array", + "Array of Total Operation Counts", + INTEGER, 1 ); + WRITE_HDF_FIELD( "Bytes Array", + "Bytes Array", + "Array of Total Bytes Transferred", + INTEGER, 1 ); + WRITE_HDF_FIELD( "Malloc Histogram", + "Malloc Histogram", + "Historgram of size Malloc Requests", + INTEGER, 1 ); + WRITE_HDF_FIELD( "Read Histogram", + "Read Histogram", + "Historgram of size Read Requests", + INTEGER, 1 ); + WRITE_HDF_FIELD( "Write Histogram", + "Write Histogram", + "Historgram of size Write Requests", + INTEGER, 1 ); + WRITE_HDF_FIELD( "ARead Histogram", + "ARead Histogram", + "Historgram of size Asynch Read Requests", + INTEGER, 1 ); + WRITE_HDF_FIELD( "AWrite Histogram", + "AWrite Histogram", + "Historgram of size Asynch Write Requests", + INTEGER, 1 ); + WRITE_HDF_FIELD( "HDF Name", + "HDF Name", + "Name of File,Data Set or Dim accessed", + CHARACTER, 1 ); + /*=================================================================== + // The entire record descriptor packet has been written. * + // Compute and update the record length. * + // Write the completed record. * + //==================================================================*/ + recordLength = hdfRecordPointer - recordBuffer; + + hdfRecordPointer = recordBuffer; + sddfWriteInteger( &hdfRecordPointer, recordLength ); + + putBytes( recordBuffer, (unsigned) recordLength ); +} + +/*======================================================================* +// Internal Routine: writeHDFRecDescrptrsRT * +// Writes record descriptors for the HDF events. * +//======================================================================*/ +void writeHDFRecDescrptrsRT() +{ + char HDFProcNames[][40] = { +# include "HDFentryNames.h" + "HDF_Last_Entry" + }; + int j; + char BUF1[256], BUF2[256] ; + _hdfNameDescriptor(); /* Descriptor for named identifiers */ + for ( j = 0; j < NumHDFProcs; ++j ) { + if ( HDFQueues[j] != NULL ) { + strcpy( BUF2, "HDF "); + strcat( BUF2, HDFProcNames[j] ); + strcat( BUF2, " Procedure Summary"); + strcpy( BUF1, BUF2 ); + strcat( BUF1, " Trace"); + _hdfDescriptorRT( BUF1, BUF2, (j+1)*HDF_FAMILY ); + } + } + return; +} +/*======================================================================* +// This routine prints the Pablo IDs assigned to named HDF identifiers * +//======================================================================*/ +void printFileMappingsRT( char *mapFile, char **Names, int nPabloIDs ) +{ + int i; + FILE *ptr; + ptr = fopen( mapFile, "w" ); + + if ( ptr == NULL ) { + fprintf(stderr, + "Couldn't open map file %s - none created.\n",mapFile); + return; + } + + fprintf(ptr,"\n\nPablo ID to HDF Name mappings:\n"); + fprintf(ptr,"------------------------------\n"); + for ( i = 1; i <= nPabloIDs; i++ ) { + fprintf(ptr,"%4d %s\n",i,Names[i] ); + } + fprintf(ptr,"\n\n"); + fclose( ptr ); +} +/************************************************************************/ +/* _hdfNameDescriptor */ +/* Generate a SDDF binary format record descriptor for the */ +/* named identifiers used during execution. */ +/************************************************************************/ +void _hdfNameDescriptor() +{ + static char recordBuffer[ 4096 ]; + int recordLength; + +#ifdef DEBUG + fprintf( debugFile, "_hdfExitTraceDescriptor entered\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + hdfRecordPointer = recordBuffer; + /********************************************************************/ + /* Allow space at the beginning of the record for the packet */ + /*length which will be computed after the packet is complete. */ + /********************************************************************/ + sddfWriteInteger( &hdfRecordPointer, 0 ); + /********************************************************************/ + /* The record type, tag, and name */ + /********************************************************************/ + sddfWriteInteger( &hdfRecordPointer, PKT_DESCRIPTOR ); + sddfWriteInteger( &hdfRecordPointer, ( FAMILY_NAME ) ); + sddfWriteString( &hdfRecordPointer, "HDF Name Identifier Record" ); + /********************************************************************/ + /* The record attribute count and string pair */ + /********************************************************************/ + sddfWriteInteger( &hdfRecordPointer, 1 ); + sddfWriteString( &hdfRecordPointer, "description" ); + sddfWriteString( &hdfRecordPointer, "HDF Name Identifier Record" ); + /********************************************************************/ + /* The record field count */ + /********************************************************************/ + sddfWriteInteger( &hdfRecordPointer, 3); + /********************************************************************/ + /* Create fields */ + /********************************************************************/ + WRITE_HDF_FIELD( "Identifier Type", + "Data Set Type", + "Data Set Identifier Type", + INTEGER, 0 ); + WRITE_HDF_FIELD2( "HDF ID", + "HDF ID", "File, Data Set or Dim Identifier number", + "0", "No HDF ID specified", + INTEGER, 0 ); + WRITE_HDF_FIELD( "HDF Name", + "HDF Name", "Name of File, Data Set or Dim", + CHARACTER, 1 ); + + recordLength = hdfRecordPointer - recordBuffer; + + hdfRecordPointer = recordBuffer; + sddfWriteInteger( &hdfRecordPointer, recordLength ); + + putBytes( recordBuffer, (unsigned) recordLength ); +} diff --git a/pablo/PabloHDF_SDDF.c b/pablo/PabloHDF_SDDF.c new file mode 100644 index 0000000..af57200 --- /dev/null +++ b/pablo/PabloHDF_SDDF.c @@ -0,0 +1,1028 @@ +/* + * This file is an extension to NCSA HDF to enable the use of the + * Pablo trace library. + * + * Developed by: The TAPESTRY Parallel Computing Laboratory + * University of Illinois at Urbana-Champaign + * Department of Computer Science + * 1304 W. Springfield Avenue + * Urbana, IL 61801 + * + * Copyright (c) 1995 + * The University of Illinois Board of Trustees. + * All Rights Reserved. + * + * PABLO is a registered trademark of + * The Board of Trustees of the University of Illinois + * registered in the U.S. Patent and Trademark Office. + * + * Author: George Xin Zhou (xzhou@cs.uiuc.edu) + * Contributing Author: Jonathan M. Reid (jreid@cs.uiuc.edu) + * + * Project Manager and Principal Investigator: + * Daniel A. Reed (reed@cs.uiuc.edu) + * + * Funded by: National Aeronautics and Space Administration under NASA + * Contracts NAG-1-613 and USRA 5555-22 and by the Advanced Research + * Projects Agency under ARPA contracts DAVT63-91-C-0029 and + * DABT63-93-C-0040. + * + */ +/*======================================================================* +// File: PabloHDF_SDDF.c * +// Purpose: support use of Pablo trace library to analyze HDF * +// performance * +// Contents: * +// HDFinitTrace_SDDF: initialize SDDF tracing * +// HDFendTrace_SDDF: end SDDF tracing * +// startHDFtraceEvent: record start of HDF procedure * +// endHDFtraceEvent: record end of HDF proc * +// preInitHDFProcTrace: called by HDFinitTrace_SDDF to set up SDDF * +// interface function calls * +// initHDFProcTrace: called by HDFinitTrace_SDDF to initialize data * +// structures used in tracing HDF procedures. * +// writeHDFProcRecordDescriptors: * +// generates the record descriptors for the HDF * +// procedure entry/exit event families. * +// HDFprocEventRecord: generates trace records for events which are * +// to produce procedure entry or exit event family * +// trace records. * +// findHDFProcEvent: retruns procedure entry/exit index * +// _hdfTraceEntryDescriptor: * +// Generate a SDDF binary format record descriptor * +// for HDF procedure entries * +// _hdfTraceExitDescriptor: * +// Generate a SDDF binary format record descriptor * +// for the HDF procedure exits * +//======================================================================*/ +#include <stdio.h> + +#ifdef HAVE_PARALLEL +#include "mpi.h" +#endif + +#undef HAVE_PABLO +#include "H5private.h" +#define HAVE_PABLO +#include "H5config.h" +#include "ProcIDs.h" + +#include "SystemDepend.h" +#include "SDDFparam.h" +#include "TraceParam.h" +#include "Trace.h" +#include "HDFTrace.h" +void HDFendTrace_SDDF(void); +void startHDFtraceEvent(int eventID); +void endHDFtraceEvent(int , int , char *, int ); +int preInitHDFProcTrace( void ); +int initHDFProcTrace( int , int * ); +int writeHDFProcRecordDescriptors( void ); +int findHDFProcEvent( int ) ; +TR_RECORD *HDFprocEventRecord( int, TR_EVENT *, CLOCK, HDFsetInfo *, unsigned ); +TR_RECORD *miscEventRecord( int , TR_EVENT *, CLOCK, void *, unsigned ); +void _hdfTraceEntryDescriptor( void ); +void _hdfTraceExitDescriptor( void ); +void _hdfMiscDescriptor( void ); +void _hdfProcNameDescriptor( void ); +int setEventRecordFunction( int, void * ); +void HDFtraceIOEvent( int, void *, unsigned ); +void initIOTrace( void ); +void enableIOdetail( void ); +void disableLifetimeSummaries( void ); +void disableTimeWindowSummaries( void ); +void disableFileRegionSummaries( void ); + +void initIOTrace( void ); +void endIOTrace( void ); +#define PABLO 1 +/* on the ipsc/860 we don't include unistd.h */ +#ifndef __NX +#include <unistd.h> +#endif + +#define returnRecord(x) return x; + +#ifdef HAVE_MPIOTRACE + int initMPIOTrace( char *, int ); + void endMPIOTrace( void ) ; +#endif +extern char *hdfRecordPointer; +/*======================================================================* +// Prototypes of functions in this file. * +//======================================================================*/ +void HDFinitTrace_SDDF( char *, uint32 ); +/*======================================================================* +// Each procedure being traced has associated with it a distinct pair * +// of entry and exit event IDs. This code maintains a vector of such * +// matchings which permits the ready identification of an event ID as * +// being either an entry event or an exit event and for which procedure.* +//======================================================================*/ +typedef struct procEventMatch { + int entryID; /* procedure entry event ID */ + int exitID; /* procedure exit event ID */ +} PROC_EVENTS; + +static PROC_EVENTS *procEvents = /* array of event ID pairs */ + (PROC_EVENTS *) 0; +/*======================================================================* +// For each procedure being traced this code maintains a stack of * +// procedure entry times. Each procedure entry event causes the * +// corresponding procedure's stack to be pushed, each procedure exit * +// event causes the corresponding procedure's stack to be popped, and * +// from the difference in time between entry and exit the procedure * +// duration may be calculated in a very straightforward subtraction. * +// The above procedure entry-exit event ID matching is used to map * +// events to their corresponding procedures. In addition, the * +// cumulative total of these procedure durations is maintained for all * +// traced subprocedures of each traced procedure. That is, when a * +// traced procedure exits, it increases this duration sum for its most * +// immediate traced ancestor procedure. By subtracting this * +// subprocedure duration sum from the traced procedure's inclusive * +// duration, we arrive at the exclusive duration of the procedure. * +//======================================================================*/ +typedef struct procEntryTime { + CLOCK entryTime; /* when proc entered */ + CLOCK subProcTime; /* subproc duration */ + struct procEntryTime *nextTime; /* stack pointer down */ + struct procEntryTime *ancestorProc; /* traced ancestor */ +} PROC_ENTRY; + +/* +static PROC_ENTRY **procEntryStack =*/ /* array of pointers to */ +/* (PROC_ENTRY **) 0;*/ /* stack top elements */ +/*======================================================================* +// Define data structure types for procedure entry and exit trace * +// records, similarly to record data structures in Trace.h * +//======================================================================*/ + +/*======================================================================* +// FAMILY_PROCENTRY family Record Data packets: * +//======================================================================*/ +struct procEntryTraceRecordData { + int packetLength; /* bytes in packet */ + int packetType; /* == PKT_DATA */ + int packetTag; /* FAMILY_PROCENTRY | RECORD_TRACE */ + int eventID; /* ID of corresponding event */ + double seconds; /* floating-point timestamp */ + long sourceByte; /* source code byte offset in file */ + int sourceLine; /* source code line number in file */ + int nodeNumber; /* occurred on which node */ +}; +#define procEntryTraceLen 6*sizeof(int) + sizeof(long) + sizeof(double) +/*======================================================================* +// FAMILY_PROCEXIT family Record Data packets: * +//======================================================================*/ +struct procExitTraceRecordData { + int packetLength; /* bytes in packet */ + int packetType; /* == PKT_DATA */ + int packetTag; /* FAMILY_PROCEXIT | RECORD_TRACE */ + int eventID; /* ID of corresponding event */ + double seconds; /* floating-point timestamp */ + long setID; /* index of file | Data Set accessed */ + int nodeNumber; /* occurred on which node */ + int nameLen; /* Length of file or data set name */ + /* name comes next, but no space is allocated */ +}; +#define procExitTraceLen 6*sizeof(int) + 3*sizeof(double) +sizeof(long) +/*======================================================================* +// misc Record Data packets: * +//======================================================================*/ +struct miscTraceRecordData { + int packetLength; /* bytes in packet */ + int packetType; /* == PKT_DATA */ + int packetTag; /* FAMILY_MISC | RECORD_TRACE */ + int eventID; /* ID of corresponding event */ + double seconds; /* floating-point timestamp */ + double duration; /* floating-point operation duration */ + unsigned long bytes; /* number of bytes requested */ + int nodeNumber; /* occurred on which node */ +}; +#define miscTraceLen 5*sizeof(int) + 2*sizeof(double) +sizeof(long) +/*======================================================================* +// HDFprocName Record Data packets: * +// These are used to pass information about the names of the traced * +// routine in the trace file to the post processing utilities. * +//======================================================================*/ +struct HDFprocNameRecordData { + int packetLength; /* bytes in packet */ + int packetType; /* == PKT_DATA */ + int packetTag; /* FAMILY_HDFPROCNAME | RECORD_TRACE */ + int eventID; /* ID of corresponding event */ + int HDFeventID; /* ID of HDF proc */ + int procIndex; /* Index of HDF proc */ + int numProcs; /* Number of HDF procs */ + int NameLen; /* length of HDF proc Name */ + char *Name; +}; +#define HDFprocNameRecLen 8*sizeof(int) +/*======================================================================* +// Define data structures used to contain source code location data for * +// Pablo instrumenting parser-generated code. * +//======================================================================*/ +static long procByteOffset = -1; /* source code byte offset */ + +static int procLineNumber = -1; /* source code line number */ + +/*======================================================================* +// The procEntries array specifies the event IDs of procedure entry * +// events. * +//======================================================================*/ +int procEntries[] = { +#include "HDFidList.h" +ID_HDF_Last_Entry +}; +/*======================================================================* +// The procEntryCalled array indicates whether or not a procedure entry * +// was called. * +//======================================================================*/ +int *procEntryCalled; +/*======================================================================* +// The HDFProcNames array holds the names of the HDF entries. * +//======================================================================*/ +static char HDFProcNames[][40] = { +#include "HDFentryNames.h" +"HDF_LAST_ENTRY" +}; +/*======================================================================= +// NAME * +// HDFinitTrace_SDDF -- initalize HDF tracing with SDDF records * +// USAGE * +// HDFinitTrace_SDDF( traceFileName, procTraceMask ) * +// PARAMETERS * +// char *traceFileName -- name of trace file to hold output * +// uint32 prcoTraceMask -- mask indicating classes of HDF procs to * +// be traced * +// RETURNS * +// None * +//======================================================================*/ +void HDFinitTrace_SDDF( char *traceFileName, uint32 procTraceMask ) +{ + /*=============================================================== + // set traceFileName and set IO tracing switches. If MPIO * + // tracing is available, this will be initialized also. * + //==============================================================*/ +#ifdef HAVE_PARALLEL + /*=============================================================== + // in the parallel case, initialize MPI-IO tracing. This will * + // initialize the traceFileName and set the I/O tracing * + // switches. * + //==============================================================*/ + MPI_Comm_rank( MPI_COMM_WORLD, &myNode ); + setTraceProcessorNumber( myNode ); +#ifdef HAVE_MPIOTRACE + initMPIOTrace( traceFileName, 0 ); +#else + buff = (char *)malloc( strlen(traceFileName)+12); + sprintf( buff, "%s.nd%.4d\0",traceFileName,myNode); + setTraceFileName( buff ); + free( buff ); +#endif +#else + /*=============================================================== + // in the non-parallel case, set the trace file name and the * + // I/O tracing switches. * + //==============================================================*/ + setTraceFileName(traceFileName); + initIOTrace(); + enableIOdetail(); + disableLifetimeSummaries(); + disableTimeWindowSummaries(); + disableFileRegionSummaries(); +#endif /* HAVE_PARALLEL */ + /*=============================================================== + // complete HDF initiailization. * + //==============================================================*/ + preInitHDFProcTrace(); + initHDFProcTrace( sizeof(procEntries)/sizeof(int), procEntries ); + procTrace = procTraceMask; +} +/*======================================================================= +// NAME * +// HDFendTrace_SDDF -- end HDF tracing * +// USAGE * +// HDFendTrace_SDDF() * +// RETURNS * +// None. * +//======================================================================*/ +void HDFendTrace_SDDF(void) +{ + HDFtraceIOEvent( -ID_timeStamp, 0, 0 ); +#ifdef HAVE_MPIOTRACE + /*=============================================================== + // termintate MPI-IO tracing in the parallel case. This will * + // terminate the I/O tracing and close tracing as well. * + //==============================================================*/ + endMPIOTrace(); +#else + /*=============================================================== + // terminate tracing * + //==============================================================*/ + endIOTrace(); + endTracing(); +#endif +} +/*======================================================================= +// NAME * +// initHDFProcTrace: * +// This function initializes data structures specific to * +// the procedure entry/exit tracing extensions of the Pablo * +// instrumentation library. The argument numProcs specifies * +// how many procedures are to be traced. The argument procEntryID * +// is a vector specifying the event IDs to be use as entry events * +// for each of the procedures. The negative value is used for * +// the exit event ID. * +// USAGE * +// result = initHDFProcTrace(numProcs,procEntryID) * +// PARAMETERS * +// int numProcs -- number of Procedures to be initialized * +// int *procEntryID -- array of id entry codes for these procedures * +// RETURNS * +// SUCCESS or FAILURE * +//======================================================================*/ +int initHDFProcTrace( int numProcs, int *procEntryID ) +{ + int procIndex; + + if (( numProcs <= 0 ) || ( procEntryID == (int *) 0 ) ) + return FAILURE; + /*=============================================================== + // Allocate space to store a copy of the procedure entry-exit * + // event ID matchings and also the procedure entry stacks. * + //==============================================================*/ + procEvents = (PROC_EVENTS *) TRgetBuffer( + (numProcs+4)*sizeof(PROC_EVENTS) ); + + if ( procEvents == (PROC_EVENTS *) 0 ) + TRfailure( "cannot allocate procedure events matching" ); + + procEntryCalled = ( int *)malloc( numProcs*sizeof(int) ); + if ( procEvents == NULL ) + TRfailure( "cannot allocate procedure Called indicators" ); + /*=============================================================== + // Initialize the procedure events matching from the arguments * + // passed. Configure the trace record-generating function for * + // these events. Initialize the flags indicating whether or * + // not the procedure was called. * + //==============================================================*/ + for ( procIndex = 0; procIndex < numProcs; procIndex++ ) { + + procEvents[ procIndex ].entryID = procEntryID[ procIndex ]; + procEvents[ procIndex ].exitID = -procEntryID[ procIndex ]; + + setEventRecordFunction( procEntryID[ procIndex ], + HDFprocEventRecord ); + setEventRecordFunction( -procEntryID[ procIndex ], + HDFprocEventRecord ); + procEntryCalled[ procIndex ] = 0; + + } + + /*=============================================================== + // Initialize the procedure events for malloc. * + // Configure the trace record-generating function for this * + // event. * + //==============================================================*/ + procEvents[ numProcs ].entryID = ID_malloc; + procEvents[ numProcs ].exitID = -ID_malloc; + setEventRecordFunction( ID_malloc, miscEventRecord ); + setEventRecordFunction( -ID_malloc, miscEventRecord ); + procEvents[ numProcs+1 ].entryID = ID_free; + procEvents[ numProcs+1 ].exitID = -ID_free; + setEventRecordFunction( ID_free, miscEventRecord ); + setEventRecordFunction( -ID_free, miscEventRecord ); + procEvents[ numProcs+2 ].entryID = ID_timeStamp; + procEvents[ numProcs+2 ].exitID = -ID_timeStamp; + setEventRecordFunction( ID_timeStamp, miscEventRecord ); + setEventRecordFunction( -ID_timeStamp, miscEventRecord ); + + return SUCCESS; +} +/*======================================================================= +// NAME * +// preInitHDFProcTrace: * +// This function calls the trace library interface function * +// setRecordDescriptor, which records the address of the * +// procedure that generates the record descriptors for the * +// procedure trace event families. It is automatically * +// invoked by HDFinitTrace_SDDF. * +// USAGE * +// result = preInitHDFProcTrace(); * +// RESULT * +// SUCCESS or FAILURE * +/=======================================================================*/ +int preInitHDFProcTrace( void ) +{ + static int preInitDone = FALSE; + + if ( preInitDone == TRUE ) + return SUCCESS; + /*=============================================================== + // Give the instrumentation library a pointer to the functions * + // in which we output the specialized record descriptors for * + // procedure entry/exit. * + //==============================================================*/ + setRecordDescriptor( writeHDFProcRecordDescriptors ); + + preInitDone = TRUE; + return SUCCESS; +} +/*======================================================================= +// NAME * +// writeHDFProcRecordDescriptors: * +// This function generates the record descriptors for the HDF * +// procedure entry/exit event families. It will be invoked * +// by the instrumentation library initialization routines. * +// Patterned after instrumentation library internal function * +// writeRecordDescriptors. * +// USAGE * +// result = writeHDFProcRecordDescriptors(); * +// RESULT * +// SUCCESS * +/=======================================================================*/ +int writeHDFProcRecordDescriptors( void ) +{ +#ifdef DEBUG + fprintf( debugFile, "writeHDFProcRecordDescriptors\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + + _hdfMiscDescriptor(); + _hdfTraceEntryDescriptor() ; + _hdfTraceExitDescriptor() ; + _hdfProcNameDescriptor(); + +#ifdef DEBUG + fprintf( debugFile, "writeHDFProcRecordDescriptors done\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + return SUCCESS; +} +/*======================================================================= +// NAME * +// HDFprocEventRecord: * +// This function generates trace records for events which are * +// to produce procedure entry or exit event family trace records. * +// Patterned after the instrumentation library internal functions * +// externalEventRecord and sddfRecord. * +// USAGE * +// REC = HDFprocEventRecord( recordType, eventPointer, timeStamp, * +// dataPointer, dataLength) * +// PARAMETERS * +// int recordType -- type of event record * +// TR_EVENT eventPointer -- pointer to event data structure * +// CLOCK timeStamp -- time event is recorded * +// HDFsetInfo dataPointer -- information about HDF data set accessed * +// unsigned dataLength -- dummy for compatability * +// RETURNS * +// pointer to trace record for this event * +//======================================================================*/ +TR_RECORD * +HDFprocEventRecord( int recordType, TR_EVENT *eventPointer, CLOCK timeStamp, + HDFsetInfo *dataPointer, unsigned dataLength ) +{ + static TR_RECORD traceRecord; + static void *recordBuffer = NULL; + static int bufferLength = 0; + struct procEntryTraceRecordData *entryTraceRecordHeader; + struct procExitTraceRecordData *exitTraceRecordHeader; + struct HDFprocNameRecordData *nameRecord; + int procIndex; + int recordFamily; + char *namePtr; + int NameLen; + int NameRecLen; + +#ifdef DEBUG + fprintf( debugFile, "HDFprocEventRecord\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + + /*==============================================================* + // Find the index in the tables for the procedure corresponding * + // to this eventID. * + //==============================================================*/ + procIndex = findHDFProcEvent( eventPointer->eventID ); + if ( procIndex < 0 ) { + return nullRecordFunction( recordType, eventPointer, + timeStamp, (char *)dataPointer, dataLength ); + } + /*==============================================================* + // Produce a packet for the name of the procedure if one has * + // not already been produced. * + //==============================================================*/ + if ( procEntryCalled[procIndex] == 0 ) { + NameLen = strlen( HDFProcNames[procIndex] ); + NameRecLen = HDFprocNameRecLen + NameLen; + nameRecord = ( struct HDFprocNameRecordData *)malloc( NameRecLen ); + nameRecord->packetLength = NameRecLen; + nameRecord->packetType = PKT_DATA; + nameRecord->packetTag = FAMILY_HDFPROCNAME | RECORD_TRACE; + nameRecord->eventID = ID_HDFprocName; + nameRecord->HDFeventID = abs(eventPointer->eventID); + nameRecord->procIndex = procIndex; + nameRecord->numProcs = NumHDFProcs; + nameRecord->NameLen = NameLen; + /*===========================================================* + // copy procedure name into the packet, write out the packet * + // and set ProcEntryCalled[procIndex] to indicate the name * + // packet was produced. * + //===========================================================*/ + memcpy( &(nameRecord->Name), HDFProcNames[procIndex], NameLen ); + putBytes( (char *)nameRecord , NameRecLen ); + free( nameRecord ); + procEntryCalled[procIndex] = 1; + } + /*==============================================================* + // Determine whether this is a procedure entry or a procedure * + // exit family event by lookup in the procedure event ID * + // matching. * + //==============================================================*/ + if ( procEvents[ procIndex ].entryID == eventPointer->eventID ) { + recordFamily = FAMILY_PROCENTRY; + } else { + recordFamily = FAMILY_PROCEXIT; + } + /*==============================================================* + // The time stamp stored in the event descriptor will be used * + // unless one is specified in the timeStamp parameter. * + //==============================================================*/ + if ( clockCompare( timeStamp, noSuchClock ) == 0 ) { + timeStamp = eventPointer->eventLast; + } + /*==============================================================* + // Determine how many bytes of storage will be needed for the * + // contents of the trace record. * + //==============================================================*/ + switch (( recordFamily | recordType )) { + + case FAMILY_PROCENTRY | RECORD_TRACE: + traceRecord.recordLength = sizeof *entryTraceRecordHeader; + break; + + case FAMILY_PROCEXIT | RECORD_TRACE: + traceRecord.recordLength = sizeof *exitTraceRecordHeader; + break; + } + if ( dataPointer != NULL && dataPointer->setName != NULL ) { + traceRecord.recordLength += strlen( dataPointer->setName ); + } + /*==============================================================* + // If there is a previously-allocated buffer and its size will * + // hold this record, re-use the buffer. Otherwise, deallocate * + // the buffer (if allocated) and allocate a bigger one. * + //==============================================================*/ + if ( bufferLength < traceRecord.recordLength ) { + + if ( recordBuffer != NULL ) { + TRfreeBuffer( recordBuffer ); + } + + recordBuffer = (char *)TRgetBuffer( traceRecord.recordLength ); + + if ( recordBuffer == NULL ) { + TRfailure( "cannot allocate storage for trace record" ); + } + bufferLength = traceRecord.recordLength; + } + + traceRecord.recordContents = recordBuffer; + /*==============================================================* + // Load the trace record fields into the allocated buffer * + //==============================================================*/ + switch (( recordFamily | recordType )) { + + case FAMILY_PROCENTRY | RECORD_TRACE: + entryTraceRecordHeader = (struct procEntryTraceRecordData *) + recordBuffer; + entryTraceRecordHeader->packetLength = + traceRecord.recordLength; + entryTraceRecordHeader->packetType = PKT_DATA; + entryTraceRecordHeader->packetTag = recordFamily | recordType; + entryTraceRecordHeader->seconds = clockToSeconds( timeStamp ); + entryTraceRecordHeader->eventID = eventPointer->eventID; + entryTraceRecordHeader->nodeNumber = TRgetNode(); + entryTraceRecordHeader->sourceByte = procByteOffset; + entryTraceRecordHeader->sourceLine = procLineNumber; + break; + + case FAMILY_PROCEXIT | RECORD_TRACE: + exitTraceRecordHeader = (struct procExitTraceRecordData *) + recordBuffer; + exitTraceRecordHeader->packetLength = + traceRecord.recordLength; + exitTraceRecordHeader->packetType = PKT_DATA; + exitTraceRecordHeader->packetTag = recordFamily | recordType; + exitTraceRecordHeader->seconds = clockToSeconds( timeStamp ); + exitTraceRecordHeader->eventID = eventPointer->eventID; + exitTraceRecordHeader->nodeNumber = TRgetNode(); + + if ( dataPointer != 0 ) { + exitTraceRecordHeader->setID = dataPointer->setID; + if (dataPointer->setName != NULL ) { + exitTraceRecordHeader->nameLen + = (int)strlen( dataPointer->setName ); + /*================================================* + // copy name directly into the end of the buffer. * + //================================================*/ + namePtr = (char *)exitTraceRecordHeader + + procExitTraceLen; + memcpy( namePtr, dataPointer->setName, + exitTraceRecordHeader->nameLen ); + } else { + exitTraceRecordHeader->nameLen = 0; + } + } else { + exitTraceRecordHeader->setID = NoDSid; + exitTraceRecordHeader->nameLen = 0; + } + break; + } + +#ifdef DEBUG + fprintf( debugFile, "HDFprocEventRecord done\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + returnRecord(&traceRecord); +} +/*======================================================================* +// Internal Routine: miscEventRecord * +// Called for misc start and end events. * +//======================================================================*/ +TR_RECORD *miscEventRecord( int recordType, + TR_EVENT *eventPointer, + CLOCK timeStamp, + void *dataPointer, + unsigned dataLength ) +{ + static TR_RECORD traceRecord; + static struct miscTraceRecordData miscRecord; + static int initialized = FALSE; + int eventID; + + if ( clockCompare( timeStamp, noSuchClock ) == 0 ) { + timeStamp = eventPointer->eventLast; + } + + eventID = eventPointer->eventID; + if ( ! initialized ) { + miscRecord.packetLength = sizeof( miscRecord ); + miscRecord.packetType = PKT_DATA; + miscRecord.packetTag = FAMILY_MISC | RECORD_TRACE; + miscRecord.nodeNumber = traceProcessorNumber; + + traceRecord.recordLength = miscRecord.packetLength; + traceRecord.recordContents = (char *) &miscRecord; + initialized = TRUE; + } + + switch ( eventID ) { + case ID_malloc: + case ID_free: + miscRecord.seconds = clockToSeconds( timeStamp ) ; + miscRecord.bytes = *(size_t *)dataPointer; + miscRecord.eventID = eventID ; + break; + case -ID_malloc: + case -ID_free: + miscRecord.duration = clockToSeconds( timeStamp) + - miscRecord.seconds; + return &traceRecord; /* generate trace record */ + break; + case ID_timeStamp: + case -ID_timeStamp: + miscRecord.seconds = clockToSeconds( timeStamp ) ; + miscRecord.bytes = 0; + miscRecord.eventID = eventID ; + miscRecord.duration = 0; + return &traceRecord; + break; + default: + fprintf( stderr, "miscEventRecord: unknown eventID %d\n", eventID ); + break; + } + /*==================================================================* + // If we get here then no trace record generated. Normally we * + // should get here if this is an entry call. * + //==================================================================*/ + return( nullRecordFunction( recordType, eventPointer, timeStamp, + dataPointer, dataLength ) ); +} +/*======================================================================* +// NAME * +// findHDFProcEvent: * +// Search the procedure entry/exit event ID matching data * +// structure for an event ID (either entry or exit) which is * +// the same as the argument eventID. If found, return the * +// index from that table, which will be between 0 and * +// numberProcedures - 1, inclusive. If not found, return -1; * +// USAGE * +// index = findHDFProcEvent * +// RETURNS * +// index of the procedure corresponding to this ID * +//======================================================================*/ +int findHDFProcEvent( int eventID ) +{ + int procIndex; + +#ifdef DEBUG + fprintf( debugFile, "findHDFProcEvent\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + if ( isBeginHDFEvent(eventID) ) { + procIndex = eventID - BEGIN_HDF; + } else if ( isEndHDFEvent( eventID ) ) { + procIndex = -eventID - BEGIN_HDF; + } else { + procIndex = -1 ; + } + return procIndex; +} +/*======================================================================* +// NAME * +// _hdfTraceEntryDescriptor * +// Generate a SDDF binary format record descriptor for the * +// full trace class of events in the HDF procedure entry * +// USAGE * +// _hdfTraceEntryDescriptro() * +// RETURNS * +// void * +//======================================================================*/ +void _hdfTraceEntryDescriptor( void ) +{ + static char recordBuffer[ 4096 ]; + int recordLength; + +#ifdef DEBUG + fprintf( debugFile, "_hdfTraceEntryDescriptor entered\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + hdfRecordPointer = recordBuffer; + /*==================================================================* + // Allow space at the beginning of the record for the packet * + //length which will be computed after the packet is complete. * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 0 ); + /*==================================================================* + // The record type, tag, and name * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, PKT_DESCRIPTOR ); + sddfWriteInteger( &hdfRecordPointer, ( FAMILY_PROCENTRY | RECORD_TRACE ) ); + sddfWriteString( &hdfRecordPointer, "HDF Procedure Entry Trace" ); + /*==================================================================* + // The record attribute count and string pair * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 1 ); + sddfWriteString( &hdfRecordPointer, "description" ); + sddfWriteString( &hdfRecordPointer, "HDF Procedure Entry Trace Record" ); + /*==================================================================* + // The record field count * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 5); + /*==================================================================* + // Create fields * + //==================================================================*/ + WRITE_HDF_FIELD( "Event Identifier", + "Event ID", + "Event Identifier Number", + INTEGER, 0 ); + WRITE_HDF_FIELD( "Seconds", + "Seconds", + "Floating Point Timestamp", + DOUBLE, 0 ); + WRITE_HDF_FIELD( "Source Byte", + "Byte", + "Source Byte Offset", + LONG, 0 ); + WRITE_HDF_FIELD( "Source Line", + "Line", + "Source Line Number", + INTEGER, 0 ); + WRITE_HDF_FIELD( "Processor Number", + "Node", + "Processor number", + INTEGER, 0 ); + + recordLength = (int)(hdfRecordPointer - recordBuffer); + + hdfRecordPointer = recordBuffer; + sddfWriteInteger( &hdfRecordPointer, recordLength ); + + putBytes( recordBuffer, (unsigned) recordLength ); +} +/*======================================================================* +// NAME * +// _hdfTraceExitDescriptor * +// Generate a SDDF binary format record descriptor for the * +// full trace class of events in the HDF procedure exit * +// USAGE * +// _hdfTraceExitDescriptor() * +// RETURNS * +// void * +//======================================================================*/ +void _hdfTraceExitDescriptor( void ) +{ + static char recordBuffer[ 4096 ]; + int recordLength; + +#ifdef DEBUG + fprintf( debugFile, "_hdfExitTraceDescriptor entered\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + hdfRecordPointer = recordBuffer; + /*==================================================================* + // Allow space at the beginning of the record for the packet * + // length which will be computed after the packet is complete. * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 0 ); + /*==================================================================* + // The record type, tag, and name * + /===================================================================*/ + sddfWriteInteger( &hdfRecordPointer, PKT_DESCRIPTOR ); + sddfWriteInteger( &hdfRecordPointer, ( FAMILY_PROCEXIT | RECORD_TRACE ) ); + sddfWriteString( &hdfRecordPointer, "HDF Procedure Exit Trace" ); + /*==================================================================* + // The record attribute count and string pair * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 1 ); + sddfWriteString( &hdfRecordPointer, "description" ); + sddfWriteString( &hdfRecordPointer, "HDF Procedure Exit Trace Record" ); + /*==================================================================* + // The record field count * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 5); + /*==================================================================* + // Create fields * + //==================================================================*/ + WRITE_HDF_FIELD( "Event Identifier", + "Event ID", + "Event Identifier Number", + INTEGER, 0 ); + WRITE_HDF_FIELD( "Seconds", + "Seconds", + "Floating Point Timestamp", + DOUBLE, 0 ); + WRITE_HDF_FIELD2( "HDF ID", + "HDF ID", "File, Data Set or Dim Identifier number", + "0", "No HDF ID specified", + LONG, 0 ); + WRITE_HDF_FIELD( "Processor Number", + "Node", + "Processor number", + INTEGER, 0 ); + WRITE_HDF_FIELD( "HDF Name", + "HDF Name", "Name of File, Data Set or Dim", + CHARACTER, 1 ); + + recordLength = (int)(hdfRecordPointer - recordBuffer); + + hdfRecordPointer = recordBuffer; + sddfWriteInteger( &hdfRecordPointer, recordLength ); + + putBytes( recordBuffer, (unsigned) recordLength ); +} + +/*======================================================================* +// NAME * +// _hdfMiscDescriptor * +// Generate a SDDF binary format record descriptor for the * +// misc procedure * +// USAGE * +// _hdfMiscDescriptor() * +// RETURNS * +// void * +//======================================================================*/ +void _hdfMiscDescriptor( void ) +{ + static char recordBuffer[ 4096 ]; + int recordLength; + +#ifdef DEBUG + fprintf( debugFile, "_hdfMiscDescriptor entered\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + hdfRecordPointer = recordBuffer; + /*==================================================================* + // Allow space at the beginning of the record for the packet * + //length which will be computed after the packet is complete. * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 0 ); + /*==================================================================* + // The record type, tag, and name * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, PKT_DESCRIPTOR ); + sddfWriteInteger( &hdfRecordPointer, ( FAMILY_MISC | RECORD_TRACE ) ); + sddfWriteString( &hdfRecordPointer, "Misc Trace" ); + /*==================================================================* + // The record attribute count and string pair * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 1 ); + sddfWriteString( &hdfRecordPointer, "description" ); + sddfWriteString( &hdfRecordPointer, "Misc Trace Record" ); + /*==================================================================* + // The record field count * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 5); + /*==================================================================* + // Create fields * + //==================================================================*/ + WRITE_HDF_FIELD( "Event Identifier", + "Event ID", + "Event Identifier Number", + INTEGER, 0 ); + WRITE_HDF_FIELD( "Seconds", + "Seconds", + "Floating Point Timestamp", + DOUBLE, 0 ); + WRITE_HDF_FIELD( "Duration", + "Duration", + "Operation Duration", + DOUBLE, 0 ); + WRITE_HDF_FIELD( "Bytes", + "Bytes", + "Bytes Requested", + LONG, 0 ); + WRITE_HDF_FIELD( "Processor Number", + "Node", + "Processor number", + INTEGER, 0 ); + + recordLength = (int)(hdfRecordPointer - recordBuffer); + + hdfRecordPointer = recordBuffer; + sddfWriteInteger( &hdfRecordPointer, recordLength ); + + putBytes( recordBuffer, (unsigned) recordLength ); +} +/*======================================================================* +// NAME * +// _hdfProcNameDescriptor * +// Generate a SDDF binary format record descriptor for the * +// HDFProcName Records * +// USAGE * +// _hdfProcNameDescriptor() * +// RETURNS * +// void * +//======================================================================*/ +void _hdfProcNameDescriptor( void ) +{ + static char recordBuffer[ 4096 ]; + int recordLength; + +#ifdef DEBUG + fprintf( debugFile, "_hdfProcNameDescriptor entered\n" ); + fflush( debugFile ); +#endif /* DEBUG */ + hdfRecordPointer = recordBuffer; + /*==================================================================* + // Allow space at the beginning of the record for the packet * + //length which will be computed after the packet is complete. * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 0 ); + /*==================================================================* + // The record type, tag, and name * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, PKT_DESCRIPTOR ); + sddfWriteInteger( &hdfRecordPointer, ( FAMILY_HDFPROCNAME| RECORD_TRACE ) ); + sddfWriteString( &hdfRecordPointer, "HDF Procedure Information" ); + /*==================================================================* + // The record attribute count and string pair * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 1 ); + sddfWriteString( &hdfRecordPointer, "description" ); + sddfWriteString( &hdfRecordPointer, "HDF Proc Info Record" ); + /*==================================================================* + // The record field count * + //==================================================================*/ + sddfWriteInteger( &hdfRecordPointer, 5); + /*==================================================================* + // Create fields * + //==================================================================*/ + WRITE_HDF_FIELD( "Event Identifier", + "Event ID", + "Event Identifier Number", + INTEGER, 0 ); + WRITE_HDF_FIELD( "HDF Proc Event Id", + "HDF Proc Event Identifier", + "HDF Proc Event Identifier Number", + INTEGER, 0 ); + WRITE_HDF_FIELD( "HDF Proc Index", + "HDF Proc Index", + "Index of HDF Proc in Tables", + INTEGER, 0 ); + WRITE_HDF_FIELD( "Num HDF Procs", + "Num HDF Procs", + "Number of HDF Procedures", + INTEGER, 0 ); + WRITE_HDF_FIELD( "HDF Proc Name", + "HDF Proc Name", + "Name of HDF Procedure", + CHARACTER, 1 ); + recordLength = (int)(hdfRecordPointer - recordBuffer); + + hdfRecordPointer = recordBuffer; + sddfWriteInteger( &hdfRecordPointer, recordLength ); + + putBytes( recordBuffer, (unsigned) recordLength ); +} +/*#endif */ /* HAVE_PABLO */ |