Skip to content

Commit

Permalink
ci: test deflate for subfiling
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoklee committed Oct 16, 2023
1 parent a2b8c76 commit b94890a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ endif ()
option (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" ON)
if (HDF5_ENABLE_Z_LIB_SUPPORT)
if (NOT H5_ZLIB_HEADER)
message (VERBOSE "NO H5_ZLIB_HEADER")
if (NOT ZLIB_USE_EXTERNAL)
find_package (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared)
if (NOT ZLIB_FOUND)
Expand All @@ -92,12 +93,15 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
endif ()
endif ()
else ()

# This project is being called from within another and ZLib is already configured
set (H5_HAVE_FILTER_DEFLATE 1)
set (H5_HAVE_ZLIB_H 1)
set (H5_HAVE_LIBZ 1)
endif ()
find_package (ZLIB)
if (ZLIB_FOUND)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES})
set (H5_HAVE_FILTER_DEFLATE 1)
set (H5_HAVE_ZLIB_H 1)
set (H5_HAVE_LIBZ 1)
Expand Down
16 changes: 11 additions & 5 deletions testpar/t_subfiling_vfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,14 +1461,18 @@ test_subfiling_write_many_read_one(void)
hsize_t start[1];
hsize_t count[1];
hsize_t dset_dims[1];
#ifdef H5_HAVE_FILTER_DEFLATE
hsize_t chunk_dims[1];
#endif
size_t target_size;
hid_t file_id = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
hid_t dset_id = H5I_INVALID_HID;
hid_t dxpl_id = H5I_INVALID_HID;
hid_t fspace_id = H5I_INVALID_HID;
#ifdef H5_HAVE_FILTER_DEFLATE
hid_t plist_id = H5I_INVALID_HID;
#endif
void *buf = NULL;

curr_nerrors = nerrors;
Expand Down Expand Up @@ -1511,17 +1515,17 @@ test_subfiling_write_many_read_one(void)
}

dset_dims[0] = (hsize_t)(target_size / sizeof(SUBF_C_TYPE));
printf("%zu\n", dset_dims[0]);

fspace_id = H5Screate_simple(1, dset_dims, NULL);
VRFY((fspace_id >= 0), "H5Screate_simple succeeded");


#ifdef H5_HAVE_FILTER_DEFLATE
plist_id = H5Pcreate(H5P_DATASET_CREATE);
VRFY((plist_id >= 0), "H5Pcreate() succeeded");

chunk_dims[0] = dset_dims[0] / 2;
printf("%zu\n", chunk_dims[0]);

VRFY((H5Pset_chunk(plist_id, 1, chunk_dims) >=0), "H5Pset_chunk succeeded");
VRFY((H5Pset_deflate(plist_id, 9) >=0), "H5Pset_deflate succeeded");
#endif
dset_id = H5Dcreate2(file_id, "DSET", SUBF_HDF5_TYPE, fspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((dset_id >= 0), "Dataset creation succeeded");

Expand All @@ -1542,7 +1546,9 @@ test_subfiling_write_many_read_one(void)

free(buf);
buf = NULL;
#ifdef H5_HAVE_FILTER_DEFLATE
VRFY((H5Pclose(plist_id) >= 0), "H5Pclose() succeeded");
#endif
VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded");
VRFY((H5Fclose(file_id) >= 0), "File close succeeded");

Expand Down
6 changes: 3 additions & 3 deletions utils/subfiling_vfd/h5fuse.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ for i in "${subfiles[@]}"; do
fi
done

START="$(date +%s%N)"
START="$(date +%s)"

mpi_rank=0
mpi_size=1
Expand Down Expand Up @@ -262,8 +262,8 @@ for i in "${subfiles[@]}"; do
icnt=$(( icnt +1 ))
done; wait

END=$(( $(date +%s%N) - START ))
END=$(( $(date +%s) - START ))
DURATION_SEC=$(awk -vp="$END" -vq=0.000000001 'BEGIN{printf "%.4f" ,p * q}')
if [ "$quiet" == "false" ]; then
echo -e "$PUR COMPLETION TIME = $DURATION_SEC s $NC"
fi
fi

0 comments on commit b94890a

Please sign in to comment.