summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2014-06-17 20:40:01 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2014-06-17 20:40:01 (GMT)
commit611d2c89afa02204e6321849d24aed26878097f0 (patch)
tree806802afc30a3a212d94b47ad661fd3b8c91a0df /src
parent720e0c7623be9847867b9d857329ab626ee8f3e8 (diff)
downloadhdf5-611d2c89afa02204e6321849d24aed26878097f0.zip
hdf5-611d2c89afa02204e6321849d24aed26878097f0.tar.gz
hdf5-611d2c89afa02204e6321849d24aed26878097f0.tar.bz2
[svn-r25307] Bring revisions #24698 - #24783 from trunk to revise_chunks.
Tested on jam, koala, ostrich, platypus.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt284
-rw-r--r--src/H5B2hdr.c6
-rw-r--r--src/H5B2int.c4
-rw-r--r--src/H5Dbtree.c14
-rw-r--r--src/H5Dbtree2.c14
-rw-r--r--src/H5Dchunk.c118
-rw-r--r--src/H5Dcompact.c8
-rw-r--r--src/H5Dcontig.c36
-rw-r--r--src/H5Dearray.c50
-rw-r--r--src/H5Defl.c18
-rw-r--r--src/H5Dfarray.c22
-rw-r--r--src/H5Dfill.c8
-rw-r--r--src/H5Dint.c8
-rw-r--r--src/H5Dio.c31
-rw-r--r--src/H5Dmpio.c131
-rw-r--r--src/H5Dnone.c8
-rw-r--r--src/H5Dpkg.h16
-rw-r--r--src/H5Dprivate.h3
-rw-r--r--src/H5Dproxy.c2
-rw-r--r--src/H5EA.c8
-rw-r--r--src/H5EAcache.c2
-rw-r--r--src/H5EAdblkpage.c2
-rw-r--r--src/H5EAdblock.c4
-rw-r--r--src/H5EAhdr.c8
-rw-r--r--src/H5EAiblock.c6
-rw-r--r--src/H5EApkg.h2
-rw-r--r--src/H5EAsblock.c4
-rw-r--r--src/H5EAtest.c4
-rw-r--r--src/H5FA.c22
-rw-r--r--src/H5FAcache.c12
-rw-r--r--src/H5FAdbg.c20
-rw-r--r--src/H5FAtest.c12
-rw-r--r--src/H5FScache.c18
-rw-r--r--src/H5FSsection.c24
-rw-r--r--src/H5Faccum.c12
-rw-r--r--src/H5Fprivate.h4
-rw-r--r--src/H5HFcache.c2
-rw-r--r--src/H5HFdbg.c8
-rw-r--r--src/H5HFdblock.c6
-rw-r--r--src/H5HFdtable.c14
-rw-r--r--src/H5HFhdr.c8
-rw-r--r--src/H5HFiblock.c12
-rw-r--r--src/H5HFiter.c4
-rw-r--r--src/H5HFman.c8
-rw-r--r--src/H5HFpkg.h2
-rw-r--r--src/H5HFsection.c2
-rw-r--r--src/H5HGdbg.c74
-rw-r--r--src/H5HLdbg.c66
-rw-r--r--src/H5Lexternal.c12
-rw-r--r--src/H5MF.c4
-rw-r--r--src/H5Oattr.c20
-rw-r--r--src/H5Odtype.c8
-rw-r--r--src/H5Oefl.c11
-rw-r--r--src/H5Pdcpl.c24
-rw-r--r--src/H5Pdxpl.c13
-rw-r--r--src/H5Pencdec.c4
-rw-r--r--src/H5Pfapl.c20
-rw-r--r--src/H5Plapl.c2
-rw-r--r--src/H5Pocpl.c8
-rw-r--r--src/H5Sall.c4
-rw-r--r--src/H5Shyper.c10
-rw-r--r--src/H5Smpio.c447
-rw-r--r--src/H5Snone.c2
-rw-r--r--src/H5Spoint.c6
-rw-r--r--src/H5Sprivate.h13
-rw-r--r--src/H5Sselect.c61
-rw-r--r--src/H5VM.c (renamed from src/H5V.c)220
-rw-r--r--src/H5VMprivate.h (renamed from src/H5Vprivate.h)140
-rw-r--r--src/H5Z.c38
-rw-r--r--src/H5Ztrans.c4
-rw-r--r--src/H5detect.c2
-rw-r--r--src/H5private.h4
-rw-r--r--src/H5public.h4
-rw-r--r--src/H5system.c24
-rw-r--r--src/Makefile.am4
-rw-r--r--src/Makefile.in10
-rw-r--r--src/hdf5.lnt8
77 files changed, 1391 insertions, 887 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3ec7d7c..5f332a1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,12 +4,12 @@ PROJECT (HDF5_SRC C CXX)
#-----------------------------------------------------------------------------
# Apply Definitions to compiler in this directory and below
#-----------------------------------------------------------------------------
-ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS})
+add_definitions (${HDF5_EXTRA_C_FLAGS})
#-----------------------------------------------------------------------------
# List Source Files
#-----------------------------------------------------------------------------
-SET (H5_SRCS
+set (H5_SRCS
${HDF5_SRC_DIR}/H5.c
${HDF5_SRC_DIR}/H5checksum.c
${HDF5_SRC_DIR}/H5dbg.c
@@ -18,7 +18,7 @@ SET (H5_SRCS
${HDF5_SRC_DIR}/H5trace.c
)
-SET (H5_HDRS
+set (H5_HDRS
${HDF5_SRC_DIR}/hdf5.h
${HDF5_SRC_DIR}/H5api_adpt.h
${HDF5_SRC_DIR}/H5public.h
@@ -27,7 +27,7 @@ SET (H5_HDRS
)
IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" )
-SET (H5A_SRCS
+set (H5A_SRCS
${HDF5_SRC_DIR}/H5A.c
${HDF5_SRC_DIR}/H5Abtree2.c
${HDF5_SRC_DIR}/H5Adense.c
@@ -36,35 +36,35 @@ SET (H5A_SRCS
${HDF5_SRC_DIR}/H5Atest.c
)
-SET (H5A_HDRS
+set (H5A_HDRS
${HDF5_SRC_DIR}/H5Apkg.h
${HDF5_SRC_DIR}/H5Apublic.h
)
IDE_GENERATED_PROPERTIES ("H5A" "${H5A_HDRS}" "${H5A_SRCS}" )
-SET (H5AC_SRCS
+set (H5AC_SRCS
${HDF5_SRC_DIR}/H5AC.c
)
-SET (H5AC_HDRS
+set (H5AC_HDRS
${HDF5_SRC_DIR}/H5ACpkg.h
${HDF5_SRC_DIR}/H5ACpublic.h
)
IDE_GENERATED_PROPERTIES ("H5AC" "${H5AC_HDRS}" "${H5AC_SRCS}" )
-SET (H5B_SRCS
+set (H5B_SRCS
${HDF5_SRC_DIR}/H5B.c
${HDF5_SRC_DIR}/H5Bcache.c
${HDF5_SRC_DIR}/H5Bdbg.c
)
-SET (H5B_HDRS
+set (H5B_HDRS
${HDF5_SRC_DIR}/H5Bpkg.h
${HDF5_SRC_DIR}/H5Bpublic.h
)
IDE_GENERATED_PROPERTIES ("H5B" "${H5B_HDRS}" "${H5B_SRCS}" )
-SET (H5B2_SRCS
+set (H5B2_SRCS
${HDF5_SRC_DIR}/H5B2.c
${HDF5_SRC_DIR}/H5B2cache.c
${HDF5_SRC_DIR}/H5B2dbg.c
@@ -73,32 +73,32 @@ SET (H5B2_SRCS
${HDF5_SRC_DIR}/H5B2stat.c
${HDF5_SRC_DIR}/H5B2test.c
)
-SET (H5B2_HDRS
+set (H5B2_HDRS
${HDF5_SRC_DIR}/H5B2pkg.h
${HDF5_SRC_DIR}/H5B2public.h
)
IDE_GENERATED_PROPERTIES ("H5B2" "${H5B2_HDRS}" "${H5B2_SRCS}" )
-SET (H5C_SRCS
+set (H5C_SRCS
${HDF5_SRC_DIR}/H5C.c
)
-SET (H5C_HDRS
+set (H5C_HDRS
${HDF5_SRC_DIR}/H5Cpkg.h
${HDF5_SRC_DIR}/H5Cpublic.h
)
IDE_GENERATED_PROPERTIES ("H5C" "${H5C_HDRS}" "${H5C_SRCS}" )
-SET (H5CS_SRCS
+set (H5CS_SRCS
${HDF5_SRC_DIR}/H5CS.c
)
-SET (H5CS_HDRS
+set (H5CS_HDRS
)
IDE_GENERATED_PROPERTIES ("H5CS" "${H5CS_HDRS}" "${H5CS_SRCS}" )
-SET (H5D_SRCS
+set (H5D_SRCS
${HDF5_SRC_DIR}/H5D.c
${HDF5_SRC_DIR}/H5Dbtree2.c
${HDF5_SRC_DIR}/H5Dbtree.c
@@ -123,19 +123,19 @@ SET (H5D_SRCS
${HDF5_SRC_DIR}/H5Dtest.c
)
-SET (H5D_HDRS
+set (H5D_HDRS
${HDF5_SRC_DIR}/H5Dpkg.h
${HDF5_SRC_DIR}/H5Dpublic.h
)
IDE_GENERATED_PROPERTIES ("H5D" "${H5D_HDRS}" "${H5D_SRCS}" )
-SET (H5E_SRCS
+set (H5E_SRCS
${HDF5_SRC_DIR}/H5E.c
${HDF5_SRC_DIR}/H5Edeprec.c
${HDF5_SRC_DIR}/H5Eint.c
)
-SET (H5E_HDRS
+set (H5E_HDRS
${HDF5_SRC_DIR}/H5Edefin.h
${HDF5_SRC_DIR}/H5Einit.h
${HDF5_SRC_DIR}/H5Epkg.h
@@ -146,7 +146,7 @@ SET (H5E_HDRS
IDE_GENERATED_PROPERTIES ("H5E" "${H5E_HDRS}" "${H5E_SRCS}" )
-SET (H5EA_SRCS
+set (H5EA_SRCS
${HDF5_SRC_DIR}/H5EA.c
${HDF5_SRC_DIR}/H5EAcache.c
${HDF5_SRC_DIR}/H5EAdbg.c
@@ -159,13 +159,13 @@ SET (H5EA_SRCS
${HDF5_SRC_DIR}/H5EAstat.c
${HDF5_SRC_DIR}/H5EAtest.c
)
-SET (H5EA_HDRS
+set (H5EA_HDRS
${HDF5_SRC_DIR}/H5EApkg.h
)
IDE_GENERATED_PROPERTIES ("H5EA" "${H5EA_HDRS}" "${H5EA_SRCS}" )
-SET (H5F_SRCS
+set (H5F_SRCS
${HDF5_SRC_DIR}/H5F.c
${HDF5_SRC_DIR}/H5Faccum.c
${HDF5_SRC_DIR}/H5Fcwfs.c
@@ -183,14 +183,14 @@ SET (H5F_SRCS
${HDF5_SRC_DIR}/H5Ftest.c
)
-SET (H5F_HDRS
+set (H5F_HDRS
${HDF5_SRC_DIR}/H5Fpkg.h
${HDF5_SRC_DIR}/H5Fpublic.h
)
IDE_GENERATED_PROPERTIES ("H5F" "${H5F_HDRS}" "${H5F_SRCS}" )
-SET (H5FA_SRCS
+set (H5FA_SRCS
${HDF5_SRC_DIR}/H5FA.c
${HDF5_SRC_DIR}/H5FAcache.c
${HDF5_SRC_DIR}/H5FAdbg.c
@@ -201,13 +201,13 @@ SET (H5FA_SRCS
${HDF5_SRC_DIR}/H5FAstat.c
${HDF5_SRC_DIR}/H5FAtest.c
)
-SET (H5FA_HDRS
+set (H5FA_HDRS
${HDF5_SRC_DIR}/H5FApkg.h
)
IDE_GENERATED_PROPERTIES ("H5FA" "${H5FA_HDRS}" "${H5FA_SRCS}" )
-SET (H5FD_SRCS
+set (H5FD_SRCS
${HDF5_SRC_DIR}/H5FD.c
${HDF5_SRC_DIR}/H5FDcore.c
${HDF5_SRC_DIR}/H5FDdirect.c
@@ -224,7 +224,7 @@ SET (H5FD_SRCS
${HDF5_SRC_DIR}/H5FDwindows.c
)
-SET (H5FD_HDRS
+set (H5FD_HDRS
${HDF5_SRC_DIR}/H5FDcore.h
${HDF5_SRC_DIR}/H5FDdirect.h
${HDF5_SRC_DIR}/H5FDfamily.h
@@ -242,23 +242,23 @@ SET (H5FD_HDRS
IDE_GENERATED_PROPERTIES ("H5FD" "${H5FD_HDRS}" "${H5FD_SRCS}" )
-SET (H5FL_SRCS
+set (H5FL_SRCS
${HDF5_SRC_DIR}/H5FL.c
)
-SET (H5FL_HDRS
+set (H5FL_HDRS
)
IDE_GENERATED_PROPERTIES ("H5FL" "${H5FL_HDRS}" "${H5FL_SRCS}" )
-SET (H5FO_SRCS
+set (H5FO_SRCS
${HDF5_SRC_DIR}/H5FO.c
)
-SET (H5FO_HDRS
+set (H5FO_HDRS
)
IDE_GENERATED_PROPERTIES ("H5FO" "${H5FO_HDRS}" "${H5FO_SRCS}" )
-SET (H5FS_SRCS
+set (H5FS_SRCS
${HDF5_SRC_DIR}/H5FS.c
${HDF5_SRC_DIR}/H5FScache.c
${HDF5_SRC_DIR}/H5FSdbg.c
@@ -268,13 +268,13 @@ SET (H5FS_SRCS
${HDF5_SRC_DIR}/H5FStest.c
)
-SET (H5FS_HDRS
+set (H5FS_HDRS
${HDF5_SRC_DIR}/H5FSpkg.h
${HDF5_SRC_DIR}/H5FSpublic.h
)
IDE_GENERATED_PROPERTIES ("H5FS" "${H5FS_HDRS}" "${H5FS_SRCS}" )
-SET (H5G_SRCS
+set (H5G_SRCS
${HDF5_SRC_DIR}/H5G.c
${HDF5_SRC_DIR}/H5Gbtree2.c
${HDF5_SRC_DIR}/H5Gcache.c
@@ -295,13 +295,13 @@ SET (H5G_SRCS
${HDF5_SRC_DIR}/H5Gtraverse.c
)
-SET (H5G_HDRS
+set (H5G_HDRS
${HDF5_SRC_DIR}/H5Gpkg.h
${HDF5_SRC_DIR}/H5Gpublic.h
)
IDE_GENERATED_PROPERTIES ("H5G" "${H5G_HDRS}" "${H5G_SRCS}" )
-SET (H5HF_SRCS
+set (H5HF_SRCS
${HDF5_SRC_DIR}/H5HF.c
${HDF5_SRC_DIR}/H5HFbtree2.c
${HDF5_SRC_DIR}/H5HFcache.c
@@ -321,26 +321,26 @@ SET (H5HF_SRCS
${HDF5_SRC_DIR}/H5HFtiny.c
)
-SET (H5HF_HDRS
+set (H5HF_HDRS
${HDF5_SRC_DIR}/H5HFpkg.h
${HDF5_SRC_DIR}/H5HFpublic.h
)
IDE_GENERATED_PROPERTIES ("H5HF" "${H5HF_HDRS}" "${H5HF_SRCS}" )
-SET (H5HG_SRCS
+set (H5HG_SRCS
${HDF5_SRC_DIR}/H5HG.c
${HDF5_SRC_DIR}/H5HGcache.c
${HDF5_SRC_DIR}/H5HGdbg.c
${HDF5_SRC_DIR}/H5HGquery.c
)
-SET (H5HG_HDRS
+set (H5HG_HDRS
${HDF5_SRC_DIR}/H5HGpkg.h
${HDF5_SRC_DIR}/H5HGpublic.h
)
IDE_GENERATED_PROPERTIES ("H5HG" "${H5HG_HDRS}" "${H5HG_SRCS}" )
-SET (H5HL_SRCS
+set (H5HL_SRCS
${HDF5_SRC_DIR}/H5HL.c
${HDF5_SRC_DIR}/H5HLcache.c
${HDF5_SRC_DIR}/H5HLdbg.c
@@ -349,75 +349,75 @@ SET (H5HL_SRCS
${HDF5_SRC_DIR}/H5HLprfx.c
)
-SET (H5HL_HDRS
+set (H5HL_HDRS
${HDF5_SRC_DIR}/H5HLpkg.h
${HDF5_SRC_DIR}/H5HLpublic.h
)
IDE_GENERATED_PROPERTIES ("H5HL" "${H5HL_HDRS}" "${H5HL_SRCS}" )
-SET (H5HP_SRCS
+set (H5HP_SRCS
${HDF5_SRC_DIR}/H5HP.c
)
-SET (H5HP_HDRS
+set (H5HP_HDRS
)
IDE_GENERATED_PROPERTIES ("H5HP" "${H5HP_HDRS}" "${H5HP_SRCS}" )
-SET (H5I_SRCS
+set (H5I_SRCS
${HDF5_SRC_DIR}/H5I.c
${HDF5_SRC_DIR}/H5Itest.c
)
-SET (H5I_HDRS
+set (H5I_HDRS
${HDF5_SRC_DIR}/H5Ipkg.h
${HDF5_SRC_DIR}/H5Ipublic.h
)
IDE_GENERATED_PROPERTIES ("H5I" "${H5I_HDRS}" "${H5I_SRCS}" )
-SET (H5L_SRCS
+set (H5L_SRCS
${HDF5_SRC_DIR}/H5L.c
${HDF5_SRC_DIR}/H5Lexternal.c
)
-SET (H5L_HDRS
+set (H5L_HDRS
${HDF5_SRC_DIR}/H5Lpkg.h
${HDF5_SRC_DIR}/H5Lpublic.h
)
IDE_GENERATED_PROPERTIES ("H5L" "${H5L_HDRS}" "${H5L_SRCS}" )
-SET (H5MF_SRCS
+set (H5MF_SRCS
${HDF5_SRC_DIR}/H5MF.c
${HDF5_SRC_DIR}/H5MFaggr.c
${HDF5_SRC_DIR}/H5MFdbg.c
${HDF5_SRC_DIR}/H5MFsection.c
)
-SET (H5MF_HDRS
+set (H5MF_HDRS
)
IDE_GENERATED_PROPERTIES ("H5MF" "${H5MF_HDRS}" "${H5MF_SRCS}" )
-SET (H5MM_SRCS
+set (H5MM_SRCS
${HDF5_SRC_DIR}/H5MM.c
)
-SET (H5MM_HDRS
+set (H5MM_HDRS
${HDF5_SRC_DIR}/H5MMpublic.h
)
IDE_GENERATED_PROPERTIES ("H5MM" "${H5MM_HDRS}" "${H5MM_SRCS}" )
-SET (H5MP_SRCS
+set (H5MP_SRCS
${HDF5_SRC_DIR}/H5MP.c
${HDF5_SRC_DIR}/H5MPtest.c
)
-SET (H5MP_HDRS
+set (H5MP_HDRS
${HDF5_SRC_DIR}/H5MPpkg.h
)
IDE_GENERATED_PROPERTIES ("H5MP" "${H5MP_HDRS}" "${H5MP_SRCS}" )
-SET (H5O_SRCS
+set (H5O_SRCS
${HDF5_SRC_DIR}/H5O.c
${HDF5_SRC_DIR}/H5Oainfo.c
${HDF5_SRC_DIR}/H5Oalloc.c
@@ -456,14 +456,14 @@ SET (H5O_SRCS
${HDF5_SRC_DIR}/H5Ounknown.c
)
-SET (H5O_HDRS
+set (H5O_HDRS
${HDF5_SRC_DIR}/H5Opkg.h
${HDF5_SRC_DIR}/H5Opublic.h
${HDF5_SRC_DIR}/H5Oshared.h
)
IDE_GENERATED_PROPERTIES ("H5O" "${H5O_HDRS}" "${H5O_SRCS}" )
-SET (H5P_SRCS
+set (H5P_SRCS
${HDF5_SRC_DIR}/H5P.c
${HDF5_SRC_DIR}/H5Pacpl.c
${HDF5_SRC_DIR}/H5Pdapl.c
@@ -484,50 +484,50 @@ SET (H5P_SRCS
${HDF5_SRC_DIR}/H5Ptest.c
)
-SET (H5P_HDRS
+set (H5P_HDRS
${HDF5_SRC_DIR}/H5Ppkg.h
${HDF5_SRC_DIR}/H5Ppublic.h
)
IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" )
-SET (H5PL_SRCS
+set (H5PL_SRCS
${HDF5_SRC_DIR}/H5PL.c
)
-SET (H5PL_HDRS
+set (H5PL_HDRS
${HDF5_SRC_DIR}/H5PLextern.h
)
IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" )
-SET (H5R_SRCS
+set (H5R_SRCS
${HDF5_SRC_DIR}/H5R.c
${HDF5_SRC_DIR}/H5Rdeprec.c
)
-SET (H5R_HDRS
+set (H5R_HDRS
${HDF5_SRC_DIR}/H5Rpkg.h
${HDF5_SRC_DIR}/H5Rpublic.h
)
IDE_GENERATED_PROPERTIES ("H5R" "${H5R_HDRS}" "${H5R_SRCS}" )
-SET (H5UC_SRCS
+set (H5UC_SRCS
${HDF5_SRC_DIR}/H5UC.c
)
-SET (H5UC_HDRS
+set (H5UC_HDRS
)
IDE_GENERATED_PROPERTIES ("H5UC" "${H5UC_HDRS}" "${H5UC_SRCS}" )
-SET (H5RS_SRCS
+set (H5RS_SRCS
${HDF5_SRC_DIR}/H5RS.c
)
-SET (H5RS_HDRS
+set (H5RS_HDRS
)
IDE_GENERATED_PROPERTIES ("H5RS" "${H5RS_HDRS}" "${H5RS_SRCS}" )
-SET (H5S_SRCS
+set (H5S_SRCS
${HDF5_SRC_DIR}/H5S.c
${HDF5_SRC_DIR}/H5Sall.c
${HDF5_SRC_DIR}/H5Sdbg.c
@@ -539,22 +539,22 @@ SET (H5S_SRCS
${HDF5_SRC_DIR}/H5Stest.c
)
-SET (H5S_HDRS
+set (H5S_HDRS
${HDF5_SRC_DIR}/H5Spkg.h
${HDF5_SRC_DIR}/H5Spublic.h
)
IDE_GENERATED_PROPERTIES ("H5S" "${H5S_HDRS}" "${H5S_SRCS}" )
-SET (H5SL_SRCS
+set (H5SL_SRCS
${HDF5_SRC_DIR}/H5SL.c
)
-SET (H5SL_HDRS
+set (H5SL_HDRS
)
IDE_GENERATED_PROPERTIES ("H5SL" "${H5SL_HDRS}" "${H5SL_SRCS}" )
-SET (H5SM_SRCS
+set (H5SM_SRCS
${HDF5_SRC_DIR}/H5SM.c
${HDF5_SRC_DIR}/H5SMbtree2.c
${HDF5_SRC_DIR}/H5SMcache.c
@@ -562,21 +562,21 @@ SET (H5SM_SRCS
${HDF5_SRC_DIR}/H5SMtest.c
)
-SET (H5SM_HDRS
+set (H5SM_HDRS
${HDF5_SRC_DIR}/H5SMpkg.h
)
IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SRCS}" )
-SET (H5ST_SRCS
+set (H5ST_SRCS
${HDF5_SRC_DIR}/H5ST.c
)
-SET (H5ST_HDRS
+set (H5ST_HDRS
)
IDE_GENERATED_PROPERTIES ("H5ST" "${H5ST_HDRS}" "${H5ST_SRCS}" )
-SET (H5T_SRCS
+set (H5T_SRCS
${HDF5_SRC_DIR}/H5T.c
${HDF5_SRC_DIR}/H5Tarray.c
${HDF5_SRC_DIR}/H5Tbit.c
@@ -602,38 +602,38 @@ SET (H5T_SRCS
${HDF5_SRC_DIR}/H5Tvlen.c
)
-SET (H5T_HDRS
+set (H5T_HDRS
${HDF5_SRC_DIR}/H5Tpkg.h
${HDF5_SRC_DIR}/H5Tpublic.h
)
IDE_GENERATED_PROPERTIES ("H5T" "${H5T_HDRS}" "${H5T_SRCS}" )
-SET (H5TS_SRCS
+set (H5TS_SRCS
${HDF5_SRC_DIR}/H5TS.c
)
-SET (H5TS_HDRS
+set (H5TS_HDRS
)
IDE_GENERATED_PROPERTIES ("H5TS" "${H5TS_HDRS}" "${H5TS_SRCS}" )
-SET (H5V_SRCS
- ${HDF5_SRC_DIR}/H5V.c
+set (H5VM_SRCS
+ ${HDF5_SRC_DIR}/H5VM.c
)
-SET (H5V_HDRS
+set (H5VM_HDRS
)
-IDE_GENERATED_PROPERTIES ("H5V" "${H5V_HDRS}" "${H5V_SRCS}" )
+IDE_GENERATED_PROPERTIES ("H5VM" "${H5VM_HDRS}" "${H5VM_SRCS}" )
-SET (H5WB_SRCS
+set (H5WB_SRCS
${HDF5_SRC_DIR}/H5WB.c
)
-SET (H5WB_HDRS
+set (H5WB_HDRS
)
IDE_GENERATED_PROPERTIES ("H5WB" "${H5WB_HDRS}" "${H5WB_SRCS}" )
-SET (H5Z_SRCS
+set (H5Z_SRCS
${HDF5_SRC_DIR}/H5Z.c
${HDF5_SRC_DIR}/H5Zdeflate.c
${HDF5_SRC_DIR}/H5Zfletcher32.c
@@ -643,19 +643,19 @@ SET (H5Z_SRCS
${HDF5_SRC_DIR}/H5Zszip.c
${HDF5_SRC_DIR}/H5Ztrans.c
)
-IF (H5_ZLIB_HEADER)
+if (H5_ZLIB_HEADER)
SET_PROPERTY(SOURCE ${HDF5_SRC_DIR}/H5Zdeflate.c PROPERTY
COMPILE_DEFINITIONS H5_ZLIB_HEADER="${H5_ZLIB_HEADER}")
-ENDIF (H5_ZLIB_HEADER)
+endif (H5_ZLIB_HEADER)
-SET (H5Z_HDRS
+set (H5Z_HDRS
${HDF5_SRC_DIR}/H5Zpkg.h
${HDF5_SRC_DIR}/H5Zpublic.h
)
IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SRCS}" )
-SET (common_SRCS
+set (common_SRCS
${H5_SRCS}
${H5A_SRCS}
${H5AC_SRCS}
@@ -694,12 +694,12 @@ SET (common_SRCS
${H5ST_SRCS}
${H5T_SRCS}
${H5TS_SRCS}
- ${H5V_SRCS}
+ ${H5VM_SRCS}
${H5WB_SRCS}
${H5Z_SRCS}
)
-SET (H5_PUBLIC_HEADERS
+set (H5_PUBLIC_HEADERS
${H5_HDRS}
${H5A_HDRS}
${H5AC_HDRS}
@@ -733,7 +733,7 @@ SET (H5_PUBLIC_HEADERS
)
-SET (H5_PRIVATE_HEADERS
+set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5private.h
${HDF5_SRC_DIR}/H5Aprivate.h
${HDF5_SRC_DIR}/H5ACprivate.h
@@ -773,41 +773,38 @@ SET (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5STprivate.h
${HDF5_SRC_DIR}/H5Tprivate.h
${HDF5_SRC_DIR}/H5TSprivate.h
- ${HDF5_SRC_DIR}/H5Vprivate.h
+ ${HDF5_SRC_DIR}/H5VMprivate.h
${HDF5_SRC_DIR}/H5WBprivate.h
${HDF5_SRC_DIR}/H5Zprivate.h
${HDF5_SRC_DIR}/H5win32defs.h
)
-INCLUDE_DIRECTORIES (${HDF5_SOURCE_DIR})
-INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR})
-
#-----------------------------------------------------------------------------
# Setup the H5Detect utility which generates H5Tinit with platform
# specific type checks inside
#-----------------------------------------------------------------------------
-ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c)
+add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
TARGET_C_PROPERTIES (H5detect " " " ")
-IF (MSVC)
- TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib")
-ENDIF (MSVC)
+if (MSVC)
+ target_link_libraries (H5detect "ws2_32.lib")
+endif (MSVC)
-SET (CMD $<TARGET_FILE:H5detect>)
-ADD_CUSTOM_COMMAND (
+set (CMD $<TARGET_FILE:H5detect>)
+add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c
COMMAND ${CMD}
ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c
DEPENDS H5detect
)
-ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
+add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
TARGET_C_PROPERTIES (H5make_libsettings " " " ")
-IF (MSVC)
- TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib")
-ENDIF (MSVC)
+if (MSVC)
+ target_link_libraries (H5make_libsettings "ws2_32.lib")
+endif (MSVC)
-SET (CMD $<TARGET_FILE:H5make_libsettings>)
-ADD_CUSTOM_COMMAND (
+set (CMD $<TARGET_FILE:H5make_libsettings>)
+add_custom_command (
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
COMMAND ${CMD}
ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c
@@ -815,21 +812,21 @@ ADD_CUSTOM_COMMAND (
WORKING_DIRECTORY ${HDF5_BINARY_DIR}
)
-ADD_CUSTOM_COMMAND (
+add_custom_command (
TARGET ${HDF5_BINARY_DIR}/H5Edefin.h
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SOURCE_DIR}/src/H5err.txt
COMMENT " Creating err headers"
)
-ADD_CUSTOM_COMMAND (
+add_custom_command (
TARGET ${HDF5_BINARY_DIR}/H5version.h
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SOURCE_DIR}/src/H5vers.txt
COMMENT " Creating API version macro"
)
-ADD_CUSTOM_COMMAND (
+add_custom_command (
TARGET ${HDF5_BINARY_DIR}/H5overflow.h
PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SOURCE_DIR}/src/H5overflow.txt
@@ -839,51 +836,64 @@ ADD_CUSTOM_COMMAND (
#-----------------------------------------------------------------------------
# Add H5Tinit source to build - generated by H5Detect/CMake at configure time
#-----------------------------------------------------------------------------
-SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c)
-SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED)
-SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c)
-SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED)
-SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h)
-SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED)
-SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h)
-SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5version.h GENERATED)
-SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h)
-SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED)
-
-ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS})
+set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c)
+set_source_files_properties (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED)
+set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c)
+set_source_files_properties (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED)
+set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h)
+set_source_files_properties (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED)
+set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h)
+set_source_files_properties (${HDF5_BINARY_DIR}/H5version.h GENERATED)
+set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h)
+set_source_files_properties (${HDF5_BINARY_DIR}/H5overflow.h GENERATED)
+
+add_library (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS})
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} " " " ")
-TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS})
-IF (NOT WIN32)
- TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} dl)
-ENDIF (NOT WIN32)
-SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
+target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS})
+if (NOT WIN32)
+ target_link_libraries (${HDF5_LIB_TARGET} dl)
+endif (NOT WIN32)
+set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE})
-SET_TARGET_PROPERTIES (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries)
+set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
+ FOLDER libraries
+ INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+)
+
+option (HDF5_ENABLE_DEBUG_APIS "Turn on debugging in all packages" OFF)
+if (HDF5_ENABLE_DEBUG_APIS)
+ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
+ COMPILE_DEFINITIONS
+ "-DH5Z_DEBUG -DH5VM_DEBUG -DH5T_DEBUG
+ -DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG
+ -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG
+ -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG"
+ )
+endif (HDF5_ENABLE_DEBUG_APIS)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
-IF (NOT HDF5_INSTALL_NO_DEVELOPMENT)
- INSTALL (
+if (NOT HDF5_INSTALL_NO_DEVELOPMENT)
+ install (
FILES
${H5_PUBLIC_HEADERS}
- ${H5_PRIVATE_HEADERS}
DESTINATION
${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT
headers
)
-ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT)
+endif (NOT HDF5_INSTALL_NO_DEVELOPMENT)
#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
#-----------------------------------------------------------------------------
-IF (HDF5_EXPORTED_TARGETS)
- IF (BUILD_SHARED_LIBS)
+if (HDF5_EXPORTED_TARGETS)
+ if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} libraries)
- ENDIF (BUILD_SHARED_LIBS)
+ endif (BUILD_SHARED_LIBS)
- INSTALL (
+ install (
TARGETS
${HDF5_LIB_TARGET}
EXPORT
@@ -892,4 +902,4 @@ IF (HDF5_EXPORTED_TARGETS)
ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT libraries
)
-ENDIF (HDF5_EXPORTED_TARGETS)
+endif (HDF5_EXPORTED_TARGETS)
diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c
index 9f6be80..702854b 100644
--- a/src/H5B2hdr.c
+++ b/src/H5B2hdr.c
@@ -37,7 +37,7 @@
#include "H5B2pkg.h" /* v2 B-trees */
#include "H5Eprivate.h" /* Error handling */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
@@ -182,7 +182,7 @@ HDmemset(hdr->page, 0, hdr->node_size);
/* Compute size to store # of records in each node */
/* (uses leaf # of records because its the largest) */
- u_max_nrec_size = H5V_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec);
+ u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec);
H5_ASSIGN_OVERFLOW(/* To: */ hdr->max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t)
HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE);
@@ -198,7 +198,7 @@ HDmemset(hdr->page, 0, hdr->node_size);
hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) *
hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec;
- u_max_nrec_size = H5V_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec);
+ u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec);
H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t)
if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec)))
diff --git a/src/H5B2int.c b/src/H5B2int.c
index 17fbe5e..b1697db 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -37,7 +37,7 @@
#include "H5B2pkg.h" /* v2 B-trees */
#include "H5Eprivate.h" /* Error handling */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
@@ -494,7 +494,7 @@ H5B2_split_root(H5B2_hdr_t *hdr, hid_t dxpl_id, void *udata)
hdr->node_info[hdr->depth].merge_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->merge_percent) / 100;
hdr->node_info[hdr->depth].cum_max_nrec = ((hdr->node_info[hdr->depth].max_nrec + 1) *
hdr->node_info[hdr->depth - 1].cum_max_nrec) + hdr->node_info[hdr->depth].max_nrec;
- u_max_nrec_size = H5V_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec);
+ u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec);
H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[hdr->depth].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t)
if(NULL == (hdr->node_info[hdr->depth].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[hdr->depth].max_nrec)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory")
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index 89e6fba..6035fe5 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -43,7 +43,7 @@
#include "H5MFprivate.h" /* File space management */
#include "H5Oprivate.h" /* Object headers */
#include "H5Sprivate.h" /* Dataspaces */
-#include "H5Vprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
/****************/
/* Local Macros */
@@ -358,7 +358,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key)
HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS);
/* Compare the offsets but ignore the other fields */
- ret_value = H5V_vector_cmp_u(udata->layout->ndims, lt_key->offset, rt_key->offset);
+ ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->offset, rt_key->offset);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__btree_cmp2() */
@@ -422,9 +422,9 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key)
ret_value = (-1);
} /* end if */
else {
- if(H5V_vector_ge_u(udata->layout->ndims, udata->offset, rt_key->offset))
+ if(H5VM_vector_ge_u(udata->layout->ndims, udata->offset, rt_key->offset))
ret_value = 1;
- else if(H5V_vector_lt_u(udata->layout->ndims, udata->offset, lt_key->offset))
+ else if(H5VM_vector_lt_u(udata->layout->ndims, udata->offset, lt_key->offset))
ret_value = (-1);
} /* end else */
@@ -553,7 +553,7 @@ H5D__btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
/* Negative indices not supported yet */
HGOTO_ERROR(H5E_STORAGE, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error")
- } else if(H5V_vector_eq_u(udata->common.layout->ndims,
+ } else if(H5VM_vector_eq_u(udata->common.layout->ndims,
udata->common.offset, lt_key->offset) &&
lt_key->nbytes > 0) {
/*
@@ -599,10 +599,10 @@ H5D__btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
ret_value = H5B_INS_NOOP;
}
- } else if (H5V_hyper_disjointp(udata->common.layout->ndims,
+ } else if (H5VM_hyper_disjointp(udata->common.layout->ndims,
lt_key->offset, udata->common.layout->dim,
udata->common.offset, udata->common.layout->dim)) {
- HDassert(H5V_hyper_disjointp(udata->common.layout->ndims,
+ HDassert(H5VM_hyper_disjointp(udata->common.layout->ndims,
rt_key->offset, udata->common.layout->dim,
udata->common.offset, udata->common.layout->dim));
/*
diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c
index 674bb2a..2c67b40 100644
--- a/src/H5Dbtree2.c
+++ b/src/H5Dbtree2.c
@@ -35,7 +35,7 @@
#include "H5Dpkg.h" /* Datasets */
#include "H5FLprivate.h" /* Free Lists */
#include "H5MFprivate.h" /* File space management */
-#include "H5Vprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
/****************/
@@ -300,7 +300,7 @@ H5D_bt2_crt_context(void *_udata)
* Compute the size required for encoding the size of a chunk,
* allowing for an extra byte, in case the filter makes the chunk larger.
*/
- ctx->chunk_size_len = 1 + ((H5V_log2_gen((uint64_t)udata->chunk_size) + 8) / 8);
+ ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8);
if(ctx->chunk_size_len > 8)
ctx->chunk_size_len = 8;
@@ -396,7 +396,7 @@ H5D_bt2_compare(const void *_udata, const void *_rec2)
HDassert(rec2);
/* Compare the offsets but ignore the other fields */
- ret_value = H5V_vector_cmp_u(udata->ndims, rec1->offset, rec2->offset);
+ ret_value = H5VM_vector_cmp_u(udata->ndims, rec1->offset, rec2->offset);
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_bt2_compare() */
@@ -642,7 +642,7 @@ H5D_bt2_filt_compare(const void *_udata, const void *_rec2)
HDassert(rec2);
/* Compare the offsets but ignore the other fields */
- ret_value = H5V_vector_cmp_u(udata->ndims, rec1->offset, rec2->offset);
+ ret_value = H5VM_vector_cmp_u(udata->ndims, rec1->offset, rec2->offset);
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_bt2_filt_compare() */
@@ -1078,7 +1078,7 @@ H5D_bt2_idx_create(const H5D_chk_idx_info_t *idx_info)
* Compute the size required for encoding the size of a chunk,
* allowing for an extra byte, in case the filter makes the chunk larger.
*/
- chunk_size_len = 1 + ((H5V_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
+ chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
if(chunk_size_len > 8)
chunk_size_len = 8;
@@ -1237,12 +1237,12 @@ H5D_bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
* Compute the size required for encoding the size of a chunk,
* allowing for an extra byte, in case the filter makes the chunk larger.
*/
- allow_chunk_size_len = 1 + ((H5V_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
+ allow_chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
if(allow_chunk_size_len > 8)
allow_chunk_size_len = 8;
/* Compute encoded size of chunk */
- new_chunk_size_len = (H5V_log2_gen((uint64_t)udata->nbytes) + 8) / 8;
+ new_chunk_size_len = (H5VM_log2_gen((uint64_t)udata->nbytes) + 8) / 8;
if(new_chunk_size_len > 8)
HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "encoded chunk size is more than 8 bytes?!?")
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 0b426cf..b9cc307 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -59,7 +59,7 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Vprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
/****************/
@@ -166,10 +166,18 @@ typedef struct H5D_chunk_it_ud4_t {
/* Callback info for nonexistent readvv operation */
typedef struct H5D_chunk_readvv_ud_t {
unsigned char *rbuf; /* Read buffer to initialize */
- H5D_t *dset; /* Dataset to operate on */
+ const H5D_t *dset; /* Dataset to operate on */
hid_t dxpl_id; /* DXPL for operation */
} H5D_chunk_readvv_ud_t;
+/* Callback info for file selection iteration */
+typedef struct H5D_chunk_file_iter_ud_t {
+ H5D_chunk_map_t *fm; /* File->memory chunk mapping info */
+#ifdef H5_HAVE_PARALLEL
+ const H5D_io_info_t *io_info; /* I/O info for operation */
+#endif /* H5_HAVE_PARALLEL */
+} H5D_chunk_file_iter_ud_t;
+
/********************/
/* Local Prototypes */
@@ -303,7 +311,7 @@ H5FL_BLK_DEFINE_STATIC(chunk);
*/
herr_t
H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsize_t *offset,
- size_t data_size, const void *buf)
+ uint32_t data_size, const void *buf)
{
const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */
H5D_chunk_ud_t udata; /* User data for querying chunk info */
@@ -330,13 +338,12 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get simple dataspace info")
/* Calculate the index of this chunk */
- if(H5V_chunk_index((unsigned)space_ndims, offset,
+ if(H5VM_chunk_index((unsigned)space_ndims, offset,
layout->u.chunk.dim, layout->u.chunk.down_chunks, &chunk_idx) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index")
/* Find out the file address of the chunk */
- if(H5D__chunk_lookup(dset, dxpl_id, offset, chunk_idx,
- &udata) < 0)
+ if(H5D__chunk_lookup(dset, dxpl_id, offset, chunk_idx, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
udata.filter_mask = filters;
@@ -428,9 +435,9 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims,
} /* end for */
/* Get the "down" sizes for each dimension */
- if(H5V_array_down(ndims, layout->chunks, layout->down_chunks) < 0)
+ if(H5VM_array_down(ndims, layout->chunks, layout->down_chunks) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value")
- if(H5V_array_down(ndims, layout->max_chunks, layout->max_down_chunks) < 0)
+ if(H5VM_array_down(ndims, layout->max_chunks, layout->max_down_chunks) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value")
done:
@@ -717,7 +724,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t *fm)
{
- H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */
+ const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */
const H5T_t *mem_type = type_info->mem_type; /* Local pointer to memory datatype */
H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */
hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */
@@ -730,7 +737,6 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
H5S_sel_type fsel_type; /* Selection type on disk */
char bogus; /* "bogus" buffer to pass to selection iterator */
unsigned u; /* Local index variable */
- hbool_t sel_hyper_flag;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -828,6 +834,8 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create chunk selections for single element")
} /* end if */
else {
+ hbool_t sel_hyper_flag; /* Whether file selection is a hyperslab */
+
/* Initialize skip list for chunk selections */
if(NULL == dataset->shared->cache.chunk.sel_chunks) {
if(NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE, NULL)))
@@ -875,12 +883,20 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
} /* end while */
} /* end if */
else {
+ H5D_chunk_file_iter_ud_t udata; /* User data for iteration */
+
/* Create temporary datatypes for selection iteration */
if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL), FALSE)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype")
+ /* Initialize the user data */
+ udata.fm = fm;
+#ifdef H5_HAVE_PARALLEL
+ udata.io_info = io_info;
+#endif /* H5_HAVE_PARALLEL */
+
/* Spaces might not be the same shape, iterate over the file selection directly */
- if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_file_cb, fm) < 0)
+ if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_file_cb, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections")
/* Reset "last chunk" info */
@@ -1166,7 +1182,7 @@ H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t
chunk_info->coords[fm->f_ndims] = 0;
/* Calculate the index of this chunk */
- if(H5V_chunk_index(fm->f_ndims, chunk_info->coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_info->index) < 0)
+ if(H5VM_chunk_index(fm->f_ndims, chunk_info->coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_info->index) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Copy selection for file's dataspace into chunk dataspace */
@@ -1251,7 +1267,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
} /* end for */
/* Calculate the index of this chunk */
- if(H5V_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0)
+ if(H5VM_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Iterate through each chunk in the dataset */
@@ -1294,7 +1310,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
/* Add temporary chunk to the list of chunks */
/* Allocate the file & memory chunk information */
- if (NULL==(new_chunk_info = H5FL_MALLOC (H5D_chunk_info_t))) {
+ if (NULL==(new_chunk_info = H5FL_MALLOC(H5D_chunk_info_t))) {
(void)H5S_close(tmp_fchunk);
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info")
} /* end if */
@@ -1305,7 +1321,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
new_chunk_info->index=chunk_index;
#ifdef H5_HAVE_PARALLEL
- /* store chunk selection information */
+ /* Store chunk selection information, for multi-chunk I/O */
if(io_info->using_mpi_vfd)
fm->select_chunk[chunk_index] = new_chunk_info;
#endif /* H5_HAVE_PARALLEL */
@@ -1369,7 +1385,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
} while(coords[curr_dim] > sel_end[curr_dim]);
/* Re-calculate the index of this chunk */
- if(H5V_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0)
+ if(H5VM_chunk_index(fm->f_ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end if */
} /* end while */
@@ -1505,9 +1521,10 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm)
+H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_udata)
{
- H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */
+ H5D_chunk_file_iter_ud_t *udata = (H5D_chunk_file_iter_ud_t *)_udata; /* User data for operation */
+ H5D_chunk_map_t *fm = udata->fm; /* File<->memory chunk mapping info */
H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */
hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */
hsize_t chunk_index; /* Chunk index */
@@ -1517,7 +1534,7 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons
FUNC_ENTER_STATIC
/* Calculate the index of this chunk */
- if(H5V_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0)
+ if(H5VM_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Find correct chunk in file & memory skip list */
@@ -1525,7 +1542,7 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons
/* If the chunk index is the same as the last chunk index we used,
* get the cached info to operate on.
*/
- chunk_info=fm->last_chunk_info;
+ chunk_info = fm->last_chunk_info;
} /* end if */
else {
/* If the chunk index is not the same as the last chunk index we used,
@@ -1582,14 +1599,20 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons
} /* end if */
} /* end if */
+#ifdef H5_HAVE_PARALLEL
+ /* Store chunk selection information, for collective multi-chunk I/O */
+ if(udata->io_info->using_mpi_vfd)
+ fm->select_chunk[chunk_index] = chunk_info;
+#endif /* H5_HAVE_PARALLEL */
+
/* Update the "last chunk seen" information */
- fm->last_index=chunk_index;
- fm->last_chunk_info=chunk_info;
+ fm->last_index = chunk_index;
+ fm->last_chunk_info = chunk_info;
} /* end else */
- /* Get the coordinates of the element in the chunk */
+ /* Get the offset of the element within the chunk */
for(u = 0; u < fm->f_ndims; u++)
- coords_in_chunk[u] = coords[u] % fm->layout->u.chunk.dim[u];
+ coords_in_chunk[u] = coords[u] - chunk_info->coords[u];
/* Add point to file selection for chunk */
if(H5S_select_elements(chunk_info->fspace, H5S_SELECT_APPEND, (size_t)1, coords_in_chunk) < 0)
@@ -1629,7 +1652,7 @@ H5D__chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const
FUNC_ENTER_STATIC
/* Calculate the index of this chunk */
- if(H5V_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0)
+ if(H5VM_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Find correct chunk in file & memory skip list */
@@ -1858,8 +1881,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node);
/* Get the info for the chunk in the file */
- if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id,
- chunk_info->coords, chunk_info->index, &udata) < 0)
+ if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
/* Check for non-existant chunk & skip it if appropriate */
@@ -1991,8 +2013,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node);
/* Look up the chunk */
- if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords,
- chunk_info->index, &udata) < 0)
+ if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
/* Pass in chunk's coordinates. */
@@ -2359,7 +2380,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D__chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id)
+H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2924,7 +2945,7 @@ void *
H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
hbool_t relax, hbool_t prev_unfilt_chunk)
{
- H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */
+ const H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */
const H5O_pline_t *pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info - always equal to the pline passed to H5D__chunk_alloc */
const H5O_pline_t *old_pline = pline; /* Old pipeline, i.e. pipeline used to read the chunk */
const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */
@@ -3541,7 +3562,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
+H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
hsize_t old_dim[])
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
@@ -3805,13 +3826,12 @@ H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
hsize_t chunk_idx;
/* Calculate the index of this chunk */
- if(H5V_chunk_index((unsigned)space_ndims, chunk_offset,
+ if(H5VM_chunk_index((unsigned)space_ndims, chunk_offset,
layout->u.chunk.dim, layout->u.chunk.down_chunks,
&chunk_idx) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index")
- if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx,
- &udata) < 0)
+ if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
if(H5D_CHUNK_IDX_NONE != layout->storage.u.chunk.idx_type)
@@ -4142,7 +4162,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[])
&& !H5D__chunk_is_partial_edge_chunk(chunk_offset, NULL, (unsigned)space_ndims, space_dim, chunk_dim));
/* Calculate the index of this chunk */
- if(H5V_chunk_index((unsigned)space_ndims, chunk_offset, chunk_dim,
+ if(H5VM_chunk_index((unsigned)space_ndims, chunk_offset, chunk_dim,
layout->u.chunk.down_chunks,
&(chk_io_info.store->chunk.index)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index")
@@ -4215,7 +4235,7 @@ static herr_t
H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk)
{
const H5D_io_info_t *io_info = udata->io_info; /* Local pointer to I/O info */
- H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */
+ const H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */
const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */
unsigned rank = udata->common.layout->ndims - 1; /* Dataset rank */
const hsize_t *chunk_offset = io_info->store->chunk.offset; /* Chunk offset */
@@ -4237,8 +4257,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk)
H5_ASSIGN_OVERFLOW(chunk_size, layout->u.chunk.size, uint32_t, size_t);
/* Get the info for the chunk in the file */
- if(H5D__chunk_lookup(dset, io_info->dxpl_id, chunk_offset,
- io_info->store->chunk.index, &chk_udata) < 0)
+ if(H5D__chunk_lookup(dset, io_info->dxpl_id, chunk_offset, io_info->store->chunk.index, &chk_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
chk_udata.new_unfilt_chunk = new_unfilt_chunk;
@@ -4658,7 +4677,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
while(!carry) {
/* Calculate the index of this chunk */
- if(H5V_chunk_index((unsigned)space_ndims, chunk_offset,
+ if(H5VM_chunk_index((unsigned)space_ndims, chunk_offset,
layout->u.chunk.dim, layout->u.chunk.down_chunks,
&(chk_io_info.store->chunk.index)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index")
@@ -4708,8 +4727,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
#endif /* NDEBUG */
/* Check if the chunk exists in cache or on disk */
- if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset,
- chk_io_info.store->chunk.index, &chk_udata) < 0)
+ if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chk_io_info.store->chunk.index, &chk_udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk")
/* Evict the entry from the cache if present, but do not flush
@@ -4820,7 +4838,7 @@ H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
FUNC_ENTER_STATIC
/* Compute the index for this chunk */
- if(H5V_chunk_index(rank, chunk_rec->offset, udata->common.layout->dim, udata->common.layout->down_chunks, &chunk_index) < 0)
+ if(H5VM_chunk_index(rank, chunk_rec->offset, udata->common.layout->dim, udata->common.layout->down_chunks, &chunk_index) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, H5_ITER_ERROR, "can't get chunk index")
/* Set it in the userdata to return */
@@ -4848,7 +4866,7 @@ herr_t
H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[])
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
- H5D_t *dset = io_info->dset; /* Local pointer to dataset info */
+ const H5D_t *dset = io_info->dset; /* Local pointer to dataset info */
H5D_chunk_it_ud2_t udata; /* User data for iteration callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -5038,7 +5056,7 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id)
next = ent->next;
/* Calculate the index of this chunk */
- if(H5V_chunk_index(rank, ent->offset, dset->shared->layout.u.chunk.dim, dset->shared->layout.u.chunk.down_chunks, &idx) < 0)
+ if(H5VM_chunk_index(rank, ent->offset, dset->shared->layout.u.chunk.dim, dset->shared->layout.u.chunk.down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Compute the index for the chunk entry */
@@ -5913,7 +5931,7 @@ static herr_t
H5D__nonexistent_readvv_cb(hsize_t UNUSED dst_off, hsize_t src_off, size_t len,
void *_udata)
{
- H5D_chunk_readvv_ud_t *udata = (H5D_chunk_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */
+ H5D_chunk_readvv_ud_t *udata = (H5D_chunk_readvv_ud_t *)_udata; /* User data for H5VM_opvv() operator */
H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */
hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */
herr_t ret_value = SUCCEED; /* Return value */
@@ -5965,7 +5983,7 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info,
size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_off_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[])
{
- H5D_chunk_readvv_ud_t udata; /* User data for H5V_opvv() operator */
+ H5D_chunk_readvv_ud_t udata; /* User data for H5VM_opvv() operator */
ssize_t ret_value; /* Return value */
FUNC_ENTER_STATIC
@@ -5979,13 +5997,13 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info,
HDassert(mem_len_arr);
HDassert(mem_off_arr);
- /* Set up user data for H5V_opvv() */
+ /* Set up user data for H5VM_opvv() */
udata.rbuf = (unsigned char *)io_info->u.rbuf;
udata.dset = io_info->dset;
udata.dxpl_id = io_info->dxpl_id;
/* Call generic sequence operation routine */
- if((ret_value = H5V_opvv(chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_off_arr,
+ if((ret_value = H5VM_opvv(chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_off_arr,
mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr,
H5D__nonexistent_readvv_cb, &udata)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized fill value init")
@@ -6083,7 +6101,7 @@ H5D__chunk_find_flush_dep(const H5D_rdcc_t *rdcc,
HDassert(ent);
/* Calculate the index of this chunk */
- if(H5V_chunk_index(layout->ndims - 1, offset, layout->dim,
+ if(H5VM_chunk_index(layout->ndims - 1, offset, layout->dim,
layout->down_chunks, &chunk_idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index 3855b8b..7d3f313 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -40,7 +40,7 @@
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Oprivate.h" /* Object headers */
-#include "H5Vprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
/****************/
@@ -117,7 +117,7 @@ H5FL_BLK_EXTERN(type_conv);
*-------------------------------------------------------------------------
*/
herr_t
-H5D__compact_fill(H5D_t *dset, hid_t dxpl_id)
+H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id)
{
H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */
hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */
@@ -300,7 +300,7 @@ H5D__compact_readvv(const H5D_io_info_t *io_info,
HDassert(io_info);
/* Use the vectorized memory copy routine to do actual work */
- if((ret_value = H5V_memcpyvv(io_info->u.rbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr, io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr)) < 0)
+ if((ret_value = H5VM_memcpyvv(io_info->u.rbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr, io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr)) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed")
done:
@@ -341,7 +341,7 @@ H5D__compact_writevv(const H5D_io_info_t *io_info,
HDassert(io_info);
/* Use the vectorized memory copy routine to do actual work */
- if((ret_value = H5V_memcpyvv(io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr, io_info->u.wbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr)) < 0)
+ if((ret_value = H5VM_memcpyvv(io_info->store->compact.buf, dset_max_nseq, dset_curr_seq, dset_size_arr, dset_offset_arr, io_info->u.wbuf, mem_max_nseq, mem_curr_seq, mem_size_arr, mem_offset_arr)) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed")
/* Mark the compact dataset's buffer as dirty */
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index acc7124..8d4cd02 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -43,7 +43,7 @@
#include "H5MFprivate.h" /* File memory management */
#include "H5Oprivate.h" /* Object headers */
#include "H5Pprivate.h" /* Property lists */
-#include "H5Vprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
/****************/
@@ -192,7 +192,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D__contig_fill(H5D_t *dset, hid_t dxpl_id)
+H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id)
{
H5D_io_info_t ioinfo; /* Dataset I/O info */
H5D_storage_t store; /* Union of storage info for dataset */
@@ -638,7 +638,7 @@ static herr_t
H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
void *_udata)
{
- H5D_contig_readvv_sieve_ud_t *udata = (H5D_contig_readvv_sieve_ud_t *)_udata; /* User data for H5V_opvv() operator */
+ H5D_contig_readvv_sieve_ud_t *udata = (H5D_contig_readvv_sieve_ud_t *)_udata; /* User data for H5VM_opvv() operator */
H5F_t *file = udata->file; /* File for dataset */
H5D_rdcdc_t *dset_contig = udata->dset_contig; /* Cached information about contiguous data */
const H5D_contig_storage_t *store_contig = udata->store_contig; /* Contiguous storage info for this I/O operation */
@@ -804,7 +804,7 @@ done:
static herr_t
H5D__contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata)
{
- H5D_contig_readvv_ud_t *udata = (H5D_contig_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */
+ H5D_contig_readvv_ud_t *udata = (H5D_contig_readvv_ud_t *)_udata; /* User data for H5VM_opvv() operator */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -857,9 +857,9 @@ H5D__contig_readvv(const H5D_io_info_t *io_info,
/* Check if data sieving is enabled */
if(H5F_HAS_FEATURE(io_info->dset->oloc.file, H5FD_FEAT_DATA_SIEVE)) {
- H5D_contig_readvv_sieve_ud_t udata; /* User data for H5V_opvv() operator */
+ H5D_contig_readvv_sieve_ud_t udata; /* User data for H5VM_opvv() operator */
- /* Set up user data for H5V_opvv() */
+ /* Set up user data for H5VM_opvv() */
udata.file = io_info->dset->oloc.file;
udata.dset_contig = &(io_info->dset->shared->cache.contig);
udata.store_contig = &(io_info->store->contig);
@@ -867,22 +867,22 @@ H5D__contig_readvv(const H5D_io_info_t *io_info,
udata.dxpl_id = io_info->dxpl_id;
/* Call generic sequence operation routine */
- if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
+ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr,
H5D__contig_readvv_sieve_cb, &udata)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized sieve buffer read")
} /* end if */
else {
- H5D_contig_readvv_ud_t udata; /* User data for H5V_opvv() operator */
+ H5D_contig_readvv_ud_t udata; /* User data for H5VM_opvv() operator */
- /* Set up user data for H5V_opvv() */
+ /* Set up user data for H5VM_opvv() */
udata.file = io_info->dset->oloc.file;
udata.dset_addr = io_info->store->contig.dset_addr;
udata.rbuf = (unsigned char *)io_info->u.rbuf;
udata.dxpl_id = io_info->dxpl_id;
/* Call generic sequence operation routine */
- if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
+ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr,
H5D__contig_readvv_cb, &udata)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized read")
@@ -909,7 +909,7 @@ static herr_t
H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
void *_udata)
{
- H5D_contig_writevv_sieve_ud_t *udata = (H5D_contig_writevv_sieve_ud_t *)_udata; /* User data for H5V_opvv() operator */
+ H5D_contig_writevv_sieve_ud_t *udata = (H5D_contig_writevv_sieve_ud_t *)_udata; /* User data for H5VM_opvv() operator */
H5F_t *file = udata->file; /* File for dataset */
H5D_rdcdc_t *dset_contig = udata->dset_contig; /* Cached information about contiguous data */
const H5D_contig_storage_t *store_contig = udata->store_contig; /* Contiguous storage info for this I/O operation */
@@ -1126,7 +1126,7 @@ done:
static herr_t
H5D__contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata)
{
- H5D_contig_writevv_ud_t *udata = (H5D_contig_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */
+ H5D_contig_writevv_ud_t *udata = (H5D_contig_writevv_ud_t *)_udata; /* User data for H5VM_opvv() operator */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1178,9 +1178,9 @@ H5D__contig_writevv(const H5D_io_info_t *io_info,
/* Check if data sieving is enabled */
if(H5F_HAS_FEATURE(io_info->dset->oloc.file, H5FD_FEAT_DATA_SIEVE)) {
- H5D_contig_writevv_sieve_ud_t udata; /* User data for H5V_opvv() operator */
+ H5D_contig_writevv_sieve_ud_t udata; /* User data for H5VM_opvv() operator */
- /* Set up user data for H5V_opvv() */
+ /* Set up user data for H5VM_opvv() */
udata.file = io_info->dset->oloc.file;
udata.dset_contig = &(io_info->dset->shared->cache.contig);
udata.store_contig = &(io_info->store->contig);
@@ -1188,22 +1188,22 @@ H5D__contig_writevv(const H5D_io_info_t *io_info,
udata.dxpl_id = io_info->dxpl_id;
/* Call generic sequence operation routine */
- if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
+ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr,
H5D__contig_writevv_sieve_cb, &udata)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized sieve buffer write")
} /* end if */
else {
- H5D_contig_writevv_ud_t udata; /* User data for H5V_opvv() operator */
+ H5D_contig_writevv_ud_t udata; /* User data for H5VM_opvv() operator */
- /* Set up user data for H5V_opvv() */
+ /* Set up user data for H5VM_opvv() */
udata.file = io_info->dset->oloc.file;
udata.dset_addr = io_info->store->contig.dset_addr;
udata.wbuf = (const unsigned char *)io_info->u.wbuf;
udata.dxpl_id = io_info->dxpl_id;
/* Call generic sequence operation routine */
- if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
+ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr,
H5D__contig_writevv_cb, &udata)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized read")
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index e05a17a..b78f58c 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -39,7 +39,7 @@
#include "H5EAprivate.h" /* Extensible arrays */
#include "H5FLprivate.h" /* Free Lists */
#include "H5MFprivate.h" /* File space management */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -246,7 +246,7 @@ H5D_earray_crt_context(void *_udata)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- ctx->chunk_size_len = 1 + ((H5V_log2_gen(udata->chunk_size) + 8) / 8);
+ ctx->chunk_size_len = 1 + ((H5VM_log2_gen(udata->chunk_size) + 8) / 8);
if(ctx->chunk_size_len > 8)
ctx->chunk_size_len = 8;
@@ -312,7 +312,7 @@ H5D_earray_fill(void *nat_blk, size_t nelmts)
HDassert(nat_blk);
HDassert(nelmts);
- H5V_array_fill(nat_blk, &fill_val, H5EA_CLS_CHUNK->nat_elmt_size, nelmts);
+ H5VM_array_fill(nat_blk, &fill_val, H5EA_CLS_CHUNK->nat_elmt_size, nelmts);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D_earray_fill() */
@@ -465,7 +465,7 @@ H5D_earray_filt_fill(void *nat_blk, size_t nelmts)
HDassert(nelmts);
HDassert(sizeof(fill_val) == H5EA_CLS_FILT_CHUNK->nat_elmt_size);
- H5V_array_fill(nat_blk, &fill_val, H5EA_CLS_FILT_CHUNK->nat_elmt_size, nelmts);
+ H5VM_array_fill(nat_blk, &fill_val, H5EA_CLS_FILT_CHUNK->nat_elmt_size, nelmts);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D_earray_filt_fill() */
@@ -983,7 +983,7 @@ H5D_earray_idx_create(const H5D_chk_idx_info_t *idx_info)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- chunk_size_len = 1 + ((H5V_log2_gen(idx_info->layout->size) + 8) / 8);
+ chunk_size_len = 1 + ((H5VM_log2_gen(idx_info->layout->size) + 8) / 8);
if(chunk_size_len > 8)
chunk_size_len = 8;
@@ -1104,15 +1104,15 @@ H5D_earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
/* Set up the swizzled chunk coordinates */
HDmemcpy(swizzled_coords, udata->common.offset, ndims * sizeof(udata->common.offset[0]));
- H5V_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
+ H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
/* Calculate the index of this chunk */
- if(H5V_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end if */
else {
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end else */
@@ -1126,12 +1126,12 @@ H5D_earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- allow_chunk_size_len = 1 + ((H5V_log2_gen(idx_info->layout->size) + 8) / 8);
+ allow_chunk_size_len = 1 + ((H5VM_log2_gen(idx_info->layout->size) + 8) / 8);
if(allow_chunk_size_len > 8)
allow_chunk_size_len = 8;
/* Compute encoded size of chunk */
- new_chunk_size_len = (H5V_log2_gen(udata->nbytes) + 8) / 8;
+ new_chunk_size_len = (H5VM_log2_gen(udata->nbytes) + 8) / 8;
if(new_chunk_size_len > 8)
HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "encoded chunk size is more than 8 bytes?!?")
@@ -1270,15 +1270,15 @@ H5D_earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat
/* Set up the swizzled chunk coordinates */
HDmemcpy(swizzled_coords, udata->common.offset, ndims * sizeof(udata->common.offset[0]));
- H5V_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
+ H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
/* Calculate the index of this chunk */
- if(H5V_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end if */
else {
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end else */
@@ -1340,14 +1340,14 @@ H5D_earray_idx_resize(H5O_layout_chunk_t *layout)
/* Get the swizzled chunk dimensions */
HDmemcpy(layout->u.earray.swizzled_dim, layout->dim, (layout->ndims - 1) * sizeof(layout->dim[0]));
- H5V_swizzle_coords(uint32_t, layout->u.earray.swizzled_dim, layout->u.earray.unlim_dim);
+ H5VM_swizzle_coords(uint32_t, layout->u.earray.swizzled_dim, layout->u.earray.unlim_dim);
/* Get the swizzled number of chunks in each dimension */
HDmemcpy(swizzled_chunks, layout->chunks, (layout->ndims - 1) * sizeof(swizzled_chunks[0]));
- H5V_swizzle_coords(hsize_t, swizzled_chunks, layout->u.earray.unlim_dim);
+ H5VM_swizzle_coords(hsize_t, swizzled_chunks, layout->u.earray.unlim_dim);
/* Get the swizzled "down" sizes for each dimension */
- if(H5V_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks) < 0)
+ if(H5VM_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value")
} /* end if */
@@ -1517,16 +1517,16 @@ H5D_earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t
/* Set up the swizzled chunk coordinates */
HDmemcpy(swizzled_coords, udata->offset, ndims * sizeof(udata->offset[0]));
- H5V_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
+ H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
/* Calculate the index of this chunk */
- if(H5V_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end if */
else {
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end else */
@@ -1918,15 +1918,15 @@ H5D_earray_idx_support(const H5D_chk_idx_info_t *idx_info,
/* Set up the swizzled chunk coordinates */
HDmemcpy(swizzled_coords, udata->common.offset, ndims * sizeof(udata->common.offset[0]));
- H5V_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
+ H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
/* Calculate the index of this chunk */
- if(H5V_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end if */
else {
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end else */
@@ -1988,16 +1988,16 @@ H5D_earray_idx_unsupport(const H5D_chk_idx_info_t *idx_info,
/* Set up the swizzled chunk coordinates */
HDmemcpy(swizzled_coords, udata->common.offset, ndims * sizeof(udata->common.offset[0]));
- H5V_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
+ H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
/* Calculate the index of this chunk */
- if(H5V_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end if */
else {
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
} /* end else */
diff --git a/src/H5Defl.c b/src/H5Defl.c
index c5cf8e2..38c8ccd 100644
--- a/src/H5Defl.c
+++ b/src/H5Defl.c
@@ -33,7 +33,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
#include "H5HLprivate.h" /* Local Heaps */
-#include "H5Vprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
/****************/
@@ -425,7 +425,7 @@ done:
static herr_t
H5D__efl_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata)
{
- H5D_efl_readvv_ud_t *udata = (H5D_efl_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */
+ H5D_efl_readvv_ud_t *udata = (H5D_efl_readvv_ud_t *)_udata; /* User data for H5VM_opvv() operator */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -459,7 +459,7 @@ H5D__efl_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[])
{
- H5D_efl_readvv_ud_t udata; /* User data for H5V_opvv() operator */
+ H5D_efl_readvv_ud_t udata; /* User data for H5VM_opvv() operator */
ssize_t ret_value; /* Return value (Total size of sequence in bytes) */
FUNC_ENTER_STATIC
@@ -475,12 +475,12 @@ H5D__efl_readvv(const H5D_io_info_t *io_info,
HDassert(mem_len_arr);
HDassert(mem_off_arr);
- /* Set up user data for H5V_opvv() */
+ /* Set up user data for H5VM_opvv() */
udata.efl = &(io_info->store->efl);
udata.rbuf = (unsigned char *)io_info->u.rbuf;
/* Call generic sequence operation routine */
- if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
+ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr,
H5D__efl_readvv_cb, &udata)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized EFL read")
@@ -505,7 +505,7 @@ done:
static herr_t
H5D__efl_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata)
{
- H5D_efl_writevv_ud_t *udata = (H5D_efl_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */
+ H5D_efl_writevv_ud_t *udata = (H5D_efl_writevv_ud_t *)_udata; /* User data for H5VM_opvv() operator */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -539,7 +539,7 @@ H5D__efl_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[])
{
- H5D_efl_writevv_ud_t udata; /* User data for H5V_opvv() operator */
+ H5D_efl_writevv_ud_t udata; /* User data for H5VM_opvv() operator */
ssize_t ret_value; /* Return value (Total size of sequence in bytes) */
FUNC_ENTER_STATIC
@@ -555,12 +555,12 @@ H5D__efl_writevv(const H5D_io_info_t *io_info,
HDassert(mem_len_arr);
HDassert(mem_off_arr);
- /* Set up user data for H5V_opvv() */
+ /* Set up user data for H5VM_opvv() */
udata.efl = &(io_info->store->efl);
udata.wbuf = (const unsigned char *)io_info->u.wbuf;
/* Call generic sequence operation routine */
- if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
+ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr,
mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr,
H5D__efl_writevv_cb, &udata)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized EFL write")
diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c
index 7786a76..351a52f 100644
--- a/src/H5Dfarray.c
+++ b/src/H5Dfarray.c
@@ -38,7 +38,7 @@
#include "H5FAprivate.h" /* Fixed arrays */
#include "H5FLprivate.h" /* Free Lists */
#include "H5MFprivate.h" /* File space management */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -256,7 +256,7 @@ H5D_farray_crt_context(void *_udata)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- ctx->chunk_size_len = 1 + ((H5V_log2_gen(udata->chunk_size) + 8) / 8);
+ ctx->chunk_size_len = 1 + ((H5VM_log2_gen(udata->chunk_size) + 8) / 8);
if(ctx->chunk_size_len > 8)
ctx->chunk_size_len = 8;
@@ -322,7 +322,7 @@ H5D_farray_fill(void *nat_blk, size_t nelmts)
HDassert(nat_blk);
HDassert(nelmts);
- H5V_array_fill(nat_blk, &fill_val, H5FA_CLS_CHUNK->nat_elmt_size, nelmts);
+ H5VM_array_fill(nat_blk, &fill_val, H5FA_CLS_CHUNK->nat_elmt_size, nelmts);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D_farray_fill() */
@@ -580,7 +580,7 @@ H5D_farray_filt_fill(void *nat_blk, size_t nelmts)
HDassert(nelmts);
HDassert(sizeof(fill_val) == H5FA_CLS_FILT_CHUNK->nat_elmt_size);
- H5V_array_fill(nat_blk, &fill_val, H5FA_CLS_FILT_CHUNK->nat_elmt_size, nelmts);
+ H5VM_array_fill(nat_blk, &fill_val, H5FA_CLS_FILT_CHUNK->nat_elmt_size, nelmts);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D_farray_filt_fill() */
@@ -809,7 +809,7 @@ H5D_farray_idx_create(const H5D_chk_idx_info_t *idx_info)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- chunk_size_len = 1 + ((H5V_log2_gen(idx_info->layout->size) + 8) / 8);
+ chunk_size_len = 1 + ((H5VM_log2_gen(idx_info->layout->size) + 8) / 8);
if(chunk_size_len > 8)
chunk_size_len = 8;
@@ -916,7 +916,7 @@ H5D_farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
fa = idx_info->storage->u.farray.fa;
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Check for filters on chunks */
@@ -929,12 +929,12 @@ H5D_farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- allow_chunk_size_len = 1 + ((H5V_log2_gen(idx_info->layout->size) + 8) / 8);
+ allow_chunk_size_len = 1 + ((H5VM_log2_gen(idx_info->layout->size) + 8) / 8);
if(allow_chunk_size_len > 8)
allow_chunk_size_len = 8;
/* Compute encoded size of chunk */
- new_chunk_size_len = (H5V_log2_gen(udata->nbytes) + 8) / 8;
+ new_chunk_size_len = (H5VM_log2_gen(udata->nbytes) + 8) / 8;
if(new_chunk_size_len > 8)
HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "encoded chunk size is more than 8 bytes?!?")
@@ -1067,7 +1067,7 @@ H5D_farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat
fa = idx_info->storage->u.farray.fa;
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Check for filters on chunks */
@@ -1123,7 +1123,7 @@ H5D_farray_idx_iterate_cb(hsize_t UNUSED idx, const void *_elmt, void *_udata)
int curr_dim; /* Current dimension */
int ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Compose generic chunk record for callback */
if(udata->filtered) {
@@ -1286,7 +1286,7 @@ H5D_farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t
fa = idx_info->storage->u.farray.fa;
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Check for filters on chunks */
diff --git a/src/H5Dfill.c b/src/H5Dfill.c
index 2edb363..e682dd6 100644
--- a/src/H5Dfill.c
+++ b/src/H5Dfill.c
@@ -38,7 +38,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
-#include "H5Vprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
#include "H5WBprivate.h" /* Wrapped Buffers */
@@ -262,7 +262,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Replicate the file's fill value into the temporary buffer */
- H5V_array_fill(tmp_buf, fill, src_type_size, (size_t)nelmts);
+ H5VM_array_fill(tmp_buf, fill, src_type_size, (size_t)nelmts);
/* Convert from file's fill value into memory form */
if(H5T_convert(tpath, src_id, dst_id, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, bkg_buf, dxpl_id) < 0)
@@ -494,7 +494,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf,
} /* end else */
/* Replicate the fill value into the cached buffer */
- H5V_array_fill(fb_info->fill_buf, fill->buf, fb_info->max_elmt_size, fb_info->elmts_per_buf);
+ H5VM_array_fill(fb_info->fill_buf, fill->buf, fb_info->max_elmt_size, fb_info->elmts_per_buf);
} /* end else */
} /* end if */
else { /* Fill the buffer with the default fill value */
@@ -588,7 +588,7 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id)
/* Replicate the fill value into the cached buffer */
if(nelmts > 1)
- H5V_array_fill((void *)((unsigned char *)fb_info->fill_buf + fb_info->mem_elmt_size), fb_info->fill_buf, fb_info->mem_elmt_size, (nelmts - 1));
+ H5VM_array_fill((void *)((unsigned char *)fb_info->fill_buf + fb_info->mem_elmt_size), fb_info->fill_buf, fb_info->mem_elmt_size, (nelmts - 1));
/* Reset the entire background buffer, if necessary */
if(H5T_path_bkg(fb_info->mem_to_dset_tpath))
diff --git a/src/H5Dint.c b/src/H5Dint.c
index cbab788..7c1c0a8 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -68,7 +68,7 @@ static herr_t H5D__swmr_teardown(const H5D_t *dataset, hid_t dxpl_id);
static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset,
hid_t dapl_id);
static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id);
-static herr_t H5D__init_storage(H5D_t *dataset, hbool_t full_overwrite,
+static herr_t H5D__init_storage(const H5D_t *dataset, hbool_t full_overwrite,
hsize_t old_dim[], hid_t dxpl_id);
@@ -1701,7 +1701,7 @@ H5D_typeof(const H5D_t *dset)
*-------------------------------------------------------------------------
*/
herr_t
-H5D__alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_alloc,
+H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc,
hbool_t full_overwrite, hsize_t old_dim[])
{
H5F_t *f = dset->oloc.file; /* The dataset's file pointer */
@@ -1864,7 +1864,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[],
+H5D__init_storage(const H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[],
hid_t dxpl_id)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2487,7 +2487,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D__mark(H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags)
+H5D__mark(const H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 9b2f8ff..2687c5f 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -59,7 +59,11 @@ static herr_t H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_i
hid_t file_space_id, hid_t dxpl_id, const void *buf);
/* Setup/teardown routines */
-static herr_t H5D__ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache,
+static herr_t H5D__ioinfo_init(H5D_t *dset,
+#ifndef H5_HAVE_PARALLEL
+const
+#endif /* H5_HAVE_PARALLEL */
+ H5D_dxpl_cache_t *dxpl_cache,
hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store,
H5D_io_info_t *io_info);
static herr_t H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache,
@@ -275,14 +279,15 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
+ /* Retrieve the 'direct write' flag */
if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &direct_write) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting flag for direct chunk write")
/* Direct chunk write */
if(direct_write) {
- uint32_t direct_filters = 0;
+ uint32_t direct_filters;
hsize_t *direct_offset;
- size_t direct_datasize = 0;
+ uint32_t direct_datasize;
int ndims = 0;
hsize_t dims[H5O_LAYOUT_NDIMS];
hsize_t internal_offset[H5O_LAYOUT_NDIMS];
@@ -291,12 +296,11 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
if(H5D_CHUNKED != dset->shared->layout.type)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
+ /* Retrieve parameters for direct chunk write */
if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &direct_filters) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting filter info for direct chunk write")
-
if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &direct_offset) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting offset info for direct chunk write")
-
if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &direct_datasize) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting data size for direct chunk write")
@@ -305,7 +309,7 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dims, NULL)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims")
- for(i=0; i<ndims; i++) {
+ for(i = 0; i < ndims; i++) {
/* Make sure the offset doesn't exceed the dataset's dimensions */
if(direct_offset[i] > dims[i])
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset")
@@ -315,7 +319,7 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary")
internal_offset[i] = direct_offset[i];
- }
+ } /* end for */
/* Terminate the offset with a zero */
internal_offset[ndims] = 0;
@@ -323,7 +327,8 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
/* write raw data */
if(H5D__chunk_direct_write(dset, dxpl_id, direct_filters, internal_offset, direct_datasize, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write chunk directly")
- } else { /* Normal write */
+ } /* end if */
+ else { /* Normal write */
const H5S_t *mem_space = NULL;
const H5S_t *file_space = NULL;
char fake_char;
@@ -472,7 +477,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* Attempt to construct projected dataspace for memory dataspace */
if(H5S_select_construct_projection(mem_space, &projected_mem_space,
- (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, &adj_buf, type_info.dst_type_size) < 0)
+ (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, (const void **)&adj_buf, type_info.dst_type_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace")
HDassert(projected_mem_space);
HDassert(adj_buf);
@@ -698,7 +703,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* Attempt to construct projected dataspace for memory dataspace */
if(H5S_select_construct_projection(mem_space, &projected_mem_space,
- (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, &adj_buf, type_info.src_type_size) < 0)
+ (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, (const void **)&adj_buf, type_info.src_type_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace")
HDassert(projected_mem_space);
HDassert(adj_buf);
@@ -825,7 +830,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
+H5D__ioinfo_init(H5D_t *dset,
+#ifndef H5_HAVE_PARALLEL
+const
+#endif /* H5_HAVE_PARALLEL */
+ H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info)
{
FUNC_ENTER_STATIC_NOERR
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 7b4520f..c0b4181 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -43,7 +43,7 @@
#include "H5Oprivate.h" /* Object headers */
#include "H5Pprivate.h" /* Property lists */
#include "H5Sprivate.h" /* Dataspaces */
-#include "H5Vprivate.h" /* Vector */
+#include "H5VMprivate.h" /* Vector */
#ifdef H5_HAVE_PARALLEL
@@ -183,42 +183,30 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space,
/* Optimized MPI types flag must be set and it must be collective IO */
/* (Don't allow parallel I/O for the MPI-posix driver, since it doesn't do real collective I/O) */
if(!(H5S_mpi_opt_types_g && io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE
- && !IS_H5FD_MPIPOSIX(io_info->dset->oloc.file))) {
+ && !IS_H5FD_MPIPOSIX(io_info->dset->oloc.file)))
local_cause |= H5D_MPIO_SET_MPIPOSIX;
- } /* end if */
/* Don't allow collective operations if datatype conversions need to happen */
- if(!type_info->is_conv_noop) {
+ if(!type_info->is_conv_noop)
local_cause |= H5D_MPIO_DATATYPE_CONVERSION;
- } /* end if */
/* Don't allow collective operations if data transform operations should occur */
- if(!type_info->is_xform_noop) {
+ if(!type_info->is_xform_noop)
local_cause |= H5D_MPIO_DATA_TRANSFORMS;
- } /* end if */
/* Check whether these are both simple or scalar dataspaces */
if(!((H5S_SIMPLE == H5S_GET_EXTENT_TYPE(mem_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(mem_space))
- && (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(file_space)))) {
+ && (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(file_space))))
local_cause |= H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES;
- } /* end if */
-
- /* Can't currently handle point selections */
- if(H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(mem_space)
- || H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(file_space)) {
- local_cause |= H5D_MPIO_POINT_SELECTIONS;
- } /* end if */
/* Dataset storage must be contiguous or chunked */
if(!(io_info->dset->shared->layout.type == H5D_CONTIGUOUS ||
- io_info->dset->shared->layout.type == H5D_CHUNKED)) {
+ io_info->dset->shared->layout.type == H5D_CHUNKED))
local_cause |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET;
- } /* end if */
/* check if external-file storage is used */
- if (io_info->dset->shared->dcpl_cache.efl.nused > 0) {
+ if(io_info->dset->shared->dcpl_cache.efl.nused > 0)
local_cause |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET;
- }
/* The handling of memory space is different for chunking and contiguous
* storage. For contiguous storage, mem_space and file_space won't change
@@ -228,11 +216,9 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space,
*/
/* Don't allow collective operations if filters need to be applied */
- if(io_info->dset->shared->layout.type == H5D_CHUNKED) {
- if(io_info->dset->shared->dcpl_cache.pline.nused > 0) {
- local_cause |= H5D_MPIO_FILTERS;
- } /* end if */
- } /* end if */
+ if(io_info->dset->shared->layout.type == H5D_CHUNKED &&
+ io_info->dset->shared->dcpl_cache.pline.nused > 0)
+ local_cause |= H5D_MPIO_FILTERS;
/* Form consensus opinion among all processes about whether to perform
* collective I/O
@@ -242,7 +228,6 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space,
ret_value = global_cause > 0 ? FALSE : TRUE;
-
done:
/* Write the local value of no-collective-cause to the DXPL. */
if(H5P_set(dx_plist, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &local_cause) < 0)
@@ -946,15 +931,58 @@ if(H5DEBUG(D))
/* Obtain MPI derived datatype from all individual chunks */
for(u = 0; u < num_chunk; u++) {
- /* Disk MPI derived datatype */
+ hsize_t *permute_map = NULL; /* array that holds the mapping from the old,
+ out-of-order displacements to the in-order
+ displacements of the MPI datatypes of the
+ point selection of the file space */
+ hbool_t is_permuted = FALSE;
+
+ /* Obtain disk and memory MPI derived datatype */
+ /* NOTE: The permute_map array can be allocated within H5S_mpio_space_type
+ * and will be fed into the next call to H5S_mpio_space_type
+ * where it will be freed.
+ */
if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.fspace,
- type_info->src_type_size, &chunk_ftype[u], &chunk_mpi_file_counts[u], &(chunk_mft_is_derived_array[u])) < 0)
+ type_info->src_type_size,
+ &chunk_ftype[u], /* OUT: datatype created */
+ &chunk_mpi_file_counts[u], /* OUT */
+ &(chunk_mft_is_derived_array[u]), /* OUT */
+ TRUE, /* this is a file space,
+ so permute the
+ datatype if the point
+ selections are out of
+ order */
+ &permute_map,/* OUT: a map to indicate the
+ permutation of points
+ selected in case they
+ are out of order */
+ &is_permuted /* OUT */) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type")
-
- /* Buffer MPI derived datatype */
+ /* Sanity check */
+ if(is_permuted)
+ HDassert(permute_map);
if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.mspace,
- type_info->dst_type_size, &chunk_mtype[u], &chunk_mpi_mem_counts[u], &(chunk_mbt_is_derived_array[u])) < 0)
+ type_info->dst_type_size, &chunk_mtype[u],
+ &chunk_mpi_mem_counts[u],
+ &(chunk_mbt_is_derived_array[u]),
+ FALSE, /* this is a memory
+ space, so if the file
+ space is not
+ permuted, there is no
+ need to permute the
+ datatype if the point
+ selections are out of
+ order*/
+ &permute_map, /* IN: the permutation map
+ generated by the
+ file_space selection
+ and applied to the
+ memory selection */
+ &is_permuted /* IN */) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buf type")
+ /* Sanity check */
+ if(is_permuted)
+ HDassert(!permute_map);
/* Chunk address relative to the first chunk */
chunk_addr_info_array[u].chunk_addr -= ctg_store.contig.dset_addr;
@@ -1307,12 +1335,51 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
if((file_space != NULL) && (mem_space != NULL)) {
int mpi_file_count; /* Number of file "objects" to transfer */
+ hsize_t *permute_map = NULL; /* array that holds the mapping from the old,
+ out-of-order displacements to the in-order
+ displacements of the MPI datatypes of the
+ point selection of the file space */
+ hbool_t is_permuted = FALSE;
/* Obtain disk and memory MPI derived datatype */
- if(H5S_mpio_space_type(file_space, type_info->src_type_size, &mpi_file_type, &mpi_file_count, &mft_is_derived) < 0)
+ /* NOTE: The permute_map array can be allocated within H5S_mpio_space_type
+ * and will be fed into the next call to H5S_mpio_space_type
+ * where it will be freed.
+ */
+ if(H5S_mpio_space_type(file_space, type_info->src_type_size,
+ &mpi_file_type, &mpi_file_count, &mft_is_derived, /* OUT: datatype created */
+ TRUE, /* this is a file space, so
+ permute the datatype if the
+ point selection is out of
+ order */
+ &permute_map, /* OUT: a map to indicate
+ the permutation of
+ points selected in
+ case they are out of
+ order */
+ &is_permuted /* OUT */) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type")
- if(H5S_mpio_space_type(mem_space, type_info->src_type_size, &mpi_buf_type, &mpi_buf_count, &mbt_is_derived) < 0)
+ /* Sanity check */
+ if(is_permuted)
+ HDassert(permute_map);
+ if(H5S_mpio_space_type(mem_space, type_info->src_type_size,
+ &mpi_buf_type, &mpi_buf_count, &mbt_is_derived, /* OUT: datatype created */
+ FALSE, /* this is a memory space, so if
+ the file space is not
+ permuted, there is no need to
+ permute the datatype if the
+ point selections are out of
+ order*/
+ &permute_map /* IN: the permutation map
+ generated by the
+ file_space selection
+ and applied to the
+ memory selection */,
+ &is_permuted /* IN */) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buffer type")
+ /* Sanity check */
+ if(is_permuted)
+ HDassert(!permute_map);
} /* end if */
else {
/* For non-selection, participate with a none MPI derived datatype, the count is 0. */
diff --git a/src/H5Dnone.c b/src/H5Dnone.c
index 3c4c761..ac6f42c 100644
--- a/src/H5Dnone.c
+++ b/src/H5Dnone.c
@@ -41,7 +41,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
#include "H5MFprivate.h" /* File space management */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -210,7 +210,7 @@ H5D_none_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
HDassert(udata);
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
HDassert(!H5F_addr_defined(udata->addr));
@@ -257,7 +257,7 @@ H5D_none_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
HDassert(H5F_addr_defined(idx_info->storage->idx_addr));
/* Calculate the index of this chunk */
- if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Calculate the address of the chunk */
@@ -321,7 +321,7 @@ H5D_none_iterate(const H5D_chk_idx_info_t *idx_info,
/* Iterate over all the chunks in the dataset's dataspace */
for(u = 0; u < idx_info->layout->nchunks; u++) {
/* Calculate the index of this chunk */
- if(H5V_chunk_index(ndims, chunk_rec.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
+ if(H5VM_chunk_index(ndims, chunk_rec.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Calculate the address of the chunk */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 46d545d..1da0834 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -209,7 +209,7 @@ typedef enum H5D_io_op_type_t {
} H5D_io_op_type_t;
typedef struct H5D_io_info_t {
- H5D_t *dset; /* Pointer to dataset being operated on */
+ const H5D_t *dset; /* Pointer to dataset being operated on */
#ifndef H5_HAVE_PARALLEL
const
#endif /* H5_HAVE_PARALLEL */
@@ -592,7 +592,7 @@ H5_DLL H5D_t *H5D__create_named(const H5G_loc_t *loc, const char *name,
hid_t dapl_id, hid_t dxpl_id);
H5_DLL herr_t H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation,
hid_t dxpl_id);
-H5_DLL herr_t H5D__alloc_storage(H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc,
+H5_DLL herr_t H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc,
hbool_t full_overwrite, hsize_t old_dim[]);
H5_DLL herr_t H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size);
H5_DLL haddr_t H5D__get_offset(const H5D_t *dset);
@@ -606,7 +606,7 @@ H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id
H5_DLL herr_t H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache);
H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id);
H5_DLL herr_t H5D__flush_real(H5D_t *dataset, hid_t dxpl_id);
-H5_DLL herr_t H5D__mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags);
+H5_DLL herr_t H5D__mark(const H5D_t *dataset, hid_t dxpl_id, unsigned flags);
/* Internal I/O routines */
H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id,
@@ -651,7 +651,7 @@ H5_DLL herr_t H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh,
H5_DLL herr_t H5D__contig_alloc(H5F_t *f, hid_t dxpl_id,
H5O_storage_contig_t *storage);
H5_DLL hbool_t H5D__contig_is_space_alloc(const H5O_storage_t *storage);
-H5_DLL herr_t H5D__contig_fill(H5D_t *dset, hid_t dxpl_id);
+H5_DLL herr_t H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id);
H5_DLL herr_t H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t *fm);
@@ -668,7 +668,7 @@ H5_DLL herr_t H5D__contig_delete(H5F_t *f, hid_t dxpl_id,
/* Functions that operate on chunked dataset storage */
H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr,
hbool_t write_op);
-H5_DLL herr_t H5D__chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id);
+H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id);
H5_DLL herr_t H5D__chunk_set_info(const H5D_t *dset);
H5_DLL herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset,
hid_t dapl_id);
@@ -683,7 +683,7 @@ H5_DLL herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info,
H5_DLL herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id,
const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset);
H5_DLL herr_t H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes);
-H5_DLL herr_t H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id,
+H5_DLL herr_t H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id,
hbool_t full_overwrite, hsize_t old_dim[]);
H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id,
hsize_t old_dim[]);
@@ -708,12 +708,14 @@ H5_DLL herr_t H5D__chunk_create_flush_dep(const H5D_rdcc_t *rdcc,
H5_DLL herr_t H5D__chunk_update_flush_dep(const H5D_rdcc_t *rdcc,
const H5O_layout_chunk_t *layout, const hsize_t offset[], void *old_parent,
void *new_parent);
+H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters,
+ hsize_t *offset, uint32_t data_size, const void *buf);
#ifdef H5D_CHUNK_DEBUG
H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers);
#endif /* H5D_CHUNK_DEBUG */
/* Functions that operate on compact dataset storage */
-H5_DLL herr_t H5D__compact_fill(H5D_t *dset, hid_t dxpl_id);
+H5_DLL herr_t H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id);
H5_DLL herr_t H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src,
H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *src_dtype,
H5O_copy_t *cpy_info, hid_t dxpl_id);
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h
index e154f60..ba1159c 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -176,8 +176,5 @@ H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_ad
H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream,
int indent, int fwidth, unsigned ndims);
-H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters,
- hsize_t *offset, size_t data_size, const void *buf);
-
#endif /* _H5Dprivate_H */
diff --git a/src/H5Dproxy.c b/src/H5Dproxy.c
index 507a0bf..3db3cb7 100644
--- a/src/H5Dproxy.c
+++ b/src/H5Dproxy.c
@@ -365,7 +365,7 @@ HDfprintf(stderr, "%s: ent->proxy_addr = %a\n", FUNC, ent->proxy_addr);
/* Create a flush dependency between the proxy (as the child) and the
* metadata object in the index (as the parent).
*/
- if((supported = (dset->shared->layout.storage.u.chunk.ops->support)(&idx_info, (H5D_chunk_common_ud_t *)udata, (H5AC_info_t *)proxy)) < 0)
+ if((supported = (dset->shared->layout.storage.u.chunk.ops->support)(&idx_info, (H5D_chunk_ud_t *)udata, (H5AC_info_t *)proxy)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTDEPEND, FAIL, "unable to create flush dependency for chunk proxy")
proxy->supported = (hbool_t)supported;
diff --git a/src/H5EA.c b/src/H5EA.c
index 7f2bb77..1fa6901 100644
--- a/src/H5EA.c
+++ b/src/H5EA.c
@@ -48,7 +48,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5FLprivate.h" /* Free Lists */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -562,13 +562,13 @@ if(sblock->dblk_npages)
HDfprintf(stderr, "%s: sblock->addr = %a\n", FUNC, sblock->addr);
HDfprintf(stderr, "%s: sblock->dblk_addrs[%Zu] = %a\n", FUNC, dblk_idx, sblock->dblk_addrs[dblk_idx]);
HDfprintf(stderr, "%s: H5EA_DBLOCK_PREFIX_SIZE(sblock) = %u\n", FUNC, (unsigned)H5EA_DBLOCK_PREFIX_SIZE(sblock));
-HDfprintf(stderr, "%s: sblock->page_init[%Zu] = %t\n", FUNC, page_init_idx, H5V_bit_get(sblock->page_init, page_init_idx));
+HDfprintf(stderr, "%s: sblock->page_init[%Zu] = %t\n", FUNC, page_init_idx, H5VM_bit_get(sblock->page_init, page_init_idx));
HDfprintf(stderr, "%s: page_idx = %Zu, elmt_idx = %Hu, dblk_page_addr = %a\n", FUNC, page_idx, elmt_idx, dblk_page_addr);
HDfprintf(stderr, "%s: sblock->dblk_page_size = %Zu\n", FUNC, sblock->dblk_page_size);
#endif /* QAK */
/* Check if page has been initialized yet */
- if(!H5V_bit_get(sblock->page_init, page_init_idx)) {
+ if(!H5VM_bit_get(sblock->page_init, page_init_idx)) {
/* Check if we are allowed to create the thing */
if(H5AC_WRITE == thing_acc) {
/* Create the data block page */
@@ -576,7 +576,7 @@ HDfprintf(stderr, "%s: sblock->dblk_page_size = %Zu\n", FUNC, sblock->dblk_page_
H5E_THROW(H5E_CANTCREATE, "unable to create data block page")
/* Mark data block page as initialized in super block */
- H5V_bit_set(sblock->page_init, page_init_idx, TRUE);
+ H5VM_bit_set(sblock->page_init, page_init_idx, TRUE);
sblock_cache_flags |= H5AC__DIRTIED_FLAG;
} /* end if */
else
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index 055293e..fe29a46 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -43,7 +43,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
#include "H5WBprivate.h" /* Wrapped Buffers */
diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c
index eba7470..3c2da7c 100644
--- a/src/H5EAdblkpage.c
+++ b/src/H5EAdblkpage.c
@@ -43,7 +43,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5FLprivate.h" /* Free Lists */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c
index 640f353..dd1e7b0 100644
--- a/src/H5EAdblock.c
+++ b/src/H5EAdblock.c
@@ -44,7 +44,7 @@
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5FLprivate.h" /* Free Lists */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
@@ -276,7 +276,7 @@ HDfprintf(stderr, "%s: after adjusting for index block elements, idx = %Hu\n", F
#ifdef QAK
HDfprintf(stderr, "%s: hdr->cparam.data_blk_min_elmts = %u\n", FUNC, (unsigned)hdr->cparam.data_blk_min_elmts);
#endif /* QAK */
- sblk_idx = H5V_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1));
+ sblk_idx = H5VM_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1));
#ifdef QAK
HDfprintf(stderr, "%s: sblk_idx = %u\n", FUNC, sblk_idx);
HDfprintf(stderr, "%s: hdr->sblk_info[%u] = {%Hu, %Zu, %Hu, %Hu}\n", FUNC, sblk_idx, hdr->sblk_info[sblk_idx].ndblks, hdr->sblk_info[sblk_idx].dblk_nelmts, hdr->sblk_info[sblk_idx].start_idx, hdr->sblk_info[sblk_idx].start_dblk);
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index 480e7e0..bb10f9e 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -43,7 +43,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
@@ -202,7 +202,7 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata))
HDassert(hdr->cparam.sup_blk_min_data_ptrs);
/* Compute general information */
- hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5V_log2_of2(hdr->cparam.data_blk_min_elmts));
+ hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts));
hdr->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits;
hdr->arr_off_size = (unsigned char)H5EA_SIZEOF_OFFSET_BITS(hdr->cparam.max_nelmts_bits);
#ifdef QAK
@@ -271,7 +271,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
- idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
+ idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
#ifdef QAK
HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx);
#endif /* QAK */
@@ -341,7 +341,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
- idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
+ idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
#ifdef QAK
HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx);
#endif /* QAK */
diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c
index e18947a..3c2894a 100644
--- a/src/H5EAiblock.c
+++ b/src/H5EAiblock.c
@@ -44,7 +44,7 @@
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5FLprivate.h" /* Free Lists */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
@@ -219,7 +219,7 @@ HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size);
haddr_t tmp_addr = HADDR_UNDEF; /* Address value to fill data block addresses with */
/* Set all the data block addresses to "undefined" address value */
- H5V_array_fill(iblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), iblock->ndblk_addrs);
+ H5VM_array_fill(iblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), iblock->ndblk_addrs);
} /* end if */
/* Reset any super block addresses in the index block */
@@ -227,7 +227,7 @@ HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size);
haddr_t tmp_addr = HADDR_UNDEF; /* Address value to fill super block addresses with */
/* Set all the super block addresses to "undefined" address value */
- H5V_array_fill(iblock->sblk_addrs, &tmp_addr, sizeof(haddr_t), iblock->nsblk_addrs);
+ H5VM_array_fill(iblock->sblk_addrs, &tmp_addr, sizeof(haddr_t), iblock->nsblk_addrs);
} /* end if */
/* Cache the new extensible array index block */
diff --git a/src/H5EApkg.h b/src/H5EApkg.h
index c157671..3ebaea5 100644
--- a/src/H5EApkg.h
+++ b/src/H5EApkg.h
@@ -148,7 +148,7 @@
#define H5EA_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8)
/* Compute the first super block index that will hold a certain # of data block pointers */
-#define H5EA_SBLK_FIRST_IDX(m) (2 * H5V_log2_of2((uint32_t)m))
+#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM_log2_of2((uint32_t)m))
/****************************/
/* Package Private Typedefs */
diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c
index ba1c40f..1cc8bd9 100644
--- a/src/H5EAsblock.c
+++ b/src/H5EAsblock.c
@@ -44,7 +44,7 @@
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5FLprivate.h" /* Free Lists */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
@@ -229,7 +229,7 @@ HDfprintf(stderr, "%s: sblock->block_off = %Hu\n", FUNC, sblock->block_off);
sblock->addr = sblock_addr;
/* Reset data block addresses to "undefined" address value */
- H5V_array_fill(sblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), sblock->ndblks);
+ H5VM_array_fill(sblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), sblock->ndblks);
/* Cache the new extensible array super block */
if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblock_addr, sblock, H5AC__NO_FLAGS_SET) < 0)
diff --git a/src/H5EAtest.c b/src/H5EAtest.c
index 0153a1e..94303c3 100644
--- a/src/H5EAtest.c
+++ b/src/H5EAtest.c
@@ -40,7 +40,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5FLprivate.h" /* Free Lists */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -210,7 +210,7 @@ H5EA__test_fill(void *nat_blk, size_t nelmts))
HDassert(nat_blk);
HDassert(nelmts);
- H5V_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts);
+ H5VM_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts);
END_FUNC(STATIC) /* end H5EA__test_fill() */
diff --git a/src/H5FA.c b/src/H5FA.c
index 75ac465..83d7dbc 100644
--- a/src/H5FA.c
+++ b/src/H5FA.c
@@ -39,11 +39,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FApkg.h" /* Fixed Arrays */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FApkg.h" /* Fixed Arrays */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -391,15 +391,15 @@ HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx
dblk_page_nelmts = dblock->dblk_page_nelmts;
/* Check if the page has been created yet */
- if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) {
+ if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) {
/* Create the data block page */
if(H5FA__dblk_page_create(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts) < 0)
H5E_THROW(H5E_CANTCREATE, "unable to create data block page")
- /* Mark data block page as initialized in data block */
- H5V_bit_set(dblock->dblk_page_init, page_idx, TRUE);
- dblock_cache_flags |= H5AC__DIRTIED_FLAG;
- } /* end if */
+ /* Mark data block page as initialized in data block */
+ H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE);
+ dblock_cache_flags |= H5AC__DIRTIED_FLAG;
+ } /* end if */
/* Protect the data block page */
if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC_WRITE)))
@@ -483,7 +483,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx);
page_idx = (size_t)(idx / dblock->dblk_page_nelmts);
/* Check if the page is defined yet */
- if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) {
+ if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) {
/* Call the class's 'fill' callback */
if((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0)
H5E_THROW(H5E_CANTSET, "can't set element to class's fill value")
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index 2f62fe0..49657ea 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -37,12 +37,12 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FApkg.h" /* Fixed Arrays */
-#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
-#include "H5WBprivate.h" /* Wrapped Buffers */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FApkg.h" /* Fixed Arrays */
+#include "H5MFprivate.h" /* File memory management */
+#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5WBprivate.h" /* Wrapped Buffers */
/****************/
diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c
index 4995007..203aeeb 100644
--- a/src/H5FAdbg.c
+++ b/src/H5FAdbg.c
@@ -37,11 +37,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FApkg.h" /* Fixed Arrays */
-#include "H5Oprivate.h" /* Object Header */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FApkg.h" /* Fixed Arrays */
+#include "H5Oprivate.h" /* Object Header */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -231,11 +231,11 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde
dblk_page_addr = dblock->addr + H5FA_DBLOCK_PREFIX_SIZE(dblock);
dblk_page_nelmts = dblock->dblk_page_nelmts;
- /* Read and print each page's elements in the data block */
- for(page_idx = 0; page_idx < dblock->npages; page_idx++) {
- if(!H5V_bit_get(dblock->dblk_page_init, page_idx)) {
- HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth,
- "Page %Zu:", page_idx, "empty");
+ /* Read and print each page's elements in the data block */
+ for(page_idx = 0; page_idx < dblock->npages; page_idx++) {
+ if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) {
+ HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth,
+ "Page %Zu:", page_idx, "empty");
} /* end if */
else { /* get the page */
diff --git a/src/H5FAtest.c b/src/H5FAtest.c
index 4e4b593..cfaebc6 100644
--- a/src/H5FAtest.c
+++ b/src/H5FAtest.c
@@ -34,11 +34,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FApkg.h" /* Fixed Arrays */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FApkg.h" /* Fixed Arrays */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
@@ -202,7 +202,7 @@ H5FA__test_fill(void *nat_blk, size_t nelmts))
HDassert(nat_blk);
HDassert(nelmts);
- H5V_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts);
+ H5VM_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts);
END_FUNC(STATIC) /* end H5FA__test_fill() */
diff --git a/src/H5FScache.c b/src/H5FScache.c
index c8caf47..7c1c642 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -33,13 +33,13 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FSpkg.h" /* File free space */
-#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
-#include "H5WBprivate.h" /* Wrapped Buffers */
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FSpkg.h" /* File free space */
+#include "H5MFprivate.h" /* File memory management */
+#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5WBprivate.h" /* Wrapped Buffers */
/****************/
/* Local Macros */
@@ -607,7 +607,7 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata
unsigned sect_cnt_size; /* The size of the section size counts */
/* Compute the size of the section counts */
- sect_cnt_size = H5V_limit_enc_size((uint64_t)udata->fspace->serial_sect_count);
+ sect_cnt_size = H5VM_limit_enc_size((uint64_t)udata->fspace->serial_sect_count);
/* Reset the section count, the "add" routine will update it */
old_tot_sect_count = udata->fspace->tot_sect_count;
@@ -856,7 +856,7 @@ H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H
/* Set up user data for iterator */
udata.sinfo = sinfo;
udata.p = &p;
- udata.sect_cnt_size = H5V_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count);
+ udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count);
/* Iterate over all the bins */
for(bin = 0; bin < sinfo->nbins; bin++) {
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index baf7403..f38cdbb 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -31,11 +31,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FSpkg.h" /* File free space */
-#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FSpkg.h" /* File free space */
+#include "H5MFprivate.h" /* File memory management */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
@@ -143,10 +143,10 @@ HDfprintf(stderr, "%s: fspace->addr = %a\n", FUNC, fspace->addr);
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Set non-zero values */
- sinfo->nbins = H5V_log2_gen(fspace->max_sect_size);
+ sinfo->nbins = H5VM_log2_gen(fspace->max_sect_size);
sinfo->sect_prefix_size = (size_t)H5FS_SINFO_PREFIX_SIZE(f);
sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8;
- sinfo->sect_len_size = H5V_limit_enc_size((uint64_t)fspace->max_sect_size);
+ sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size);
#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", FUNC, fspace->max_sect_size);
HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", FUNC, fspace->max_sect_addr);
@@ -496,7 +496,7 @@ HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_ser
HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_serialize_size", fspace->sinfo->serial_size_count);
HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS_sect_serialize_size", fspace->serial_sect_count);
#endif /* QAK */
- sect_buf_size += fspace->sinfo->serial_size_count * H5V_limit_enc_size((uint64_t)fspace->serial_sect_count);
+ sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count);
/* Size for each differently sized serializable section */
sect_buf_size += fspace->sinfo->serial_size_count * fspace->sinfo->sect_len_size;
@@ -757,7 +757,7 @@ H5FS_sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls,
HDassert(cls);
/* Determine correct bin which holds items of at least the section's size */
- bin = H5V_log2_gen(sect->size);
+ bin = H5VM_log2_gen(sect->size);
HDassert(bin < sinfo->nbins);
if(sinfo->bins[bin].bin_list == NULL)
HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?")
@@ -953,7 +953,7 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s
HDassert(sect->size);
/* Determine correct bin which holds items of the section's size */
- bin = H5V_log2_gen(sect->size);
+ bin = H5VM_log2_gen(sect->size);
HDassert(bin < sinfo->nbins);
if(sinfo->bins[bin].bin_list == NULL) {
if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL)))
@@ -1653,7 +1653,7 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node)
HDassert(node);
/* Determine correct bin which holds items of at least the section's size */
- bin = H5V_log2_gen(request);
+ bin = H5VM_log2_gen(request);
HDassert(bin < fspace->sinfo->nbins);
#ifdef QAK
HDfprintf(stderr, "%s: fspace->sinfo->nbins = %u\n", FUNC, fspace->sinfo->nbins);
@@ -2072,7 +2072,7 @@ HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost);
HDassert(fspace->sinfo->bins);
/* Determine correct bin which holds items of at least the section's size */
- bin = H5V_log2_gen(sect->size);
+ bin = H5VM_log2_gen(sect->size);
HDassert(bin < fspace->sinfo->nbins);
HDassert(fspace->sinfo->bins[bin].bin_list);
diff --git a/src/H5Faccum.c b/src/H5Faccum.c
index 949ebde..6f0e897 100644
--- a/src/H5Faccum.c
+++ b/src/H5Faccum.c
@@ -40,7 +40,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
@@ -151,7 +151,7 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
size_t new_alloc_size; /* New size of accumulator */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_alloc_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)(new_size - 1)));
+ new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(new_size - 1)));
/* Reallocate the metadata accumulator buffer */
if(NULL == (f->shared->accum.buf = H5FL_BLK_REALLOC(meta_accum, f->shared->accum.buf, new_alloc_size)))
@@ -295,7 +295,7 @@ H5F_accum_adjust(H5F_meta_accum_t *accum, H5FD_t *lf, hid_t dxpl_id,
size_t new_size; /* New size of accumulator */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)((size + accum->size) - 1)));
+ new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)((size + accum->size) - 1)));
/* Check for accumulator getting too big */
if(new_size > H5F_ACCUM_MAX_SIZE) {
@@ -611,7 +611,7 @@ H5F_accum_write(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr,
size_t new_alloc_size; /* New size of accumulator */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_alloc_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)(size - 1)));
+ new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1)));
/* Reallocate the metadata accumulator buffer */
if(NULL == (f->shared->accum.buf = H5FL_BLK_REALLOC(meta_accum, f->shared->accum.buf, new_alloc_size)))
@@ -654,7 +654,7 @@ HDmemset(f->shared->accum.buf + size, 0, (f->shared->accum.alloc_size - size));
size_t new_size; /* New size of accumulator */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)(size - 1)));
+ new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1)));
/* Grow the metadata accumulator buffer */
if(NULL == (f->shared->accum.buf = H5FL_BLK_REALLOC(meta_accum, f->shared->accum.buf, new_size)))
@@ -704,7 +704,7 @@ HDmemset(f->shared->accum.buf + clear_size, 0, (f->shared->accum.alloc_size - cl
size_t new_size; /* New size of accumulator */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_size = (size_t)1 << (1 + H5V_log2_gen((uint64_t)(size - 1)));
+ new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1)));
/* Reallocate the metadata accumulator buffer */
if(NULL == (f->shared->accum.buf = H5FL_BLK_REALLOC(meta_accum, f->shared->accum.buf, new_size)))
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 391f290..a512c2a 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -27,7 +27,7 @@
#include "H5FDpublic.h" /* File drivers */
/* Private headers needed by this file */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************************/
@@ -119,7 +119,7 @@ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t;
/* (Assumes that the high bits of the integer are zero) */
# define UINT64ENCODE_VARLEN(p, n) { \
uint64_t __n = (uint64_t)(n); \
- unsigned _s = H5V_limit_enc_size(__n); \
+ unsigned _s = H5VM_limit_enc_size(__n); \
\
*(p)++ = (uint8_t)_s; \
UINT64ENCODE_VAR(p, __n, _s); \
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index ddff0e0..030927d 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -40,7 +40,7 @@
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MFprivate.h" /* File memory management */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
#include "H5WBprivate.h" /* Wrapped Buffers */
diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c
index 5d68fd1..7d22ddd 100644
--- a/src/H5HFdbg.c
+++ b/src/H5HFdbg.c
@@ -39,7 +39,7 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
@@ -638,10 +638,10 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock,
unsigned first_row_bits; /* Number of bits used bit addresses in first row */
unsigned num_indirect_rows; /* Number of rows of blocks in each indirect block */
- first_row_bits = H5V_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) +
- H5V_log2_of2(hdr->man_dtable.cparam.width);
+ first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) +
+ H5VM_log2_of2(hdr->man_dtable.cparam.width);
for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) {
- num_indirect_rows = (H5V_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1;
+ num_indirect_rows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1;
HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows);
HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3),
temp_str);
diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c
index 1f69f02..36a0c6b 100644
--- a/src/H5HFdblock.c
+++ b/src/H5HFdblock.c
@@ -38,7 +38,7 @@
#include "H5Fprivate.h" /* File access */
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
@@ -354,7 +354,7 @@ H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request,
if(request < hdr->man_dtable.cparam.start_block_size)
min_dblock_size = hdr->man_dtable.cparam.start_block_size;
else {
- min_dblock_size = ((size_t)1) << (1 + H5V_log2_gen((uint64_t)request));
+ min_dblock_size = ((size_t)1) << (1 + H5VM_log2_gen((uint64_t)request));
HDassert(min_dblock_size <= hdr->man_dtable.cparam.max_direct_size);
} /* end else */
@@ -549,7 +549,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off,
unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting parent indirect block */
/* Compute # of rows in child indirect block */
- nrows = (H5V_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1;
+ nrows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1;
HDassert(nrows < iblock->nrows); /* child must be smaller than parent */
/* Compute indirect block's entry */
diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c
index a7d95bc..607862a 100644
--- a/src/H5HFdtable.c
+++ b/src/H5HFdtable.c
@@ -37,7 +37,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
@@ -104,10 +104,10 @@ H5HF_dtable_init(H5HF_dtable_t *dtable)
HDassert(dtable);
/* Compute/cache some values */
- dtable->start_bits = H5V_log2_of2((uint32_t)dtable->cparam.start_block_size);
- dtable->first_row_bits = dtable->start_bits + H5V_log2_of2(dtable->cparam.width);
+ dtable->start_bits = H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size);
+ dtable->first_row_bits = dtable->start_bits + H5VM_log2_of2(dtable->cparam.width);
dtable->max_root_rows = (dtable->cparam.max_index - dtable->first_row_bits) + 1;
- dtable->max_direct_bits = H5V_log2_of2((uint32_t)dtable->cparam.max_direct_size);
+ dtable->max_direct_bits = H5VM_log2_of2((uint32_t)dtable->cparam.max_direct_size);
dtable->max_direct_rows = (dtable->max_direct_bits - dtable->start_bits) + 2;
dtable->num_id_first_row = dtable->cparam.start_block_size * dtable->cparam.width;
dtable->max_dir_blk_off_size = H5HF_SIZEOF_OFFSET_LEN(dtable->cparam.max_direct_size);
@@ -171,7 +171,7 @@ HDfprintf(stderr, "%s: off = %Hu\n", "H5HF_dtable_lookup", off);
H5_ASSIGN_OVERFLOW(/* To: */ *col, /* From: */ (off / dtable->cparam.start_block_size), /* From: */ hsize_t, /* To: */ unsigned);
} /* end if */
else {
- unsigned high_bit = H5V_log2_gen(off); /* Determine the high bit in the offset */
+ unsigned high_bit = H5VM_log2_gen(off); /* Determine the high bit in the offset */
hsize_t off_mask = ((hsize_t)1) << high_bit; /* Compute mask for determining column */
#ifdef QAK
@@ -252,7 +252,7 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size)
if(block_size == dtable->cparam.start_block_size)
row = 0;
else
- row = (H5V_log2_of2((uint32_t)block_size) - H5V_log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1;
+ row = (H5VM_log2_of2((uint32_t)block_size) - H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size)) + 1;
FUNC_LEAVE_NOAPI(row)
} /* end H5HF_dtable_size_to_row() */
@@ -283,7 +283,7 @@ H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size)
*/
HDassert(dtable);
- rows = (H5V_log2_gen(size) - dtable->first_row_bits) + 1;
+ rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1;
FUNC_LEAVE_NOAPI(rows)
} /* end H5HF_dtable_size_to_rows() */
diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c
index 1ad5aa1..583029d 100644
--- a/src/H5HFhdr.c
+++ b/src/H5HFhdr.c
@@ -37,7 +37,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
@@ -46,7 +46,7 @@
#ifndef NDEBUG
/* Limit on the size of the max. direct block size */
/* (This is limited to 32-bits currently, because I think it's unlikely to
- * need to be larger, the 32-bit limit for H5V_log2_of2(n), and
+ * need to be larger, the 32-bit limit for H5VM_log2_of2(n), and
* some offsets/sizes are encoded with a maxiumum of 32-bits - QAK)
*/
#define H5HF_MAX_DIRECT_SIZE_LIMIT ((hsize_t)2 * 1024 * 1024 * 1024)
@@ -225,7 +225,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr)
/* Set the size of heap IDs */
hdr->heap_len_size = MIN(hdr->man_dtable.max_dir_blk_off_size,
- H5V_limit_enc_size((uint64_t)hdr->max_man_size));
+ H5VM_limit_enc_size((uint64_t)hdr->max_man_size));
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1090,7 +1090,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size)
unsigned child_entry; /* Entry of child indirect block */
/* Compute # of rows needed in child indirect block */
- child_rows_needed = (H5V_log2_of2((uint32_t)min_dblock_size) - H5V_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2;
+ child_rows_needed = (H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2;
HDassert(child_rows_needed > child_nrows);
child_entry = (next_row + (child_rows_needed - child_nrows)) * hdr->man_dtable.cparam.width;
if(child_entry > (iblock->nrows * hdr->man_dtable.cparam.width))
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c
index 342e228..c989bfc 100644
--- a/src/H5HFiblock.c
+++ b/src/H5HFiblock.c
@@ -38,7 +38,7 @@
#include "H5Fprivate.h" /* File access */
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MFprivate.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
@@ -409,7 +409,7 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si
nrows = hdr->man_dtable.cparam.start_root_rows;
- block_row_off = H5V_log2_of2((uint32_t)min_dblock_size) - H5V_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size);
+ block_row_off = H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size);
if(block_row_off > 0)
block_row_off++; /* Account for the pair of initial rows of the initial block size */
rows_needed = 1 + block_row_off;
@@ -730,7 +730,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id)
max_child_row = iblock->max_child / hdr->man_dtable.cparam.width;
/* Compute new # of rows in root indirect block */
- new_nrows = 1 << (1 + H5V_log2_gen((uint64_t)max_child_row));
+ new_nrows = 1 << (1 + H5VM_log2_gen((uint64_t)max_child_row));
/* Check if the indirect block is NOT currently allocated in temp. file space */
/* (temp. file space does not need to be freed) */
@@ -1662,10 +1662,10 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad
size_t u; /* Local index variable */
entry = hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width;
- first_row_bits = H5V_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) +
- H5V_log2_of2(hdr->man_dtable.cparam.width);
+ first_row_bits = H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size) +
+ H5VM_log2_of2(hdr->man_dtable.cparam.width);
num_indirect_rows =
- (H5V_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1;
+ (H5VM_log2_gen(hdr->man_dtable.row_block_size[hdr->man_dtable.max_direct_rows]) - first_row_bits) + 1;
for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++, num_indirect_rows++) {
size_t v; /* Local index variable */
diff --git a/src/H5HFiter.c b/src/H5HFiter.c
index 0f2f7a4..137d0ee 100644
--- a/src/H5HFiter.c
+++ b/src/H5HFiter.c
@@ -36,7 +36,7 @@
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5HFpkg.h" /* Fractal heaps */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
@@ -213,7 +213,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id,
/* Compute # of rows in context indirect block */
child_size = hdr->man_dtable.row_block_size[biter->curr->up->row];
- iblock_nrows = (H5V_log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1;
+ iblock_nrows = (H5VM_log2_gen(child_size) - hdr->man_dtable.first_row_bits) + 1;
} /* end else */
/* Load indirect block for this context location */
diff --git a/src/H5HFman.c b/src/H5HFman.c
index 23afb5e..58dab10 100644
--- a/src/H5HFman.c
+++ b/src/H5HFman.c
@@ -38,7 +38,7 @@
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MFprivate.h" /* File memory management */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
@@ -312,12 +312,14 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id,
/* Decode the object offset within the heap & its length */
UINT64DECODE_VAR(id, obj_off, hdr->heap_off_size);
UINT64DECODE_VAR(id, obj_len, hdr->heap_len_size);
- HDassert(obj_off > 0);
- HDassert(obj_len > 0);
/* Check for bad offset or length */
+ if(obj_off == 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "invalid fractal heap offset")
if(obj_off > hdr->man_size)
HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object offset too large")
+ if(obj_len == 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "invalid fractal heap object size")
if(obj_len > hdr->man_dtable.cparam.max_direct_size)
HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object size too large for direct block")
if(obj_len > hdr->max_man_size)
diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h
index 99571f5..64d6fde 100644
--- a/src/H5HFpkg.h
+++ b/src/H5HFpkg.h
@@ -136,7 +136,7 @@
/* Compute the # of bytes required to store an offset into a given buffer size */
#define H5HF_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8)
-#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5V_log2_of2((unsigned)(l)))
+#define H5HF_SIZEOF_OFFSET_LEN(l) H5HF_SIZEOF_OFFSET_BITS(H5VM_log2_of2((unsigned)(l)))
/* Heap ID bit flags */
/* Heap ID version (2 bits: 6-7) */
diff --git a/src/H5HFsection.c b/src/H5HFsection.c
index 34f47aa..72bb60a 100644
--- a/src/H5HFsection.c
+++ b/src/H5HFsection.c
@@ -34,7 +34,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5HFpkg.h" /* Fractal heaps */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
/* Local Macros */
diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c
index 74044cb..16d8c49 100644
--- a/src/H5HGdbg.c
+++ b/src/H5HGdbg.c
@@ -91,9 +91,8 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
unsigned u, nused, maxobj;
unsigned j, k;
H5HG_heap_t *h = NULL;
- char buf[64];
uint8_t *p = NULL;
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -107,66 +106,69 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
if(NULL == (h = H5HG_protect(f, dxpl_id, addr, H5AC_READ)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap collection");
- fprintf(stream, "%*sGlobal Heap Collection...\n", indent, "");
- fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth,
+ HDfprintf(stream, "%*sGlobal Heap Collection...\n", indent, "");
+ HDfprintf(stream, "%*s%-*s %d\n", indent, "", fwidth,
"Dirty:",
(int)(h->cache_info.is_dirty));
- fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
"Total collection size in file:",
(unsigned long)(h->size));
- for (u=1, nused=0, maxobj=0; u<h->nused; u++) {
- if (h->obj[u].begin) {
+ for(u = 1, nused = 0, maxobj = 0; u < h->nused; u++)
+ if(h->obj[u].begin) {
nused++;
- if (u>maxobj) maxobj = u;
+ if (u>maxobj)
+ maxobj = u;
}
- }
- fprintf (stream, "%*s%-*s %u/%lu/", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %u/%lu/", indent, "", fwidth,
"Objects defined/allocated/max:",
- nused, (unsigned long)h->nalloc);
+ nused,
+ (unsigned long)h->nalloc);
if(nused)
- fprintf(stream, "%u\n", maxobj);
+ HDfprintf(stream, "%u\n", maxobj);
else
- fprintf(stream, "NA\n");
+ HDfprintf(stream, "NA\n");
- fprintf (stream, "%*s%-*s %lu\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
"Free space:",
(unsigned long)(h->obj[0].size));
- for (u=1; u<h->nused; u++) {
- if (h->obj[u].begin) {
- sprintf (buf, "Object %u", u);
- fprintf (stream, "%*s%s\n", indent, "", buf);
- fprintf (stream, "%*s%-*s %lu\n", indent+3, "", MIN(fwidth-3, 0),
+ for(u = 1; u < h->nused; u++)
+ if(h->obj[u].begin) {
+ char buf[64];
+
+ HDsnprintf(buf, sizeof(buf), "Object %u", u);
+ HDfprintf(stream, "%*s%s\n", indent, "", buf);
+ HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MIN(fwidth - 3, 0),
"Obffset in block:",
(unsigned long)(h->obj[u].begin - h->chunk));
- fprintf (stream, "%*s%-*s %d\n", indent+3, "", MIN(fwidth-3, 0),
+ HDfprintf(stream, "%*s%-*s %d\n", indent + 3, "", MIN(fwidth - 3, 0),
"Reference count:",
h->obj[u].nrefs);
- fprintf (stream, "%*s%-*s %lu/%lu\n", indent+3, "",
- MIN(fwidth-3, 0),
+ HDfprintf(stream, "%*s%-*s %lu/%lu\n", indent + 3, "",
+ MIN(fwidth - 3, 0),
"Size of object body:",
(unsigned long)(h->obj[u].size),
(unsigned long)H5HG_ALIGN(h->obj[u].size));
- p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR (f);
- for (j=0; j<h->obj[u].size; j+=16) {
- fprintf (stream, "%*s%04u: ", indent+6, "", j);
- for (k=0; k<16; k++) {
- if (8==k) fprintf (stream, " ");
- if (j+k<h->obj[u].size) {
- fprintf (stream, "%02x ", p[j+k]);
- } else {
+ p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR(f);
+ for(j = 0; j < h->obj[u].size; j += 16) {
+ HDfprintf(stream, "%*s%04u: ", indent + 6, "", j);
+ for(k = 0; k < 16; k++) {
+ if(8 == k)
+ HDfprintf(stream, " ");
+ if(j + k < h->obj[u].size)
+ HDfprintf(stream, "%02x ", p[j + k]);
+ else
HDfputs(" ", stream);
- }
}
- for (k=0; k<16 && j+k<h->obj[u].size; k++) {
- if (8==k) fprintf (stream, " ");
- HDfputc(p[j+k]>' ' && p[j+k]<='~' ? p[j+k] : '.', stream);
+ for(k = 0; k < 16 && j + k < h->obj[u].size; k++) {
+ if(8 == k)
+ HDfprintf(stream, " ");
+ HDfputc(p[j + k]>' ' && p[j + k] <= '~' ? p[j + k] : '.', stream);
}
- fprintf (stream, "\n");
+ HDfprintf(stream, "\n");
}
}
- }
done:
if (h && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, addr, h, H5AC__NO_FLAGS_SET) < 0)
diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c
index bee9196..e481b20 100644
--- a/src/H5HLdbg.c
+++ b/src/H5HLdbg.c
@@ -43,11 +43,12 @@ BEGIN_FUNC(PRIV, ERR,
herr_t, SUCCEED, FAIL,
H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth))
- H5HL_t *h = NULL;
- int i, overlap, free_block;
- H5HL_free_t *freelist = NULL;
- uint8_t *marker = NULL;
- size_t amount_free = 0;
+ H5HL_t *h = NULL;
+ int free_block;
+ H5HL_free_t *freelist;
+ uint8_t *marker = NULL;
+ size_t amount_free = 0;
+ herr_t ret_value = SUCCEED; /* Return value */
/* check arguments */
HDassert(f);
@@ -61,14 +62,14 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int
HDfprintf(stream, "%*sLocal Heap...\n", indent, "");
HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
- "Header size (in bytes):",
- (unsigned long)h->prfx_size);
+ "Header size (in bytes):",
+ (unsigned long)h->prfx_size);
HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth,
- "Address of heap data:",
- h->dblk_addr);
+ "Address of heap data:",
+ h->dblk_addr);
HDfprintf(stream, "%*s%-*s %Zu\n", indent, "", fwidth,
- "Data bytes allocated for heap:",
- h->dblk_size);
+ "Data bytes allocated for heap:",
+ h->dblk_size);
/*
* Traverse the free list and check that all free blocks fall within
@@ -78,30 +79,35 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int
H5E_THROW(H5E_CANTALLOC, "memory allocation failed");
HDfprintf(stream, "%*sFree Blocks (offset, size):\n", indent, "");
-
for(free_block = 0, freelist = h->freelist; freelist; freelist = freelist->next, free_block++) {
char temp_str[32];
- sprintf(temp_str,"Block #%d:",free_block);
- HDfprintf(stream, "%*s%-*s %8Zu, %8Zu\n", indent+3, "", MAX(0,fwidth-9),
- temp_str, freelist->offset, freelist->size);
- if((freelist->offset + freelist->size) > h->dblk_size)
- HDfprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n");
- else {
- for(i = overlap = 0; i < (int)(freelist->size); i++) {
- if(marker[freelist->offset + i])
- overlap++;
- marker[freelist->offset + i] = 1;
- } /* end for */
- if(overlap)
- HDfprintf(stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n");
- else
- amount_free += freelist->size;
- } /* end else */
+
+ HDsnprintf(temp_str, sizeof(temp_str), "Block #%d:", free_block);
+ HDfprintf(stream, "%*s%-*s %8Zu, %8Zu\n", indent+3, "", MAX(0,fwidth-9),
+ temp_str,
+ freelist->offset, freelist->size);
+ if((freelist->offset + freelist->size) > h->dblk_size)
+ HDfprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n");
+ else {
+ int overlap = 0;
+ size_t i;
+
+ for(i = 0; i < freelist->size; i++) {
+ if(marker[freelist->offset + i])
+ overlap++;
+ marker[freelist->offset + i] = 1;
+ } /* end for */
+ if(overlap)
+ HDfprintf(stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n");
+ else
+ amount_free += freelist->size;
+ } /* end for */
} /* end for */
if(h->dblk_size)
- HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of heap used:",
- (100.0 * (double)(h->dblk_size - amount_free) / (double)h->dblk_size));
+ HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth,
+ "Percent of heap used:",
+ ((double)100.0f * (double)(h->dblk_size - amount_free) / (double)h->dblk_size));
/*
* Print the data in a VMS-style octal dump.
diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c
index 2f42bf1..5ce48d7 100644
--- a/src/H5Lexternal.c
+++ b/src/H5Lexternal.c
@@ -208,6 +208,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group,
char *parent_group_name = NULL;/* Temporary pointer to group name */
char local_group_name[H5L_EXT_TRAVERSE_BUF_SIZE]; /* Local buffer to hold group name */
char *temp_file_name = NULL; /* Temporary pointer to file name */
+ size_t temp_file_name_len; /* Length of temporary file name */
char *actual_file_name = NULL; /* Parent file's actual name */
H5P_genplist_t *fa_plist; /* File access property list pointer */
H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */
@@ -312,6 +313,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group,
/* Copy the file name to use */
if(NULL == (temp_file_name = H5MM_strdup(file_name)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ temp_file_name_len = HDstrlen(temp_file_name);
/* target file_name is an absolute pathname: see RM for detailed description */
if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) {
@@ -329,7 +331,8 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group,
ptr++;
/* Copy into the temp. file name */
- HDstrncpy(temp_file_name, ptr, HDstrlen(ptr) + 1);
+ HDstrncpy(temp_file_name, ptr, temp_file_name_len);
+ temp_file_name[temp_file_name_len - 1] = '\0';
} /* end if */
} /* end if */
else if(H5_CHECK_ABS_DRIVE(file_name)) {
@@ -339,7 +342,8 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group,
H5E_clear_stack(NULL);
/* strip "<drive-letter>:" */
- HDstrncpy(temp_file_name, &file_name[2], (HDstrlen(file_name) - 2) + 1);
+ HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len);
+ temp_file_name[temp_file_name_len - 1] = '\0';
} /* end if */
} /* end if */
@@ -579,9 +583,9 @@ H5Lcreate_external(const char *file_name, const char *obj_name,
/* Encode the external link information */
p = (uint8_t *)ext_link_buf;
*p++ = (H5L_EXT_VERSION << 4) | H5L_EXT_FLAGS_ALL; /* External link version & flags */
- HDstrncpy((char *)p, file_name, file_name_len); /* Name of file containing external link's object */
+ HDstrncpy((char *)p, file_name, buf_size - 1); /* Name of file containing external link's object */
p += file_name_len;
- HDstrncpy((char *)p, norm_obj_name, norm_obj_name_len); /* External link's object */
+ HDstrncpy((char *)p, norm_obj_name, buf_size - (file_name_len + 1)); /* External link's object */
/* Create an external link */
if(H5L_create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id, lapl_id, H5AC_dxpl_id) < 0)
diff --git a/src/H5MF.c b/src/H5MF.c
index 4b0668f..956ec18 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -39,7 +39,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
#include "H5MFpkg.h" /* File memory management */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
@@ -301,7 +301,7 @@ H5MF_alloc_create(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type)
fs_create.client = H5FS_CLIENT_FILE_ID;
fs_create.shrink_percent = H5MF_FSPACE_SHRINK;
fs_create.expand_percent = H5MF_FSPACE_EXPAND;
- fs_create.max_sect_addr = 1 + H5V_log2_gen((uint64_t)f->shared->maxaddr);
+ fs_create.max_sect_addr = 1 + H5VM_log2_gen((uint64_t)f->shared->maxaddr);
fs_create.max_sect_size = f->shared->maxaddr;
if(NULL == (f->shared->fs_man[type] = H5FS_create(f, dxpl_id, NULL,
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index b8e6b32..2269bd3 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -793,7 +793,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in
{
const H5A_t *mesg = (const H5A_t *)_mesg;
const char *s; /* Temporary string pointer */
- char buf[256]; /* Temporary string buffer */
+ char buf[128]; /* Temporary string buffer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -804,7 +804,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in
HDassert(indent >= 0);
HDassert(fwidth >= 0);
- fprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth,
"Name:",
mesg->shared->name);
switch(mesg->shared->encoding) {
@@ -830,17 +830,17 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in
case H5T_CSET_RESERVED_13:
case H5T_CSET_RESERVED_14:
case H5T_CSET_RESERVED_15:
- sprintf(buf, "H5T_CSET_RESERVED_%d", (int)(mesg->shared->encoding));
+ HDsnprintf(buf, sizeof(buf), "H5T_CSET_RESERVED_%d", (int)(mesg->shared->encoding));
s = buf;
break;
case H5T_CSET_ERROR:
default:
- sprintf(buf, "Unknown character set: %d", (int)(mesg->shared->encoding));
+ HDsnprintf(buf, sizeof(buf), "Unknown character set: %d", (int)(mesg->shared->encoding));
s = buf;
break;
} /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Character Set of Name:",
s);
HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth,
@@ -856,18 +856,18 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in
"Creation Index:",
(unsigned)mesg->shared->crt_idx);
- fprintf(stream, "%*sDatatype...\n", indent, "");
- fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0,fwidth-3),
+ HDfprintf(stream, "%*sDatatype...\n", indent, "");
+ HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0,fwidth - 3),
"Encoded Size:",
(unsigned long)(mesg->shared->dt_size));
if((H5O_MSG_DTYPE->debug)(f, dxpl_id, mesg->shared->dt, stream, indent + 3, MAX(0, fwidth - 3)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display datatype message info")
- fprintf(stream, "%*sDataspace...\n", indent, "");
- fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0, fwidth - 3),
+ HDfprintf(stream, "%*sDataspace...\n", indent, "");
+ HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0, fwidth - 3),
"Encoded Size:",
(unsigned long)(mesg->shared->ds_size));
- if(H5S_debug(f, dxpl_id, mesg->shared->ds, stream, indent+3, MAX(0, fwidth - 3)) < 0)
+ if(H5S_debug(f, dxpl_id, mesg->shared->ds, stream, indent + 3, MAX(0, fwidth - 3)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display dataspace message info")
done:
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index b482115..cb6bf98 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -25,7 +25,7 @@
#include "H5MMprivate.h" /* Memory management */
#include "H5Opkg.h" /* Object headers */
#include "H5Tpkg.h" /* Datatypes */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* PRIVATE PROTOTYPES */
@@ -266,7 +266,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
unsigned j;
/* Compute the # of bytes required to store a member offset */
- offset_nbytes = H5V_limit_enc_size((uint64_t)dt->shared->size);
+ offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size);
/*
* Compound datatypes...
@@ -891,7 +891,7 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt)
unsigned offset_nbytes; /* Size needed to encode member offsets */
/* Compute the # of bytes required to store a member offset */
- offset_nbytes = H5V_limit_enc_size((uint64_t)dt->shared->size);
+ offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size);
/*
* Compound datatypes...
@@ -1262,7 +1262,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg)
unsigned offset_nbytes; /* Size needed to encode member offsets */
/* Compute the # of bytes required to store a member offset */
- offset_nbytes = H5V_limit_enc_size((uint64_t)dt->shared->size);
+ offset_nbytes = H5VM_limit_enc_size((uint64_t)dt->shared->size);
/* Compute the total size needed to encode compound datatype */
for(u = 0; u < dt->shared->u.compnd.nmembs; u++) {
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index df1f07a..97efb5c 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -545,7 +545,6 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s
int indent, int fwidth)
{
const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg;
- char buf[64];
size_t u;
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -565,8 +564,10 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s
mesg->nused, mesg->nalloc);
for(u = 0; u < mesg->nused; u++) {
- sprintf (buf, "File %u", (unsigned)u);
- HDfprintf (stream, "%*s%s:\n", indent, "", buf);
+ char buf[64];
+
+ HDsnprintf(buf, sizeof(buf), "File %u", (unsigned)u);
+ HDfprintf(stream, "%*s%s:\n", indent, "", buf);
HDfprintf(stream, "%*s%-*s \"%s\"\n", indent+3, "", MAX (fwidth-3, 0),
"Name:",
@@ -576,11 +577,11 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s
"Name offset:",
(unsigned long)(mesg->slot[u].name_offset));
- HDfprintf (stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0),
+ HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0),
"Offset of data in file:",
(unsigned long)(mesg->slot[u].offset));
- HDfprintf (stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0),
+ HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0),
"Bytes reserved for data:",
(unsigned long)(mesg->slot[u].size));
} /* end for */
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 2bf34b0..72c0cf8 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -42,7 +42,7 @@
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Ppkg.h" /* Property lists */
-#include "H5Vprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
#include "H5Tprivate.h" /* Datatypes */
#include "H5Zpkg.h" /* Data filters */
@@ -669,7 +669,7 @@ H5P__fill_value_enc(const void *value, void **_pp, size_t *size)
/* Encode the size of a size_t */
enc_value = (uint64_t)dt_size;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
/* Encode the size */
@@ -698,7 +698,7 @@ H5P__fill_value_enc(const void *value, void **_pp, size_t *size)
if(H5T_encode(fill->type, NULL, &dt_size) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype")
enc_value = (uint64_t)dt_size;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
}
*size += (1 + enc_size);
*size += dt_size;
@@ -874,7 +874,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size)
if(NULL != *pp) {
/* Encode number of slots used */
enc_value = (uint64_t)efl->nused;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -884,7 +884,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size)
/* Calculate length of slot name and encode it */
len = HDstrlen(efl->slot[u].name) + 1;
enc_value = (uint64_t)len;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -895,14 +895,14 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size)
/* Encode offset */
enc_value = (uint64_t)efl->slot[u].offset;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
/* encode size */
enc_value = (uint64_t)efl->slot[u].size;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -910,13 +910,13 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size)
} /* end if */
/* Calculate size needed for encoding */
- *size += (1 + H5V_limit_enc_size((uint64_t)efl->nused));
+ *size += (1 + H5VM_limit_enc_size((uint64_t)efl->nused));
for(u = 0; u < efl->nused; u++) {
len = HDstrlen(efl->slot[u].name) + 1;
- *size += (1 + H5V_limit_enc_size((uint64_t)len));
+ *size += (1 + H5VM_limit_enc_size((uint64_t)len));
*size += len;
- *size += (1 + H5V_limit_enc_size((uint64_t)efl->slot[u].offset));
- *size += (1 + H5V_limit_enc_size((uint64_t)efl->slot[u].size));
+ *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].offset));
+ *size += (1 + H5VM_limit_enc_size((uint64_t)efl->slot[u].size));
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
@@ -1389,7 +1389,7 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/])
chunk_layout.u.chunk.dim[u] = (uint32_t)dim[u]; /* Store user's chunk dimensions */
/* Get encoded size of dim, in bytes */
- enc_bytes_per_dim = (H5V_log2_gen(dim[u]) + 8) / 8;
+ enc_bytes_per_dim = (H5VM_log2_gen(dim[u]) + 8) / 8;
/* Check if this is the largest value so far */
if(enc_bytes_per_dim > max_enc_bytes_per_dim)
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 4754aa5..ae057f7 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -165,7 +165,7 @@
#define H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_DEF 0
#define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_SIZE sizeof(hsize_t *)
#define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF NULL
-#define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_SIZE sizeof(size_t)
+#define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_SIZE sizeof(uint32_t)
#define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF 0
/******************/
@@ -266,7 +266,7 @@ static const void *H5D_def_xfer_xform_g = H5D_XFER_XFORM_DEF; /* Defaul
static const hbool_t H5D_def_direct_chunk_flag_g = H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_DEF; /* Default value for the flag of direct chunk write */
static const uint32_t H5D_def_direct_chunk_filters_g = H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_DEF; /* Default value for the filters of direct chunk write */
static const hsize_t *H5D_def_direct_chunk_offset_g = H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF; /* Default value for the offset of direct chunk write */
-static const size_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF; /* Default value for the datasize of direct chunk write */
+static const uint32_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF; /* Default value for the datasize of direct chunk write */
/*-------------------------------------------------------------------------
@@ -679,7 +679,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size)
/* encode the length of the prefix */
enc_value = (uint64_t)len;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -696,7 +696,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size)
} /* end if */
/* Size of encoded data transform */
- *size += (1 + H5V_limit_enc_size((uint64_t)len));
+ *size += (1 + H5VM_limit_enc_size((uint64_t)len));
if(NULL != pexp)
*size += len;
@@ -1491,8 +1491,9 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle,
H5TRACE4("e", "iddd", plist_id, left, middle, right);
/* Check arguments */
- if(left < 0.0 || left > 1.0 || middle < 0.0 || middle > 1.0 ||
- right < 0.0 || right > 1.0)
+ if(left < (double)0.0f || left > (double)1.0f
+ || middle < (double)0.0f || middle > (double)1.0f
+ || right < (double)0.0f || right > (double)1.0f)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0")
/* Get the plist structure */
diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c
index ff148b0..0c70c6c 100644
--- a/src/H5Pencdec.c
+++ b/src/H5Pencdec.c
@@ -118,7 +118,7 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size)
{
uint64_t enc_value = (uint64_t)*(const size_t *)value; /* Property value to encode */
uint8_t **pp = (uint8_t **)_pp;
- unsigned enc_size = H5V_limit_enc_size(enc_value); /* Size of encoded property */
+ unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */
FUNC_ENTER_PACKAGE_NOERR
@@ -159,7 +159,7 @@ herr_t
H5P__encode_hsize_t(const void *value, void **_pp, size_t *size)
{
uint64_t enc_value = (uint64_t)*(const hsize_t *)value; /* Property value to encode */
- unsigned enc_size = H5V_limit_enc_size(enc_value); /* Size of encoded property */
+ unsigned enc_size = H5VM_limit_enc_size(enc_value); /* Size of encoded property */
uint8_t **pp = (uint8_t **)_pp;
FUNC_ENTER_PACKAGE_NOERR
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 6955a60..a4c09e5 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -2606,7 +2606,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
H5_ENCODE_UNSIGNED(*pp, config->set_initial_size);
enc_value = (uint64_t)config->initial_size;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -2614,13 +2614,13 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
H5_ENCODE_DOUBLE(*pp, config->min_clean_fraction);
enc_value = (uint64_t)config->max_size;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
enc_value = (uint64_t)config->min_size;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -2638,7 +2638,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
H5_ENCODE_UNSIGNED(*pp, config->apply_max_increment);
enc_value = (uint64_t)config->max_increment;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -2660,7 +2660,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
H5_ENCODE_UNSIGNED(*pp, config->apply_max_decrement);
enc_value = (uint64_t)config->max_decrement;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -2681,15 +2681,15 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size)
/* Compute encoded size of variably-encoded values */
enc_value = (uint64_t)config->initial_size;
- *size += 1 + H5V_limit_enc_size(enc_value);
+ *size += 1 + H5VM_limit_enc_size(enc_value);
enc_value = (uint64_t)config->max_size;
- *size += 1 + H5V_limit_enc_size(enc_value);
+ *size += 1 + H5VM_limit_enc_size(enc_value);
enc_value = (uint64_t)config->min_size;
- *size += 1 + H5V_limit_enc_size(enc_value);
+ *size += 1 + H5VM_limit_enc_size(enc_value);
enc_value = (uint64_t)config->max_increment;
- *size += 1 + H5V_limit_enc_size(enc_value);
+ *size += 1 + H5VM_limit_enc_size(enc_value);
enc_value = (uint64_t)config->max_decrement;
- *size += 1 + H5V_limit_enc_size(enc_value);
+ *size += 1 + H5VM_limit_enc_size(enc_value);
/* Compute encoded size of fixed-size values */
*size += (5 + (sizeof(unsigned) * 8) + (sizeof(double) * 8) +
diff --git a/src/H5Plapl.c b/src/H5Plapl.c
index aa02546..676b574 100644
--- a/src/H5Plapl.c
+++ b/src/H5Plapl.c
@@ -514,7 +514,7 @@ H5P_lacc_elink_pref_enc(const void *value, void **_pp, size_t *size)
len = HDstrlen(elink_pref);
enc_value = (uint64_t)len;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
if(NULL != *pp) {
diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c
index 32f6a1b..df4ebb6 100644
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -1495,7 +1495,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size)
/* encode nused value */
enc_value = (uint64_t)pline->nused;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -1525,7 +1525,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size)
/* encode cd_nelmts */
enc_value = (uint64_t)pline->filter[u].cd_nelmts;
- enc_size = H5V_limit_enc_size(enc_value);
+ enc_size = H5VM_limit_enc_size(enc_value);
HDassert(enc_size < 256);
*(*pp)++ = (uint8_t)enc_size;
UINT64ENCODE_VAR(*pp, enc_value, enc_size);
@@ -1538,12 +1538,12 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size)
/* calculate size required for encoding */
*size += 1;
- *size += (1 + H5V_limit_enc_size((uint64_t)pline->nused));
+ *size += (1 + H5VM_limit_enc_size((uint64_t)pline->nused));
for(u = 0; u < pline->nused; u++) {
*size += (sizeof(int32_t) + sizeof(unsigned) + 1);
if(NULL != pline->filter[u].name)
*size += H5Z_COMMON_NAME_LEN;
- *size += (1 + H5V_limit_enc_size((uint64_t)pline->filter[u].cd_nelmts));
+ *size += (1 + H5VM_limit_enc_size((uint64_t)pline->filter[u].cd_nelmts));
*size += pline->filter[u].cd_nelmts * sizeof(unsigned);
} /* end for */
diff --git a/src/H5Sall.c b/src/H5Sall.c
index 19d1efc..24caad2 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -27,7 +27,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* ID Functions */
#include "H5Spkg.h" /* Dataspace functions */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/* Static function prototypes */
@@ -162,7 +162,7 @@ H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
HDassert (coords);
/* Calculate the coordinates for the current iterator offset */
- if(H5V_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0)
+ if(H5VM_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve coordinates");
done:
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index f8d87e4..c97c9b6 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -28,7 +28,7 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* ID Functions */
#include "H5Spkg.h" /* Dataspace functions */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/* Local datatypes */
@@ -464,7 +464,7 @@ H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
HDassert(v >= 0);
/* Compute the coords for the flattened dimensions */
- H5V_array_calc(iter->u.hyp.off[v], (unsigned)((begin - u) + 1), &(iter->dims[u]), &(coords[u]));
+ H5VM_array_calc(iter->u.hyp.off[v], (unsigned)((begin - u) + 1), &(iter->dims[u]), &(coords[u]));
/* Continue to faster dimension in both indices */
u--;
@@ -4102,7 +4102,7 @@ H5S_hyper_project_scalar(const H5S_t *space, hsize_t *offset)
} /* end else */
/* Calculate offset of selection in projected buffer */
- *offset = H5V_array_offset(space->extent.rank, space->extent.size, block);
+ *offset = H5VM_array_offset(space->extent.rank, space->extent.size, block);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -4294,7 +4294,7 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off
HDmemset(block, 0, sizeof(block));
for(u = 0; u < (base_space->extent.rank - new_space->extent.rank); u++)
block[u] = opt_diminfo[u].start;
- *offset = H5V_array_offset(base_space->extent.rank, base_space->extent.size, block);
+ *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block);
/* Set the correct dimensions for the base & new spaces */
base_space_dim = base_space->extent.rank - new_space->extent.rank;
@@ -4377,7 +4377,7 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off
} /* end while */
/* Compute the offset for the down-projection */
- *offset = H5V_array_offset(base_space->extent.rank, base_space->extent.size, block);
+ *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block);
/* Project the base space's selection down in less dimensions */
if(H5S_hyper_project_simple_lower(base_space, new_space) < 0)
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 868a00f..284e16f 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -35,7 +35,7 @@
#include "H5Oprivate.h" /* Object headers */
#include "H5Pprivate.h" /* Property lists */
#include "H5Spkg.h" /* Dataspaces */
-#include "H5Vprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
#ifdef H5_HAVE_PARALLEL
@@ -43,6 +43,14 @@ static herr_t H5S_mpio_all_type(const H5S_t *space, size_t elmt_size,
MPI_Datatype *new_type, int *count, hbool_t *is_derived_type);
static herr_t H5S_mpio_none_type(MPI_Datatype *new_type, int *count,
hbool_t *is_derived_type);
+static herr_t H5S_mpio_create_point_datatype(size_t elmt_size, hsize_t num_points,
+ MPI_Aint *disp, MPI_Datatype *new_type);
+static herr_t H5S_mpio_point_type(const H5S_t *space, size_t elmt_size,
+ MPI_Datatype *new_type, int *count, hbool_t *is_derived_type,
+ hbool_t do_permute, hsize_t **permute_map, hbool_t *is_permuted);
+static herr_t H5S_mpio_permute_type(const H5S_t *space, size_t elmt_size,
+ hsize_t **permute_map, MPI_Datatype *new_type, int *count,
+ hbool_t *is_derived_type);
static herr_t H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size,
MPI_Datatype *new_type, int *count, hbool_t *is_derived_type);
static herr_t H5S_mpio_span_hyper_type(const H5S_t *space, size_t elmt_size,
@@ -131,6 +139,335 @@ H5S_mpio_none_type(MPI_Datatype *new_type, int *count, hbool_t *is_derived_type)
/*-------------------------------------------------------------------------
+ * Function: H5S_mpio_create_point_datatype
+ *
+ * Purpose: Create a derived datatype for point selections.
+ *
+ * Return: non-negative on success, negative on failure.
+ *
+ * Outputs: *new_type the MPI type corresponding to the selection
+ *
+ * Programmer: Mohamad Chaarawi
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5S_mpio_create_point_datatype (size_t elmt_size, hsize_t num_points,
+ MPI_Aint *disp, MPI_Datatype *new_type)
+{
+ MPI_Datatype elmt_type; /* MPI datatype for individual element */
+ hbool_t elmt_type_created = FALSE; /* Whether the element MPI datatype was created */
+ int mpi_code; /* MPI error code */
+ int *blocks = NULL; /* Array of block sizes for MPI hindexed create call */
+ hsize_t u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* Create an MPI datatype for an element */
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &elmt_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code)
+ elmt_type_created = TRUE;
+
+ /* Allocate block sizes for MPI datatype call */
+ if(NULL == (blocks = (int *)H5MM_malloc(sizeof(int) * num_points)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks")
+
+ /* Would be nice to have Create_Hindexed_block to avoid this array of all ones */
+ for(u = 0; u < num_points; u++)
+ blocks[u] = 1;
+
+ /* Create an MPI datatype for the whole point selection */
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)num_points, blocks, disp, elmt_type, new_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code)
+
+ /* Commit MPI datatype for later use */
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
+
+done:
+ if(elmt_type_created)
+ MPI_Type_free(&elmt_type);
+ if(blocks)
+ H5MM_free(blocks);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5S_mpio_create_point_datatype() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5S_mpio_point_type
+ *
+ * Purpose: Translate an HDF5 "point" selection into an MPI type.
+ * Create a permutation array to handle out-of-order point selections.
+ *
+ * Return: non-negative on success, negative on failure.
+ *
+ * Outputs: *new_type the MPI type corresponding to the selection
+ * *count how many objects of the new_type in selection
+ * (useful if this is the buffer type for xfer)
+ * *is_derived_type 0 if MPI primitive type, 1 if derived
+ * *permute_map the permutation of the displacements to create
+ * the MPI_Datatype
+ * *is_permuted 0 if the displacements are permuted, 1 if not
+ *
+ * Programmer: Mohamad Chaarawi
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5S_mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type,
+ int *count, hbool_t *is_derived_type, hbool_t do_permute, hsize_t **permute,
+ hbool_t *is_permuted)
+{
+ MPI_Aint *disp = NULL; /* Datatype displacement for each point*/
+ H5S_pnt_node_t *curr = NULL; /* Current point being operated on in from the selection */
+ hssize_t snum_points; /* Signed number of elements in selection */
+ hsize_t num_points; /* Sumber of points in the selection */
+ hsize_t u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* Check args */
+ HDassert(space);
+
+ /* Get the total number of points selected */
+ if((snum_points = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't get number of elements selected")
+ num_points = (hsize_t)snum_points;
+
+ /* Allocate array for element displacements */
+ if(NULL == (disp = (MPI_Aint *)H5MM_malloc(sizeof(MPI_Aint) * num_points)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of displacements")
+
+ /* Allocate array for element permutation - returned to caller */
+ if(do_permute)
+ if(NULL == (*permute = (hsize_t *)H5MM_malloc(sizeof(hsize_t) * num_points)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate permutation array")
+
+ /* Iterate through list of elements */
+ curr = space->select.sel_info.pnt_lst->head;
+ for(u = 0 ; u < num_points ; u++) {
+ /* calculate the displacement of the current point */
+ disp[u] = H5VM_array_offset(space->extent.rank, space->extent.size, curr->pnt);
+ disp[u] *= elmt_size;
+
+ /* This is a File Space used to set the file view, so adjust the displacements
+ * to have them monotonically non-decreasing.
+ * Generate the permutation array by indicating at each point being selected,
+ * the position it will shifted in the new displacement. Example:
+ * Suppose 4 points with corresponding are selected
+ * Pt 1: disp=6 ; Pt 2: disp=3 ; Pt 3: disp=0 ; Pt 4: disp=4
+ * The permute map to sort the displacements in order will be:
+ * point 1: map[0] = L, indicating that this point is not moved (1st point selected)
+ * point 2: map[1] = 0, indicating that this point is moved to the first position,
+ * since disp_pt1(6) > disp_pt2(3)
+ * point 3: map[2] = 0, move to position 0, bec it has the lowest disp between
+ * the points selected so far.
+ * point 4: map[3] = 2, move the 2nd position since point 1 has a higher disp,
+ * but points 2 and 3 have lower displacements.
+ */
+ if(do_permute) {
+ if(u > 0 && disp[u] < disp[u - 1]) {
+ unsigned s = 0, l = u, m = u / 2;
+
+ *is_permuted = TRUE;
+ do {
+ if(disp[u] > disp[m])
+ s = m + 1;
+ else if(disp[u] < disp[m])
+ l = m;
+ else
+ break;
+ m = s + ((l - s) / 2);
+ } while(s < l);
+
+ if(m < u) {
+ MPI_Aint temp;
+
+ temp = disp[u];
+ HDmemmove(disp + m + 1, disp + m, (u - m) * sizeof(MPI_Aint));
+ disp[m] = temp;
+ } /* end if */
+ (*permute)[u] = m;
+ } /* end if */
+ else
+ (*permute)[u] = num_points;
+ } /* end if */
+ /* this is a memory space, and no permutation is necessary to create
+ the derived datatype */
+ else {
+ ;/* do nothing */
+ } /* end else */
+
+ /* get the next point */
+ curr = curr->next;
+ } /* end for */
+
+ /* Create the MPI datatype for the set of element displacements */
+ if(H5S_mpio_create_point_datatype(elmt_size, num_points, disp, new_type) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create an MPI Datatype from point selection")
+
+ /* Set values about MPI datatype created */
+ *count = 1;
+ *is_derived_type = TRUE;
+
+done:
+ if(NULL != disp)
+ H5MM_free(disp);
+
+ /* Release the permutation buffer, if it wasn't used */
+ if(!(*is_permuted) && (*permute)) {
+ H5MM_free(*permute);
+ *permute = NULL;
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5S_mpio_point_type() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5S_mpio_permute_type
+ *
+ * Purpose: Translate an HDF5 "all/hyper/point" selection into an MPI type,
+ * while applying the permutation map. This function is called if
+ * the file space selection is permuted due to out-of-order point
+ * selection and so the memory datatype has to be permuted using the
+ * permutation map created by the file selection.
+ *
+ * Note: This routine is called from H5S_mpio_space_type(), which is
+ * called first for the file dataspace and creates
+ *
+ * Return: non-negative on success, negative on failure.
+ *
+ * Outputs: *new_type the MPI type corresponding to the selection
+ * *count how many objects of the new_type in selection
+ * (useful if this is the buffer type for xfer)
+ * *is_derived_type 0 if MPI primitive type, 1 if derived
+ *
+ * Programmer: Mohamad Chaarawi
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5S_mpio_permute_type(const H5S_t *space, size_t elmt_size, hsize_t **permute,
+ MPI_Datatype *new_type, int *count, hbool_t *is_derived_type)
+{
+ MPI_Aint *disp = NULL; /* Datatype displacement for each point*/
+ H5S_sel_iter_t sel_iter; /* Selection iteration info */
+ hbool_t sel_iter_init = FALSE; /* Selection iteration info has been initialized */
+ hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */
+ size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */
+ hssize_t snum_points; /* Signed number of elements in selection */
+ hsize_t num_points; /* Number of points in the selection */
+ size_t max_elem; /* Maximum number of elements allowed in sequences */
+ hsize_t u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ /* Check args */
+ HDassert(space);
+
+ /* Get the total number of points selected */
+ if((snum_points = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't get number of elements selected")
+ num_points = (hsize_t)snum_points;
+
+ /* Allocate array to store point displacements */
+ if(NULL == (disp = (MPI_Aint *)H5MM_malloc(sizeof(MPI_Aint) * num_points)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of displacements")
+
+ /* Initialize selection iterator */
+ if(H5S_select_iter_init(&sel_iter, space, elmt_size) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator")
+ sel_iter_init = TRUE; /* Selection iteration info has been initialized */
+
+ /* Set the number of elements to iterate over */
+ H5_ASSIGN_OVERFLOW(max_elem, num_points, hsize_t, size_t);
+
+ /* Loop, while elements left in selection */
+ u = 0;
+ while(max_elem > 0) {
+ hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */
+ size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */
+ size_t nelem; /* Number of elements used in sequences */
+ size_t nseq; /* Number of sequences generated */
+ size_t curr_seq; /* Current sequence being worked on */
+
+ /* Get the sequences of bytes */
+ if(H5S_SELECT_GET_SEQ_LIST(space, 0, &sel_iter, (size_t)H5D_IO_VECTOR_SIZE, max_elem, &nseq, &nelem, off, len) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "sequence length generation failed")
+
+ /* Loop, while sequences left to process */
+ for(curr_seq = 0; curr_seq < nseq; curr_seq++) {
+ hsize_t curr_off; /* Current offset within sequence */
+ size_t curr_len; /* Length of bytes left to process in sequence */
+
+ /* Get the current offset */
+ curr_off = off[curr_seq];
+
+ /* Get the number of bytes in sequence */
+ curr_len = len[curr_seq];
+
+ /* Loop, while bytes left in sequence */
+ while(curr_len > 0) {
+ /* Set the displacement of the current point */
+ disp[u] = curr_off;
+
+ /* This is a memory displacement, so for each point selected,
+ * apply the map that was generated by the file selection */
+ if((*permute)[u] != num_points) {
+ MPI_Aint temp = disp[u];
+
+ HDmemmove(disp + (*permute)[u] + 1, disp + (*permute)[u],
+ (u - (*permute)[u]) * sizeof(MPI_Aint));
+ disp[(*permute)[u]] = temp;
+ } /* end if */
+
+ /* Advance to next element */
+ u++;
+
+ /* Increment offset in dataspace */
+ curr_off += elmt_size;
+
+ /* Decrement number of bytes left in sequence */
+ curr_len -= elmt_size;
+ } /* end while */
+ } /* end for */
+
+ /* Decrement number of elements left to process */
+ max_elem -= nelem;
+ } /* end while */
+
+ /* Create the MPI datatype for the set of element displacements */
+ if(H5S_mpio_create_point_datatype(elmt_size, num_points, disp, new_type) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create an MPI Datatype from point selection")
+
+ /* Set values about MPI datatype created */
+ *count = 1;
+ *is_derived_type = TRUE;
+
+done:
+ /* Release selection iterator */
+ if(sel_iter_init)
+ if(H5S_SELECT_ITER_RELEASE(&sel_iter) < 0)
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator")
+
+ /* Free memory */
+ if(disp)
+ H5MM_free(disp);
+ if(*permute) {
+ H5MM_free(*permute);
+ *permute = NULL;
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5S_mpio_permute_type() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5S_mpio_hyper_type
*
* Purpose: Translate an HDF5 hyperslab selection into an MPI type.
@@ -453,7 +790,7 @@ H5S_mpio_span_hyper_type(const H5S_t *space, size_t elmt_size,
elmt_type_is_derived = TRUE;
/* Compute 'down' sizes for each dimension */
- if(H5V_array_down(space->extent.rank, space->extent.size, down) < 0)
+ if(H5VM_array_down(space->extent.rank, space->extent.size, down) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGETSIZE, FAIL, "couldn't compute 'down' dimension sizes")
/* Obtain derived data type */
@@ -478,7 +815,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5S_obtain datatype
+ * Function: H5S_obtain_datatype
*
* Purpose: Obtain an MPI derived datatype based on span-tree
* implementation
@@ -673,8 +1010,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5S_mpio_space_type(const H5S_t *space, size_t elmt_size,
- MPI_Datatype *new_type, int *count, hbool_t *is_derived_type)
+H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type,
+ int *count, hbool_t *is_derived_type, hbool_t do_permute, hsize_t **permute_map,
+ hbool_t *is_permuted)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -684,44 +1022,75 @@ H5S_mpio_space_type(const H5S_t *space, size_t elmt_size,
HDassert(space);
HDassert(elmt_size);
- /* Creat MPI type based on the kind of selection */
+ /* Create MPI type based on the kind of selection */
switch(H5S_GET_EXTENT_TYPE(space)) {
case H5S_NULL:
case H5S_SCALAR:
case H5S_SIMPLE:
- switch(H5S_GET_SELECT_TYPE(space)) {
- case H5S_SEL_NONE:
- if(H5S_mpio_none_type(new_type, count, is_derived_type) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'none' selection to MPI type")
- break;
-
- case H5S_SEL_ALL:
- if(H5S_mpio_all_type(space, elmt_size, new_type, count, is_derived_type) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'all' selection to MPI type")
- break;
-
- case H5S_SEL_POINTS:
- /* not yet implemented */
- ret_value = FAIL;
- break;
-
- case H5S_SEL_HYPERSLABS:
- if((H5S_SELECT_IS_REGULAR(space) == TRUE)) {
- if(H5S_mpio_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert regular 'hyperslab' selection to MPI type")
- } /* end if */
- else {
- if(H5S_mpio_span_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert irregular 'hyperslab' selection to MPI type")
- } /* end else */
- break;
-
- case H5S_SEL_ERROR:
- case H5S_SEL_N:
- default:
- HDassert("unknown selection type" && 0);
- break;
- } /* end switch */
+ /* If the file space has been permuted previously due to
+ * out-of-order point selection, then permute this selection which
+ * should be a memory selection to match the file space permutation.
+ */
+ if(TRUE == *is_permuted) {
+ switch(H5S_GET_SELECT_TYPE(space)) {
+ case H5S_SEL_NONE:
+ if(H5S_mpio_none_type(new_type, count, is_derived_type) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't convert 'none' selection to MPI type")
+ break;
+
+ case H5S_SEL_ALL:
+ case H5S_SEL_POINTS:
+ case H5S_SEL_HYPERSLABS:
+ /* Sanity check */
+ HDassert(!do_permute);
+
+ if(H5S_mpio_permute_type(space, elmt_size, permute_map, new_type, count, is_derived_type) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't convert 'all' selection to MPI type")
+ break;
+
+ case H5S_SEL_ERROR:
+ case H5S_SEL_N:
+ default:
+ HDassert("unknown selection type" && 0);
+ break;
+ } /* end switch */
+ } /* end if */
+ /* the file space is not permuted, so do a regular selection */
+ else {
+ switch(H5S_GET_SELECT_TYPE(space)) {
+ case H5S_SEL_NONE:
+ if(H5S_mpio_none_type(new_type, count, is_derived_type) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'none' selection to MPI type")
+ break;
+
+ case H5S_SEL_ALL:
+ if(H5S_mpio_all_type(space, elmt_size, new_type, count, is_derived_type) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'all' selection to MPI type")
+ break;
+
+ case H5S_SEL_POINTS:
+ if(H5S_mpio_point_type(space, elmt_size, new_type, count, is_derived_type, do_permute, permute_map, is_permuted) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't convert 'point' selection to MPI type")
+ break;
+
+ case H5S_SEL_HYPERSLABS:
+ if((H5S_SELECT_IS_REGULAR(space) == TRUE)) {
+ if(H5S_mpio_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert regular 'hyperslab' selection to MPI type")
+ } /* end if */
+ else {
+ if(H5S_mpio_span_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert irregular 'hyperslab' selection to MPI type")
+ } /* end else */
+ break;
+
+ case H5S_SEL_ERROR:
+ case H5S_SEL_N:
+ default:
+ HDassert("unknown selection type" && 0);
+ break;
+ } /* end switch */
+ } /* end else */
break;
case H5S_NO_CLASS:
diff --git a/src/H5Snone.c b/src/H5Snone.c
index 021dd61..3c5eccc 100644
--- a/src/H5Snone.c
+++ b/src/H5Snone.c
@@ -27,7 +27,7 @@
#include "H5Eprivate.h"
#include "H5Iprivate.h"
#include "H5Spkg.h"
-#include "H5Vprivate.h"
+#include "H5VMprivate.h"
#include "H5Dprivate.h"
/* Static function prototypes */
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index b758a92..70842df 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -29,7 +29,7 @@
#include "H5Iprivate.h" /* ID Functions */
#include "H5MMprivate.h" /* Memory Management functions */
#include "H5Spkg.h" /* Dataspace functions */
-#include "H5Vprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/* Static function prototypes */
@@ -1383,7 +1383,7 @@ H5S_point_project_scalar(const H5S_t *space, hsize_t *offset)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "point selection of one element has more than one node!")
/* Calculate offset of selection in projected buffer */
- *offset = H5V_array_offset(space->extent.rank, space->extent.size, node->pnt);
+ *offset = H5VM_array_offset(space->extent.rank, space->extent.size, node->pnt);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1437,7 +1437,7 @@ H5S_point_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off
/* Calculate offset of selection in projected buffer */
HDmemset(block, 0, sizeof(block));
HDmemcpy(block, base_space->select.sel_info.pnt_lst->head->pnt, sizeof(hsize_t) * rank_diff);
- *offset = H5V_array_offset(base_space->extent.rank, base_space->extent.size, block);
+ *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block);
/* Iterate through base space's point nodes, copying the point information */
base_node = base_space->select.sel_info.pnt_lst->head;
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index 0e67af1..be8a28f 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -272,12 +272,13 @@ H5_DLL herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter);
/* (Defined in H5S.c) */
H5_DLLVAR hbool_t H5S_mpi_opt_types_g;
-H5_DLL herr_t
-H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
- /* out: */
- MPI_Datatype *new_type,
- int *count,
- hbool_t *is_derived_type );
+H5_DLL herr_t H5S_mpio_space_type(const H5S_t *space, size_t elmt_size,
+ /* out: */ MPI_Datatype *new_type,
+ int *count,
+ hbool_t *is_derived_type,
+ hbool_t do_permute,
+ hsize_t **permute_map,
+ hbool_t * is_permuted);
#endif /* H5_HAVE_PARALLEL */
#endif /* _H5Sprivate_H */
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 1eb0cbc..2cb4b38 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -29,13 +29,13 @@
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Spkg.h" /* Dataspaces */
-#include "H5Vprivate.h" /* Vector and array functions */
+#include "H5VMprivate.h" /* Vector and array functions */
#include "H5WBprivate.h" /* Wrapped Buffers */
/* Local functions */
#ifdef LATER
-static herr_t H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
-static htri_t H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter);
+static herr_t H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
+static htri_t H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter);
static herr_t H5S_select_iter_next_block(H5S_sel_iter_t *iter);
#endif /* LATER */
@@ -922,7 +922,7 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_s
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords)
+H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords)
{
herr_t ret_value; /* return value */
@@ -964,7 +964,7 @@ H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
+H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
{
herr_t ret_value; /* return value */
@@ -1004,7 +1004,7 @@ H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
REVISION LOG
--------------------------------------------------------------------------*/
hsize_t
-H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter)
+H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter)
{
hsize_t ret_value; /* return value */
@@ -1043,7 +1043,7 @@ H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter)
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter)
+H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter)
{
herr_t ret_value; /* return value */
@@ -1217,24 +1217,13 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t
H5T_t *dt; /* Datatype structure */
H5S_sel_iter_t iter; /* Selection iteration info */
hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */
- uint8_t *loc; /* Current element location in buffer */
- hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of element in dataspace */
hssize_t nelmts; /* Number of elements in selection */
hsize_t space_size[H5O_LAYOUT_NDIMS]; /* Dataspace size */
- hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */
- hsize_t curr_off; /* Current offset within sequence */
- hsize_t tmp_off; /* Temporary offset within sequence */
- size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */
- size_t curr_len; /* Length of bytes left to process in sequence */
- size_t nseq; /* Number of sequences generated */
- size_t curr_seq; /* Current sequnce being worked on */
- size_t nelem; /* Number of elements used in sequences */
size_t max_elem; /* Maximum number of elements allowed in sequences */
size_t elmt_size; /* Datatype size */
unsigned ndims; /* Number of dimensions in dataspace */
- int i; /* Local Index variable */
- herr_t user_ret=0; /* User's return value */
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t user_ret = 0; /* User's return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1274,12 +1263,21 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t
/* Loop, while elements left in selection */
while(max_elem > 0 && user_ret == 0) {
+ hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */
+ size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */
+ size_t nelem; /* Number of elements used in sequences */
+ size_t nseq; /* Number of sequences generated */
+ size_t curr_seq; /* Current sequence being worked on */
+
/* Get the sequences of bytes */
if(H5S_SELECT_GET_SEQ_LIST(space, 0, &iter, (size_t)H5D_IO_VECTOR_SIZE, max_elem, &nseq, &nelem, off, len) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed")
/* Loop, while sequences left to process */
- for(curr_seq=0; curr_seq<nseq && user_ret==0; curr_seq++) {
+ for(curr_seq = 0; curr_seq < nseq && user_ret == 0; curr_seq++) {
+ hsize_t curr_off; /* Current offset within sequence */
+ size_t curr_len; /* Length of bytes left to process in sequence */
+
/* Get the current offset */
curr_off = off[curr_seq];
@@ -1288,6 +1286,11 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t
/* Loop, while bytes left in sequence */
while(curr_len > 0 && user_ret == 0) {
+ hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of element in dataspace */
+ hsize_t tmp_off; /* Temporary offset within sequence */
+ uint8_t *loc; /* Current element location in buffer */
+ int i; /* Local Index variable */
+
/* Compute the coordinate from the offset */
for(i = (int)ndims, tmp_off = curr_off; i >= 0; i--) {
coords[i] = tmp_off % space_size[i];
@@ -1298,22 +1301,22 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t
loc = (unsigned char *)buf + curr_off;
/* Call user's callback routine */
- user_ret=(*op)(loc,type_id,ndims,coords,operator_data);
+ user_ret = (*op)(loc, type_id, ndims, coords, operator_data);
/* Increment offset in dataspace */
- curr_off+=elmt_size;
+ curr_off += elmt_size;
/* Decrement number of bytes left in sequence */
- curr_len-=elmt_size;
+ curr_len -= elmt_size;
} /* end while */
} /* end for */
/* Decrement number of elements left to process */
- max_elem-=nelem;
+ max_elem -= nelem;
} /* end while */
/* Set return value */
- ret_value=user_ret;
+ ret_value = user_ret;
done:
/* Release selection iterator */
@@ -1872,8 +1875,8 @@ H5S_select_construct_projection(const H5S_t *base_space, H5S_t **new_space_ptr,
* and set the remaining dimensions to 1
*/
rank_diff = new_space_rank - base_space_rank;
- H5V_array_fill(new_space_dims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff);
- H5V_array_fill(new_space_maxdims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff);
+ H5VM_array_fill(new_space_dims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff);
+ H5VM_array_fill(new_space_maxdims, &tmp_dim_size, sizeof(tmp_dim_size), rank_diff);
HDmemcpy(&new_space_dims[rank_diff], base_space_dims, sizeof(new_space_dims[0]) * base_space_rank);
HDmemcpy(&new_space_maxdims[rank_diff], base_space_maxdims, sizeof(new_space_maxdims[0]) * base_space_rank);
} /* end if */
@@ -2038,7 +2041,7 @@ H5S_select_fill(const void *fill, size_t fill_size, const H5S_t *space, void *_b
/* Fill each sequence in memory with fill value */
HDassert((len[curr_seq] % fill_size) == 0);
- H5V_array_fill(buf, fill, fill_size, (len[curr_seq] / fill_size));
+ H5VM_array_fill(buf, fill, fill_size, (len[curr_seq] / fill_size));
} /* end for */
/* Decrement number of elements left to process */
diff --git a/src/H5V.c b/src/H5VM.c
index 4039ac2..c57f343 100644
--- a/src/H5V.c
+++ b/src/H5VM.c
@@ -22,34 +22,34 @@
#include "H5private.h"
#include "H5Eprivate.h"
#include "H5Oprivate.h"
-#include "H5Vprivate.h"
+#include "H5VMprivate.h"
/* Local typedefs */
-typedef struct H5V_memcpy_ud_t {
+typedef struct H5VM_memcpy_ud_t {
unsigned char *dst; /* Pointer to destination buffer */
const unsigned char *src; /* Pointer to source buffer */
-} H5V_memcpy_ud_t;
+} H5VM_memcpy_ud_t;
/* Local macros */
-#define H5V_HYPER_NDIMS H5O_LAYOUT_NDIMS
+#define H5VM_HYPER_NDIMS H5O_LAYOUT_NDIMS
/* Local prototypes */
static void
-H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
+H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
const hsize_t *size, hsize_t *stride1);
static void
-H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
+H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
const hsize_t *size, hsize_t *stride1, hsize_t *stride2);
#ifdef LATER
static void
-H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
+H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
unsigned dst_n, const hsize_t *dst_size, const ssize_t *dst_stride, void *_dst,
unsigned src_n, const hsize_t *src_size, const ssize_t *src_stride, const void *_src);
#endif /* LATER */
/*-------------------------------------------------------------------------
- * Function: H5V_stride_optimize1
+ * Function: H5VM_stride_optimize1
*
* Purpose: Given a stride vector which references elements of the
* specified size, optimize the dimensionality, the stride
@@ -69,7 +69,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
*-------------------------------------------------------------------------
*/
static void
-H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
+H5VM_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
const hsize_t *size, hsize_t *stride1)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -78,7 +78,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
* This has to be true because if we optimize the dimensionality down to
* zero we still must make one reference.
*/
- HDassert(1 == H5V_vector_reduce_product(0, NULL));
+ HDassert(1 == H5VM_vector_reduce_product(0, NULL));
/*
* Combine adjacent memory accesses
@@ -95,7 +95,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
/*-------------------------------------------------------------------------
- * Function: H5V_stride_optimize2
+ * Function: H5VM_stride_optimize2
*
* Purpose: Given two stride vectors which reference elements of the
* specified size, optimize the dimensionality, the stride
@@ -118,7 +118,7 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
*-------------------------------------------------------------------------
*/
static void
-H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
+H5VM_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
const hsize_t *size, hsize_t *stride1, hsize_t *stride2)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -127,7 +127,7 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
* This has to be true because if we optimize the dimensionality down to
* zero we still must make one reference.
*/
- HDassert(1 == H5V_vector_reduce_product(0, NULL));
+ HDassert(1 == H5VM_vector_reduce_product(0, NULL));
HDassert(*elmt_size>0);
/*
@@ -224,7 +224,7 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
/*-------------------------------------------------------------------------
- * Function: H5V_hyper_stride
+ * Function: H5VM_hyper_stride
*
* Purpose: Given a description of a hyperslab, this function returns
* (through STRIDE[]) the byte strides appropriate for accessing
@@ -256,7 +256,7 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
*-------------------------------------------------------------------------
*/
hsize_t
-H5V_hyper_stride(unsigned n, const hsize_t *size,
+H5VM_hyper_stride(unsigned n, const hsize_t *size,
const hsize_t *total_size, const hsize_t *offset,
hsize_t *stride/*out*/)
{
@@ -267,7 +267,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
- HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(n <= H5VM_HYPER_NDIMS);
HDassert(size);
HDassert(total_size);
HDassert(stride);
@@ -333,7 +333,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size,
/*-------------------------------------------------------------------------
- * Function: H5V_hyper_eq
+ * Function: H5VM_hyper_eq
*
* Purpose: Determines whether two hyperslabs are equal. This function
* assumes that both hyperslabs are relative to the same array,
@@ -356,7 +356,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size,
*-------------------------------------------------------------------------
*/
htri_t
-H5V_hyper_eq(unsigned n,
+H5VM_hyper_eq(unsigned n,
const hsize_t *offset1, const hsize_t *size1,
const hsize_t *offset2, const hsize_t *size2)
{
@@ -386,7 +386,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5V_hyper_disjointp
+ * Function: H5VM_hyper_disjointp
*
* Purpose: Determines if two hyperslabs are disjoint.
*
@@ -404,7 +404,7 @@ done:
*-------------------------------------------------------------------------
*/
htri_t
-H5V_hyper_disjointp(unsigned n,
+H5VM_hyper_disjointp(unsigned n,
const hsize_t *offset1, const uint32_t *size1,
const hsize_t *offset2, const uint32_t *size2)
{
@@ -432,11 +432,11 @@ H5V_hyper_disjointp(unsigned n,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5V_hyper_disjointp() */
+} /* end H5VM_hyper_disjointp() */
/*-------------------------------------------------------------------------
- * Function: H5V_hyper_fill
+ * Function: H5VM_hyper_fill
*
* Purpose: Similar to memset() except it operates on hyperslabs...
*
@@ -457,13 +457,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5V_hyper_fill(unsigned n, const hsize_t *_size,
+H5VM_hyper_fill(unsigned n, const hsize_t *_size,
const hsize_t *total_size, const hsize_t *offset, void *_dst,
unsigned fill_value)
{
uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic */
- hsize_t size[H5V_HYPER_NDIMS]; /*a modifiable copy of _size */
- hsize_t dst_stride[H5V_HYPER_NDIMS]; /*destination stride info */
+ hsize_t size[H5VM_HYPER_NDIMS]; /*a modifiable copy of _size */
+ hsize_t dst_stride[H5VM_HYPER_NDIMS]; /*destination stride info */
hsize_t dst_start; /*byte offset to start of stride*/
hsize_t elmt_size = 1; /*bytes per element */
herr_t ret_value; /*function return status */
@@ -474,7 +474,7 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- HDassert(n > 0 && n <= H5V_HYPER_NDIMS);
+ HDassert(n > 0 && n <= H5VM_HYPER_NDIMS);
HDassert(_size);
HDassert(total_size);
HDassert(dst);
@@ -486,14 +486,14 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size,
#endif
/* Copy the size vector so we can modify it */
- H5V_vector_cpy(n, size, _size);
+ H5VM_vector_cpy(n, size, _size);
/* Compute an optimal destination stride vector */
- dst_start = H5V_hyper_stride(n, size, total_size, offset, dst_stride);
- H5V_stride_optimize1(&n, &elmt_size, size, dst_stride);
+ dst_start = H5VM_hyper_stride(n, size, total_size, offset, dst_stride);
+ H5VM_stride_optimize1(&n, &elmt_size, size, dst_stride);
/* Copy */
- ret_value = H5V_stride_fill(n, elmt_size, size, dst_stride, dst+dst_start,
+ ret_value = H5VM_stride_fill(n, elmt_size, size, dst_stride, dst+dst_start,
fill_value);
FUNC_LEAVE_NOAPI(ret_value)
@@ -501,7 +501,7 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size,
/*-------------------------------------------------------------------------
- * Function: H5V_hyper_copy
+ * Function: H5VM_hyper_copy
*
* Purpose: Copies a hyperslab from the source to the destination.
*
@@ -535,7 +535,7 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size,
*-------------------------------------------------------------------------
*/
herr_t
-H5V_hyper_copy(unsigned n, const hsize_t *_size,
+H5VM_hyper_copy(unsigned n, const hsize_t *_size,
/*destination*/
const hsize_t *dst_size, const hsize_t *dst_offset,
@@ -547,9 +547,9 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
{
const uint8_t *src = (const uint8_t*)_src; /*cast for ptr arithmtc */
uint8_t *dst = (uint8_t*) _dst; /*cast for ptr arithmtc */
- hsize_t size[H5V_HYPER_NDIMS]; /*a modifiable _size */
- hsize_t src_stride[H5V_HYPER_NDIMS]; /*source stride info */
- hsize_t dst_stride[H5V_HYPER_NDIMS]; /*dest stride info */
+ hsize_t size[H5VM_HYPER_NDIMS]; /*a modifiable _size */
+ hsize_t src_stride[H5VM_HYPER_NDIMS]; /*source stride info */
+ hsize_t dst_stride[H5VM_HYPER_NDIMS]; /*dest stride info */
hsize_t dst_start, src_start; /*offset to start at */
hsize_t elmt_size = 1; /*element size in bytes */
herr_t ret_value; /*return status */
@@ -560,7 +560,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- HDassert(n > 0 && n <= H5V_HYPER_NDIMS);
+ HDassert(n > 0 && n <= H5VM_HYPER_NDIMS);
HDassert(_size);
HDassert(dst_size);
HDassert(src_size);
@@ -575,14 +575,14 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
#endif
/* Copy the size vector so we can modify it */
- H5V_vector_cpy(n, size, _size);
+ H5VM_vector_cpy(n, size, _size);
/* Compute stride vectors for source and destination */
#ifdef NO_INLINED_CODE
- dst_start = H5V_hyper_stride(n, size, dst_size, dst_offset, dst_stride);
- src_start = H5V_hyper_stride(n, size, src_size, src_offset, src_stride);
+ dst_start = H5VM_hyper_stride(n, size, dst_size, dst_offset, dst_stride);
+ src_start = H5VM_hyper_stride(n, size, src_size, src_offset, src_stride);
#else /* NO_INLINED_CODE */
- /* in-line version of two calls to H5V_hyper_stride() */
+ /* in-line version of two calls to H5VM_hyper_stride() */
{
hsize_t dst_acc; /*accumulator */
hsize_t src_acc; /*accumulator */
@@ -675,10 +675,10 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
#endif /* NO_INLINED_CODE */
/* Optimize the strides as a pair */
- H5V_stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride);
+ H5VM_stride_optimize2(&n, &elmt_size, size, dst_stride, src_stride);
/* Perform the copy in terms of stride */
- ret_value = H5V_stride_copy(n, elmt_size, size,
+ ret_value = H5VM_stride_copy(n, elmt_size, size,
dst_stride, dst+dst_start, src_stride, src+src_start);
FUNC_LEAVE_NOAPI(ret_value)
@@ -686,7 +686,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
/*-------------------------------------------------------------------------
- * Function: H5V_stride_fill
+ * Function: H5VM_stride_fill
*
* Purpose: Fills all bytes of a hyperslab with the same value using
* memset().
@@ -701,11 +701,11 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
*-------------------------------------------------------------------------
*/
herr_t
-H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
+H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
const hsize_t *stride, void *_dst, unsigned fill_value)
{
uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic */
- hsize_t idx[H5V_HYPER_NDIMS]; /*1-origin indices */
+ hsize_t idx[H5VM_HYPER_NDIMS]; /*1-origin indices */
hsize_t nelmts; /*number of elements to fill */
hsize_t i; /*counter */
int j; /*counter */
@@ -715,8 +715,8 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
HDassert(elmt_size < SIZET_MAX);
- H5V_vector_cpy(n, idx, size);
- nelmts = H5V_vector_reduce_product(n, size);
+ H5VM_vector_cpy(n, idx, size);
+ nelmts = H5VM_vector_reduce_product(n, size);
for (i=0; i<nelmts; i++) {
/* Copy an element */
H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
@@ -740,7 +740,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
/*-------------------------------------------------------------------------
- * Function: H5V_stride_copy
+ * Function: H5VM_stride_copy
*
* Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
* DST and SRC while copying bytes from SRC to DST. This
@@ -749,7 +749,7 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
* outside the hyperslab defined by the strides.
*
* Note: If the src_stride is all zero and elmt_size is one, then it's
- * probably more efficient to use H5V_stride_fill() instead.
+ * probably more efficient to use H5VM_stride_fill() instead.
*
* Return: Non-negative on success/Negative on failure
*
@@ -761,13 +761,13 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
*-------------------------------------------------------------------------
*/
herr_t
-H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
+H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
const hsize_t *dst_stride, void *_dst,
const hsize_t *src_stride, const void *_src)
{
uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic*/
const uint8_t *src = (const uint8_t*) _src; /*cast for ptr arithmetic*/
- hsize_t idx[H5V_HYPER_NDIMS]; /*1-origin indices */
+ hsize_t idx[H5VM_HYPER_NDIMS]; /*1-origin indices */
hsize_t nelmts; /*num elements to copy */
hsize_t i; /*counter */
int j; /*counters */
@@ -778,8 +778,8 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
HDassert(elmt_size<SIZET_MAX);
if (n) {
- H5V_vector_cpy(n, idx, size);
- nelmts = H5V_vector_reduce_product(n, size);
+ H5VM_vector_cpy(n, idx, size);
+ nelmts = H5VM_vector_reduce_product(n, size);
for (i=0; i<nelmts; i++) {
/* Copy an element */
@@ -809,7 +809,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
/*-------------------------------------------------------------------------
- * Function: H5V_stride_copy_s
+ * Function: H5VM_stride_copy_s
*
* Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
* DST and SRC while copying bytes from SRC to DST. This
@@ -818,7 +818,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
* outside the hyperslab defined by the strides.
*
* Note: If the src_stride is all zero and elmt_size is one, then it's
- * probably more efficient to use H5V_stride_fill() instead.
+ * probably more efficient to use H5VM_stride_fill() instead.
*
* Return: Non-negative on success/Negative on failure
*
@@ -830,13 +830,13 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
*-------------------------------------------------------------------------
*/
herr_t
-H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size,
+H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size,
const hssize_t *dst_stride, void *_dst,
const hssize_t *src_stride, const void *_src)
{
uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic*/
const uint8_t *src = (const uint8_t*) _src; /*cast for ptr arithmetic*/
- hsize_t idx[H5V_HYPER_NDIMS]; /*1-origin indices */
+ hsize_t idx[H5VM_HYPER_NDIMS]; /*1-origin indices */
hsize_t nelmts; /*num elements to copy */
hsize_t i; /*counter */
int j; /*counters */
@@ -847,8 +847,8 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size,
HDassert(elmt_size<SIZET_MAX);
if (n) {
- H5V_vector_cpy(n, idx, size);
- nelmts = H5V_vector_reduce_product(n, size);
+ H5VM_vector_cpy(n, idx, size);
+ nelmts = H5VM_vector_reduce_product(n, size);
for (i=0; i<nelmts; i++) {
/* Copy an element */
@@ -879,9 +879,9 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size,
#ifdef LATER
/*-------------------------------------------------------------------------
- * Function: H5V_stride_copy2
+ * Function: H5VM_stride_copy2
*
- * Purpose: Similar to H5V_stride_copy() except the source and
+ * Purpose: Similar to H5VM_stride_copy() except the source and
* destination each have their own dimensionality and size and
* we copy exactly NELMTS elements each of size ELMT_SIZE. The
* size counters wrap if NELMTS is more than a size counter.
@@ -896,7 +896,7 @@ H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size,
*-------------------------------------------------------------------------
*/
static void
-H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
+H5VM_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
/* destination */
unsigned dst_n, const hsize_t *dst_size,
@@ -910,8 +910,8 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
{
uint8_t *dst = (uint8_t *) _dst;
const uint8_t *src = (const uint8_t *) _src;
- hsize_t dst_idx[H5V_HYPER_NDIMS];
- hsize_t src_idx[H5V_HYPER_NDIMS];
+ hsize_t dst_idx[H5VM_HYPER_NDIMS];
+ hsize_t src_idx[H5VM_HYPER_NDIMS];
hsize_t i; /* Local index variable */
int j; /* Local index variable */
hbool_t carry;
@@ -922,8 +922,8 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
HDassert(dst_n>0);
HDassert(src_n>0);
- H5V_vector_cpy(dst_n, dst_idx, dst_size);
- H5V_vector_cpy(src_n, src_idx, src_size);
+ H5VM_vector_cpy(dst_n, dst_idx, dst_size);
+ H5VM_vector_cpy(src_n, src_idx, src_size);
for (i=0; i<nelmts; i++) {
@@ -958,7 +958,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
/*-------------------------------------------------------------------------
- * Function: H5V_array_fill
+ * Function: H5VM_array_fill
*
* Purpose: Fills all bytes of an array with the same value using
* memset(). Increases amount copied by power of two until the
@@ -974,7 +974,7 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
*-------------------------------------------------------------------------
*/
herr_t
-H5V_array_fill(void *_dst, const void *src, size_t size, size_t count)
+H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count)
{
size_t copy_size; /* size of the buffer to copy */
size_t copy_items; /* number of items currently copying*/
@@ -1010,11 +1010,11 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count)
HDmemcpy(dst, _dst, items_left * size);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5V_array_fill() */
+} /* H5VM_array_fill() */
/*-------------------------------------------------------------------------
- * Function: H5V_array_down
+ * Function: H5VM_array_down
*
* Purpose: Given a set of dimension sizes, calculate the size of each
* "down" slice. This is the size of the dimensions for all the
@@ -1031,14 +1031,14 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count)
*-------------------------------------------------------------------------
*/
herr_t
-H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
+H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
{
hsize_t acc; /*accumulator */
int i; /*counter */
FUNC_ENTER_NOAPI_NOINIT_NOERR
- HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(n <= H5VM_HYPER_NDIMS);
HDassert(total_size);
HDassert(down);
@@ -1050,11 +1050,11 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5V_array_down() */
+} /* end H5VM_array_down() */
/*-------------------------------------------------------------------------
- * Function: H5V_array_offset_pre
+ * Function: H5VM_array_offset_pre
*
* Purpose: Given a coordinate description of a location in an array, this
* function returns the byte offset of the coordinate.
@@ -1077,14 +1077,14 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
*-------------------------------------------------------------------------
*/
hsize_t
-H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
+H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
{
int i; /*counter */
hsize_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
- HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(n <= H5VM_HYPER_NDIMS);
HDassert(acc);
HDassert(offset);
@@ -1093,11 +1093,11 @@ H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
ret_value += acc[i] * offset[i];
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5V_array_offset_pre() */
+} /* end H5VM_array_offset_pre() */
/*-------------------------------------------------------------------------
- * Function: H5V_array_offset
+ * Function: H5VM_array_offset
*
* Purpose: Given a coordinate description of a location in an array, this
* function returns the byte offset of the coordinate.
@@ -1117,31 +1117,31 @@ H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
*-------------------------------------------------------------------------
*/
hsize_t
-H5V_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset)
+H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset)
{
- hsize_t acc_arr[H5V_HYPER_NDIMS]; /* Accumulated size of down dimensions */
+ hsize_t acc_arr[H5VM_HYPER_NDIMS]; /* Accumulated size of down dimensions */
hsize_t ret_value; /* Return value */
FUNC_ENTER_NOAPI((HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */
- HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(n <= H5VM_HYPER_NDIMS);
HDassert(total_size);
HDassert(offset);
/* Build the sizes of each dimension in the array */
- if(H5V_array_down(n,total_size,acc_arr)<0)
+ if(H5VM_array_down(n,total_size,acc_arr)<0)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, UFAIL, "can't compute down sizes")
/* Set return value */
- ret_value=H5V_array_offset_pre(n,acc_arr,offset);
+ ret_value=H5VM_array_offset_pre(n,acc_arr,offset);
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5V_array_offset() */
+} /* end H5VM_array_offset() */
/*-------------------------------------------------------------------------
- * Function: H5V_array_calc_pre
+ * Function: H5VM_array_calc_pre
*
* Purpose: Given a linear offset in an array, the dimensions of that
* array and the pre-computed 'down' (accumulator) sizes, this
@@ -1159,7 +1159,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down,
+H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down,
hsize_t *coords)
{
unsigned u; /* Local index variable */
@@ -1167,7 +1167,7 @@ H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down,
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
- HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(n <= H5VM_HYPER_NDIMS);
HDassert(coords);
/* Compute the coordinates from the offset */
@@ -1177,11 +1177,11 @@ H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down,
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5V_array_calc_pre() */
+} /* end H5VM_array_calc_pre() */
/*-------------------------------------------------------------------------
- * Function: H5V_array_calc
+ * Function: H5VM_array_calc
*
* Purpose: Given a linear offset in an array and the dimensions of that
* array, this function computes the coordinates of that offset
@@ -1201,33 +1201,33 @@ H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down,
*-------------------------------------------------------------------------
*/
herr_t
-H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *coords)
+H5VM_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *coords)
{
- hsize_t idx[H5V_HYPER_NDIMS]; /* Size of each dimension in bytes */
+ hsize_t idx[H5VM_HYPER_NDIMS]; /* Size of each dimension in bytes */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
- HDassert(n <= H5V_HYPER_NDIMS);
+ HDassert(n <= H5VM_HYPER_NDIMS);
HDassert(total_size);
HDassert(coords);
/* Build the sizes of each dimension in the array */
- if(H5V_array_down(n, total_size, idx) < 0)
+ if(H5VM_array_down(n, total_size, idx) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute down sizes")
/* Compute the coordinates from the offset */
- if(H5V_array_calc_pre(offset, n, idx, coords) < 0)
+ if(H5VM_array_calc_pre(offset, n, idx, coords) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute coordinates")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5V_array_calc() */
+} /* end H5VM_array_calc() */
/*-------------------------------------------------------------------------
- * Function: H5V_chunk_index
+ * Function: H5VM_chunk_index
*
* Purpose: Given a coordinate offset (COORD), the size of each chunk
* (CHUNK), the number of chunks in each dimension (NCHUNKS)
@@ -1269,16 +1269,16 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk,
+H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk,
const hsize_t *down_nchunks, hsize_t *chunk_idx)
{
- hsize_t scaled_coord[H5V_HYPER_NDIMS]; /* Scaled, coordinates, in terms of chunks */
+ hsize_t scaled_coord[H5VM_HYPER_NDIMS]; /* Scaled, coordinates, in terms of chunks */
unsigned u; /* Local index variable */
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Sanity check */
- HDassert(ndims <= H5V_HYPER_NDIMS);
+ HDassert(ndims <= H5VM_HYPER_NDIMS);
HDassert(coord);
HDassert(chunk);
HDassert(chunk_idx);
@@ -1288,14 +1288,14 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk,
scaled_coord[u]=coord[u]/chunk[u];
/* Compute the chunk index */
- *chunk_idx=H5V_array_offset_pre(ndims,down_nchunks,scaled_coord); /*lint !e772 scaled_coord will always be initialized */
+ *chunk_idx=H5VM_array_offset_pre(ndims,down_nchunks,scaled_coord); /*lint !e772 scaled_coord will always be initialized */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5V_chunk_index() */
+} /* end H5VM_chunk_index() */
/*-------------------------------------------------------------------------
- * Function: H5V_opvv
+ * Function: H5VM_opvv
*
* Purpose: Perform an operation on a source & destination sequences
* of offset/length pairs. Each set of sequnces has an array
@@ -1307,7 +1307,7 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk,
* source or destination sequence runs out of information.
*
* Note: The algorithm in this routine is [basically] the same as for
- * H5V_memcpyvv(). Changes should be made to both!
+ * H5VM_memcpyvv(). Changes should be made to both!
*
* Return: Non-negative # of bytes operated on, on success/Negative on failure
*
@@ -1317,11 +1317,11 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk,
*-------------------------------------------------------------------------
*/
ssize_t
-H5V_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[],
+H5VM_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[],
hsize_t dst_off_arr[],
size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[],
hsize_t src_off_arr[],
- H5V_opvv_func_t op, void *op_data)
+ H5VM_opvv_func_t op, void *op_data)
{
hsize_t *max_dst_off_ptr, *max_src_off_ptr; /* Pointers to max. source and destination offset locations */
hsize_t *dst_off_ptr, *src_off_ptr; /* Pointers to source and destination offset arrays */
@@ -1497,11 +1497,11 @@ finished:
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5V_opvv() */
+} /* end H5VM_opvv() */
/*-------------------------------------------------------------------------
- * Function: H5V_memcpyvv
+ * Function: H5VM_memcpyvv
*
* Purpose: Given source and destination buffers in memory (SRC & DST)
* copy sequences of from the source buffer into the destination
@@ -1514,7 +1514,7 @@ done:
* source or destination buffer runs out of sequence information.
*
* Note: The algorithm in this routine is [basically] the same as for
- * H5V_opvv(). Changes should be made to both!
+ * H5VM_opvv(). Changes should be made to both!
*
* Return: Non-negative # of bytes copied on success/Negative on failure
*
@@ -1524,7 +1524,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5V_memcpyvv(void *_dst,
+H5VM_memcpyvv(void *_dst,
size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[],
const void *_src,
size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[], hsize_t src_off_arr[])
@@ -1708,5 +1708,5 @@ finished:
*src_curr_seq = (size_t)(src_off_ptr - src_off_arr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5V_memcpyvv() */
+} /* end H5VM_memcpyvv() */
diff --git a/src/H5Vprivate.h b/src/H5VMprivate.h
index 34ea6e1..9170b93 100644
--- a/src/H5Vprivate.h
+++ b/src/H5VMprivate.h
@@ -17,42 +17,42 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Friday, October 10, 1997
*/
-#ifndef H5Vprivate_H
-#define H5Vprivate_H
+#ifndef H5VMprivate_H
+#define H5VMprivate_H
/* Private headers needed by this file */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
/* Vector-Vector sequence operation callback */
-typedef herr_t (*H5V_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
+typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
size_t len, void *udata);
/* Vector comparison functions like Fortran66 comparison operators */
-#define H5V_vector_eq_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)==0)
-#define H5V_vector_lt_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)<0)
-#define H5V_vector_gt_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)>0)
-#define H5V_vector_le_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)<=0)
-#define H5V_vector_ge_s(N,V1,V2) (H5V_vector_cmp_s (N, V1, V2)>=0)
-#define H5V_vector_eq_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)==0)
-#define H5V_vector_lt_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)<0)
-#define H5V_vector_gt_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)>0)
-#define H5V_vector_le_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)<=0)
-#define H5V_vector_ge_u(N,V1,V2) (H5V_vector_cmp_u (N, V1, V2)>=0)
+#define H5VM_vector_eq_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)==0)
+#define H5VM_vector_lt_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)<0)
+#define H5VM_vector_gt_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)>0)
+#define H5VM_vector_le_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)<=0)
+#define H5VM_vector_ge_s(N,V1,V2) (H5VM_vector_cmp_s (N, V1, V2)>=0)
+#define H5VM_vector_eq_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)==0)
+#define H5VM_vector_lt_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)<0)
+#define H5VM_vector_gt_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)>0)
+#define H5VM_vector_le_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)<=0)
+#define H5VM_vector_ge_u(N,V1,V2) (H5VM_vector_cmp_u (N, V1, V2)>=0)
/* Other functions */
-#define H5V_vector_cpy(N,DST,SRC) { \
+#define H5VM_vector_cpy(N,DST,SRC) { \
HDassert(sizeof(*(DST))==sizeof(*(SRC))); \
if (SRC) HDmemcpy (DST, SRC, (N)*sizeof(*(DST))); \
else HDmemset (DST, 0, (N)*sizeof(*(DST))); \
}
-#define H5V_vector_zero(N,DST) HDmemset(DST,0,(N)*sizeof(*(DST)))
+#define H5VM_vector_zero(N,DST) HDmemset(DST,0,(N)*sizeof(*(DST)))
/* Given a coordinate offset array (COORDS) of type TYPE, move the unlimited
* dimension (UNLIM_DIM) value to offset 0, sliding any intermediate values down
* one position. */
-#define H5V_swizzle_coords(TYPE,COORDS,UNLIM_DIM) { \
+#define H5VM_swizzle_coords(TYPE,COORDS,UNLIM_DIM) { \
/* COORDS must be an array of type TYPE */ \
HDassert(sizeof(COORDS[0]) == sizeof(TYPE)); \
\
@@ -69,7 +69,7 @@ typedef herr_t (*H5V_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
* offset 0 to offset of the unlimied dimension (UNLIM_DIM), sliding any
* intermediate values up one position. Undoes the "swizzle_coords" operation.
*/
-#define H5V_unswizzle_coords(TYPE,COORDS,UNLIM_DIM) { \
+#define H5VM_unswizzle_coords(TYPE,COORDS,UNLIM_DIM) { \
/* COORDS must be an array of type TYPE */ \
HDassert(sizeof(COORDS[0]) == sizeof(TYPE)); \
\
@@ -83,62 +83,62 @@ typedef herr_t (*H5V_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
}
/* A null pointer is equivalent to a zero vector */
-#define H5V_ZERO NULL
+#define H5VM_ZERO NULL
-H5_DLL hsize_t H5V_hyper_stride(unsigned n, const hsize_t *size,
+H5_DLL hsize_t H5VM_hyper_stride(unsigned n, const hsize_t *size,
const hsize_t *total_size,
const hsize_t *offset,
hsize_t *stride);
-H5_DLL htri_t H5V_hyper_disjointp(unsigned n, const hsize_t *offset1,
+H5_DLL htri_t H5VM_hyper_disjointp(unsigned n, const hsize_t *offset1,
const uint32_t *size1, const hsize_t *offset2, const uint32_t *size2);
-H5_DLL htri_t H5V_hyper_eq(unsigned n, const hsize_t *offset1,
+H5_DLL htri_t H5VM_hyper_eq(unsigned n, const hsize_t *offset1,
const hsize_t *size1, const hsize_t *offset2,
const hsize_t *size2);
-H5_DLL herr_t H5V_hyper_fill(unsigned n, const hsize_t *_size,
+H5_DLL herr_t H5VM_hyper_fill(unsigned n, const hsize_t *_size,
const hsize_t *total_size,
const hsize_t *offset, void *_dst,
unsigned fill_value);
-H5_DLL herr_t H5V_hyper_copy(unsigned n, const hsize_t *size,
+H5_DLL herr_t H5VM_hyper_copy(unsigned n, const hsize_t *size,
const hsize_t *dst_total_size,
const hsize_t *dst_offset, void *_dst,
const hsize_t *src_total_size,
const hsize_t *src_offset, const void *_src);
-H5_DLL herr_t H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
+H5_DLL herr_t H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
const hsize_t *stride, void *_dst,
unsigned fill_value);
-H5_DLL herr_t H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *_size,
+H5_DLL herr_t H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *_size,
const hsize_t *dst_stride, void *_dst,
const hsize_t *src_stride, const void *_src);
-H5_DLL herr_t H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *_size,
+H5_DLL herr_t H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *_size,
const hssize_t *dst_stride, void *_dst,
const hssize_t *src_stride, const void *_src);
-H5_DLL herr_t H5V_array_fill(void *_dst, const void *src, size_t size,
+H5_DLL herr_t H5VM_array_fill(void *_dst, const void *src, size_t size,
size_t count);
-H5_DLL herr_t H5V_array_down(unsigned n, const hsize_t *total_size,
+H5_DLL herr_t H5VM_array_down(unsigned n, const hsize_t *total_size,
hsize_t *down);
-H5_DLL hsize_t H5V_array_offset_pre(unsigned n,
+H5_DLL hsize_t H5VM_array_offset_pre(unsigned n,
const hsize_t *acc, const hsize_t *offset);
-H5_DLL hsize_t H5V_array_offset(unsigned n, const hsize_t *total_size,
+H5_DLL hsize_t H5VM_array_offset(unsigned n, const hsize_t *total_size,
const hsize_t *offset);
-H5_DLL herr_t H5V_array_calc_pre(hsize_t offset, unsigned n,
+H5_DLL herr_t H5VM_array_calc_pre(hsize_t offset, unsigned n,
const hsize_t *down, hsize_t *coords);
-H5_DLL herr_t H5V_array_calc(hsize_t offset, unsigned n,
+H5_DLL herr_t H5VM_array_calc(hsize_t offset, unsigned n,
const hsize_t *total_size, hsize_t *coords);
-H5_DLL herr_t H5V_chunk_index(unsigned ndims, const hsize_t *coord,
+H5_DLL herr_t H5VM_chunk_index(unsigned ndims, const hsize_t *coord,
const uint32_t *chunk, const hsize_t *down_nchunks, hsize_t *chunk_idx);
-H5_DLL ssize_t H5V_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[],
+H5_DLL ssize_t H5VM_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[],
hsize_t dst_off_arr[],
size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[],
hsize_t src_off_arr[],
- H5V_opvv_func_t op, void *op_data);
-H5_DLL ssize_t H5V_memcpyvv(void *_dst,
+ H5VM_opvv_func_t op, void *op_data);
+H5_DLL ssize_t H5VM_memcpyvv(void *_dst,
size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[],
const void *_src,
size_t src_max_nseq, size_t *src_curr_seq, size_t src_len_arr[], hsize_t src_off_arr[]);
/*-------------------------------------------------------------------------
- * Function: H5V_vector_reduce_product
+ * Function: H5VM_vector_reduce_product
*
* Purpose: Product reduction of a vector. Vector elements and return
* value are size_t because we usually want the number of
@@ -157,7 +157,7 @@ H5_DLL ssize_t H5V_memcpyvv(void *_dst,
*-------------------------------------------------------------------------
*/
static H5_inline hsize_t UNUSED
-H5V_vector_reduce_product(unsigned n, const hsize_t *v)
+H5VM_vector_reduce_product(unsigned n, const hsize_t *v)
{
hsize_t ret_value = 1;
@@ -172,7 +172,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5V_vector_zerop_u
+ * Function: H5VM_vector_zerop_u
*
* Purpose: Determines if all elements of a vector are zero.
*
@@ -189,7 +189,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5_inline htri_t UNUSED
-H5V_vector_zerop_u(int n, const hsize_t *v)
+H5VM_vector_zerop_u(int n, const hsize_t *v)
{
htri_t ret_value=TRUE; /* Return value */
@@ -207,7 +207,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5V_vector_zerop_s
+ * Function: H5VM_vector_zerop_s
*
* Purpose: Determines if all elements of a vector are zero.
*
@@ -224,7 +224,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5_inline htri_t UNUSED
-H5V_vector_zerop_s(int n, const hssize_t *v)
+H5VM_vector_zerop_s(int n, const hssize_t *v)
{
htri_t ret_value=TRUE; /* Return value */
@@ -242,7 +242,7 @@ done:
}
/*-------------------------------------------------------------------------
- * Function: H5V_vector_cmp_u
+ * Function: H5VM_vector_cmp_u
*
* Purpose: Compares two vectors of the same size and determines if V1 is
* lexicographically less than, equal, or greater than V2.
@@ -261,7 +261,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5_inline int UNUSED
-H5V_vector_cmp_u (unsigned n, const hsize_t *v1, const hsize_t *v2)
+H5VM_vector_cmp_u (unsigned n, const hsize_t *v1, const hsize_t *v2)
{
int ret_value=0; /* Return value */
@@ -284,7 +284,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5V_vector_cmp_s
+ * Function: H5VM_vector_cmp_s
*
* Purpose: Compares two vectors of the same size and determines if V1 is
* lexicographically less than, equal, or greater than V2.
@@ -303,7 +303,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5_inline int UNUSED
-H5V_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2)
+H5VM_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2)
{
int ret_value=0; /* Return value */
@@ -326,7 +326,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5V_vector_inc
+ * Function: H5VM_vector_inc
*
* Purpose: Increments V1 by V2
*
@@ -340,7 +340,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5_inline void UNUSED
-H5V_vector_inc(int n, hsize_t *v1, const hsize_t *v2)
+H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2)
{
while (n--) *v1++ += *v2++;
}
@@ -368,7 +368,7 @@ static const unsigned char LogTable256[] =
/*-------------------------------------------------------------------------
- * Function: H5V_log2_gen
+ * Function: H5VM_log2_gen
*
* Purpose: Determines the log base two of a number (i.e. log2(n)).
* (i.e. the highest bit set in a number)
@@ -387,7 +387,7 @@ static const unsigned char LogTable256[] =
*-------------------------------------------------------------------------
*/
static H5_inline unsigned UNUSED
-H5V_log2_gen(uint64_t n)
+H5VM_log2_gen(uint64_t n)
{
unsigned r; /* r will be log2(n) */
register unsigned int t, tt, ttt; /* temporaries */
@@ -414,7 +414,7 @@ H5V_log2_gen(uint64_t n)
#endif /* H5_BAD_LOG2_CODE_GENERATED */
return(r);
-} /* H5V_log2_gen() */
+} /* H5VM_log2_gen() */
/* Lookup table for specialized log2(n) of power of two routine */
@@ -426,7 +426,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] =
/*-------------------------------------------------------------------------
- * Function: H5V_log2_of2
+ * Function: H5VM_log2_of2
*
* Purpose: Determines the log base two of a number (i.e. log2(n)).
* (i.e. the highest bit set in a number)
@@ -444,17 +444,17 @@ static const unsigned MultiplyDeBruijnBitPosition[32] =
*-------------------------------------------------------------------------
*/
static H5_inline unsigned UNUSED
-H5V_log2_of2(uint32_t n)
+H5VM_log2_of2(uint32_t n)
{
#ifndef NDEBUG
HDassert(POWER_OF_TWO(n));
#endif /* NDEBUG */
return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]);
-} /* H5V_log2_of2() */
+} /* H5VM_log2_of2() */
/*-------------------------------------------------------------------------
- * Function: H5V_limit_enc_size
+ * Function: H5VM_limit_enc_size
*
* Purpose: Determine the # of bytes needed to encode values within a
* range from 0 to a given limit
@@ -467,17 +467,17 @@ H5V_log2_of2(uint32_t n)
*-------------------------------------------------------------------------
*/
static H5_inline unsigned UNUSED
-H5V_limit_enc_size(uint64_t limit)
+H5VM_limit_enc_size(uint64_t limit)
{
- return (H5V_log2_gen(limit) / 8) + 1;
-} /* end H5V_limit_enc_size() */
+ return (H5VM_log2_gen(limit) / 8) + 1;
+} /* end H5VM_limit_enc_size() */
-static const unsigned char H5V_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
-static const unsigned char H5V_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE};
+static const unsigned char H5VM_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
+static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE};
/*-------------------------------------------------------------------------
- * Function: H5V_bit_get
+ * Function: H5VM_bit_get
*
* Purpose: Determine the value of the n'th bit in a buffer.
*
@@ -496,15 +496,15 @@ static const unsigned char H5V_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0
*-------------------------------------------------------------------------
*/
static H5_inline hbool_t UNUSED
-H5V_bit_get(const unsigned char *buf, size_t offset)
+H5VM_bit_get(const unsigned char *buf, size_t offset)
{
/* Test the appropriate bit in the buffer */
- return (hbool_t)((buf[offset / 8] & (H5V_bit_set_g[offset % 8])) ? TRUE : FALSE);
-} /* end H5V_bit_get() */
+ return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE);
+} /* end H5VM_bit_get() */
/*-------------------------------------------------------------------------
- * Function: H5V_bit_set
+ * Function: H5VM_bit_set
*
* Purpose: Set/reset the n'th bit in a buffer.
*
@@ -523,14 +523,14 @@ H5V_bit_get(const unsigned char *buf, size_t offset)
*-------------------------------------------------------------------------
*/
static H5_inline void UNUSED
-H5V_bit_set(unsigned char *buf, size_t offset, hbool_t val)
+H5VM_bit_set(unsigned char *buf, size_t offset, hbool_t val)
{
/* Set/reset the appropriate bit in the buffer */
if(val)
- buf[offset / 8] |= H5V_bit_set_g[offset % 8];
+ buf[offset / 8] |= H5VM_bit_set_g[offset % 8];
else
- buf[offset / 8] &= H5V_bit_clear_g[offset % 8];
-} /* end H5V_bit_set() */
+ buf[offset / 8] &= H5VM_bit_clear_g[offset % 8];
+} /* end H5VM_bit_set() */
-#endif /* H5Vprivate_H */
+#endif /* H5VMprivate_H */
diff --git a/src/H5Z.c b/src/H5Z.c
index 901b506..c55a5e3 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -664,7 +664,13 @@ H5Zfilter_avail(H5Z_filter_t id)
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number")
if((ret_value = H5Z_filter_avail(id)) < 0)
- HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter")
+ HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter")
+ else if(ret_value == FALSE) {
+ const H5Z_class2_t *filter_info;
+
+ if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id)))
+ ret_value = TRUE;
+ } /* end if */
done:
FUNC_LEAVE_API(ret_value)
@@ -1324,22 +1330,20 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags,
*/
if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) {
hbool_t issue_error = FALSE;
-
- /* Check for "no plugins" indicated" */
- const H5Z_class2_t *filter_info;
-
- /* Try loading the filter */
- if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) {
- /* Register the filter we loaded */
- if(H5Z_register(filter_info) < 0)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter")
-
- /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */
- if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0)
- issue_error = TRUE;
- } /* end if */
- else
- issue_error = TRUE;
+ const H5Z_class2_t *filter_info;
+
+ /* Try loading the filter */
+ if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) {
+ /* Register the filter we loaded */
+ if(H5Z_register(filter_info) < 0)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter")
+
+ /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */
+ if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0)
+ issue_error = TRUE;
+ } /* end if */
+ else
+ issue_error = TRUE;
/* Check for error */
if(issue_error) {
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index f9e7186..1b8c096 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -20,7 +20,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Vprivate.h" /* H5V_array_fill */
+#include "H5VMprivate.h" /* H5VM_array_fill */
#include "H5Zpkg.h" /* Data filters */
@@ -292,7 +292,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
#define H5Z_XFORM_DO_OP5(TYPE, SIZE) \
{ \
TYPE val = ((tree->type == H5Z_XFORM_INTEGER) ? (TYPE)tree->value.int_val : (TYPE)tree->value.float_val); \
- H5V_array_fill(array, &val, sizeof(TYPE), (SIZE)); \
+ H5VM_array_fill(array, &val, sizeof(TYPE), (SIZE)); \
}
/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x.
diff --git a/src/H5detect.c b/src/H5detect.c
index 0f8d051..aed7514 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -332,7 +332,7 @@ precision (detected_t *d)
if(_v1 != _v2) \
_pad_mask[_i] |= _byte_mask; \
_buf1[_i] ^= _byte_mask; \
- } /* enf for */ \
+ } /* end for */ \
\
/* Byte Order */ \
for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \
diff --git a/src/H5private.h b/src/H5private.h
index f54bd9d..a95cb0d 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -439,8 +439,8 @@
/*
* Maximum & minimum values for our typedefs.
*/
-#define HSIZET_MAX ((hsize_t)ULLONG_MAX)
-#define HSSIZET_MAX ((hssize_t)LLONG_MAX)
+#define HSIZET_MAX ((hsize_t)ULLONG_MAX)
+#define HSSIZET_MAX ((hssize_t)LLONG_MAX)
#define HSSIZET_MIN (~(HSSIZET_MAX))
/*
diff --git a/src/H5public.h b/src/H5public.h
index 6491ebf..92dcd91 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -75,10 +75,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 172 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 175 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "swmr0" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.9.172-swmr0" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.9.175-swmr0" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/src/H5system.c b/src/H5system.c
index 614b8b9..437a004 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -200,20 +200,28 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 'H':
if(sizeof(hsize_t) < sizeof(long))
modifier[0] = '\0';
- else if(sizeof(hsize_t) == sizeof(long))
- HDstrncpy(modifier, "l", (size_t)2);
- else
- HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, HDstrlen(H5_PRINTF_LL_WIDTH) + 1);
+ else if(sizeof(hsize_t) == sizeof(long)) {
+ HDstrncpy(modifier, "l", sizeof(modifier));
+ modifier[sizeof(modifier) - 1] = '\0';
+ } /* end if */
+ else {
+ HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier));
+ modifier[sizeof(modifier) - 1] = '\0';
+ } /* end else */
break;
case 'Z':
case 'z':
if(sizeof(size_t) < sizeof(long))
modifier[0] = '\0';
- else if(sizeof(size_t) == sizeof(long))
- HDstrncpy(modifier, "l", (size_t)2);
- else
- HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, HDstrlen(H5_PRINTF_LL_WIDTH) + 1);
+ else if(sizeof(size_t) == sizeof(long)) {
+ HDstrncpy(modifier, "l", sizeof(modifier));
+ modifier[sizeof(modifier) - 1] = '\0';
+ } /* end if */
+ else {
+ HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier));
+ modifier[sizeof(modifier) - 1] = '\0';
+ } /* end else */
break;
default:
diff --git a/src/Makefile.am b/src/Makefile.am
index 43d1d30..362bd95 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -108,8 +108,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5Tfloat.c H5Tinit.c H5Tnative.c H5Toffset.c H5Toh.c \
H5Topaque.c \
H5Torder.c \
- H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5V.c H5WB.c \
- H5Z.c H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \
+ H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5VM.c H5WB.c H5Z.c \
+ H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \
H5Zscaleoffset.c H5Ztrans.c
diff --git a/src/Makefile.in b/src/Makefile.in
index f6e52c6..2216e0f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -172,7 +172,7 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \
H5Tfields.lo H5Tfixed.lo H5Tfloat.lo H5Tinit.lo H5Tnative.lo \
H5Toffset.lo H5Toh.lo H5Topaque.lo H5Torder.lo H5Tpad.lo \
H5Tprecis.lo H5Tstrpad.lo H5Tvisit.lo H5Tvlen.lo H5TS.lo \
- H5V.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \
+ H5VM.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \
H5Znbit.lo H5Zshuffle.lo H5Zszip.lo H5Zscaleoffset.lo \
H5Ztrans.lo
libhdf5_la_OBJECTS = $(am_libhdf5_la_OBJECTS)
@@ -523,7 +523,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 162
+LT_VERS_REVISION = 165
LT_VERS_AGE = 0
# Our main target, the HDF5 library
@@ -606,8 +606,8 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5Tfloat.c H5Tinit.c H5Tnative.c H5Toffset.c H5Toh.c \
H5Topaque.c \
H5Torder.c \
- H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5V.c H5WB.c \
- H5Z.c H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \
+ H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvisit.c H5Tvlen.c H5TS.c H5VM.c H5WB.c H5Z.c \
+ H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c H5Zszip.c \
H5Zscaleoffset.c H5Ztrans.c
@@ -1018,7 +1018,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Tvisit.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Tvlen.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5UC.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5V.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5VM.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5WB.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Z.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Zdeflate.Plo@am__quote@
diff --git a/src/hdf5.lnt b/src/hdf5.lnt
index 6865720..90af778 100644
--- a/src/hdf5.lnt
+++ b/src/hdf5.lnt
@@ -1,9 +1,9 @@
// Lint options shared by both PC-Lint for Windows and Flexelint for Linux
// Turn off warnings about not using the inlined H5V* functions:
--esym(528, H5V_vector_reduce_product, H5V_vector_inc)
--esym(528, H5V_vector_cmp, H5V_vector_cmp_s, H5V_vector_cmp_u)
--esym(528, H5V_vector_zerop_s, H5V_vector_zerop_u)
+-esym(528, H5VM_vector_reduce_product, H5VM_vector_inc)
+-esym(528, H5VM_vector_cmp, H5VM_vector_cmp_s, H5VM_vector_cmp_u)
+-esym(528, H5VM_vector_zerop_s, H5VM_vector_zerop_u)
// Suppress message about using 'goto' in a few functions
-efunc(801,H5_term_library,H5_trace)
@@ -34,7 +34,7 @@
-esym(534, H5I_clear_type, H5I_dec_type_ref)
-esym(534, H5MM_xfree)
-esym(534, H5UC_decr)
--esym(534, H5V_array_fill)
+-esym(534, H5VM_array_fill)
// Turn off warnings about "Expression-like macro not parenthesized" for