Commit f820bb4a authored by Huihuo Zheng's avatar Huihuo Zheng
Browse files

changed cpp to c

parent f7bb134b
......@@ -84,7 +84,8 @@ typedef struct _DSET {
size_t ns_glob; // total number of samples
size_t s_offset; // offset
hsize_t size; // the size of the entire dataset in bytes.
BATCH batch; // batch data to read
BATCH batch; // batch data to read
int ns_cached;
bool contig_read; // whether the batch of data to read is contigues or not.
MPI_Datatype mpi_datatype; // the constructed mpi dataset
hid_t h5_datatype; // hdf5 dataset
......@@ -135,6 +136,7 @@ hid_t H5Dopen_cache(hid_t loc_id, const char *name, hid_t dapl_id);
// Reading dataset (one batch), and then the I/O thread write them to the SSDs
herr_t H5Dread_to_cache(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t xfer_plist_id, void * buf);
herr_t H5Dread_cache(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t xfer_plist_id, void * buf);
// Reading dataset (one batch) from the SSDs
herr_t H5Dread_from_cache(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_id, hid_t xfer_plist_id, void * buf);
......
......@@ -11,7 +11,7 @@ include make.inc
all: test_read_cache test_write_cache prepare_dataset
test_read_cache: test_read_cache.o H5Dio_cache.o ../utils/debug.o ../utils/profiling.o
$(CXX) $(CFLAGS) -o $@ test_read_cache.o ../utils/debug.o ../utils/profiling.o $(HDF5_LIB) -L$(HDF5_ROOT)/../vol/ -lh5passthrough_vol
$(CXX) $(CFLAGS) -o $@ test_read_cache.o ../utils/debug.o ../utils/profiling.o $(HDF5_LIB) H5Dio_cache.o
test_vol: test_vol.o ../utils/debug.o
......
......@@ -120,7 +120,10 @@ int main(int argc, char **argv) {
hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS);
H5Pset_fapl_mpio(plist_id, MPI_COMM_WORLD, MPI_INFO_NULL);
hid_t fd;
fd = H5Fopen(fname, H5F_ACC_RDONLY, plist_id);
if (cache)
fd = H5Fopen_cache(fname, H5F_ACC_RDONLY, plist_id);
else
fd = H5Fopen(fname, H5F_ACC_RDONLY, plist_id);
cout << H5DRMM.mpi.rank << " " << H5DRMM.mpi.nproc << endl;
hid_t dset;
tt.start_clock("H5Dopen");
......@@ -206,7 +209,7 @@ int main(int argc, char **argv) {
tt.start_clock("H5Dread");
if (cache) {
tt.start_clock("H5Dread_to_cache");
H5Dread_to_cache(dset, H5T_NATIVE_FLOAT, mspace, fspace, dxf_id, dat);
H5Dread_cache(dset, H5T_NATIVE_FLOAT, mspace, fspace, dxf_id, dat);
tt.stop_clock("H5Dread_to_cache");
} else {
H5Dread(dset, H5T_NATIVE_FLOAT, mspace, fspace, dxf_id, dat);
......@@ -252,7 +255,7 @@ int main(int argc, char **argv) {
tt.start_clock("H5Dread");
if (cache) {
tt.start_clock("H5Dread_from_cache");
H5Dread_from_cache(dset, H5T_NATIVE_FLOAT, mspace, fspace, dxf_id, dat);
H5Dread_cache(dset, H5T_NATIVE_FLOAT, mspace, fspace, dxf_id, dat);
tt.stop_clock("H5Dread_from_cache");
} else {
H5Dread(dset, H5T_NATIVE_FLOAT, mspace, fspace, dxf_id, dat);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment