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

added fixed from Quincey and Tang

parent a67bc951
......@@ -17,7 +17,8 @@ typedef struct _thread_data_t {
hid_t mem_type_id;
hid_t mem_space_id;
hid_t file_space_id;
hid_t xfer_plist_id;
hid_t xfer_plist_id;
void *h5_state;
int id;
hid_t offset; // offset in memory mapped file on SSD
hsize_t size;
......
......@@ -1240,6 +1240,12 @@ void *H5Dwrite_pthread_func_vol(void *arg) {
data->buf = mmap(NULL, data->size, PROT_READ, MAP_SHARED, wmm->mmap.fd, data->offset);
msync(data->buf, data->size, MS_SYNC);
H5VL_pass_through_ext_t *o = (H5VL_pass_through_ext_t *)data->dataset_obj;
hbool_t acq=false;
while(acq==false)
H5TSmutex_acquire(&acq);
H5VLrestore_lib_state(data->h5_state);
sleep(1);
void **req;
if (wmm->mpi.rank==0) printf("pthread: writing dataset %d to filesystem ... !\n", data->id);
#ifdef THETA
......@@ -1256,12 +1262,15 @@ void *H5Dwrite_pthread_func_vol(void *arg) {
data->file_space_id, data->xfer_plist_id,
data->buf, req);
#endif
H5VLreset_lib_state();
H5VLfree_lib_state(data->h5_state);
if (wmm->mpi.rank==0) printf("pthread: dataset %d written to filesystem, done!\n", data->id);
munmap(data->buf, data->size);
H5Sclose(data->mem_space_id);
H5Sclose(data->file_space_id);
H5Pclose(data->xfer_plist_id);
H5Tclose(data->mem_type_id);
H5TSmutex_release();
pthread_mutex_lock(&wmm->io.request_lock);
wmm->io.current_request=wmm->io.current_request->next;
wmm->io.num_request--;
......@@ -1337,6 +1346,7 @@ H5VL_pass_through_ext_dataset_write(void *dset, hid_t mem_type_id, hid_t mem_spa
fsync(o->H5DWMM->mmap.fd);
#endif
o->H5DWMM->io.request_list->dataset_obj = dset;
H5VLretrieve_lib_state(&o->H5DWMM->io.request_list->h5_state);
o->H5DWMM->io.request_list->mem_type_id = H5Tcopy(mem_type_id);
o->H5DWMM->io.request_list->mem_space_id = H5Scopy(mem_space_id);
o->H5DWMM->io.request_list->file_space_id = H5Scopy(file_space_id);
......@@ -1734,7 +1744,7 @@ H5VL_pass_through_ext_file_create(const char *name, unsigned flags, hid_t fcpl_i
#ifdef ENABLE_EXT_PASSTHRU_LOGGING
printf("------- EXT PASS THROUGH VOL FILE Create\n");
#endif
printf("fapl_id: %lld\n", fapl_id);
/* Get copy of our VOL info from FAPL */
H5Pget_vol_info(fapl_id, (void **)&info);
......
......@@ -13,8 +13,8 @@ LIBS=-L$(HDF5_DIR)/lib -lhdf5 -lz
CFLAGS=$(INCLUDES)
#TARGET=libh5passthrough_vol.dylib
TARGET=libh5passthrough_vol.so
##TARGET=libh5passthrough_vol.dylib
TARGET=libh5passthrough_vol.dylib
all: makeso test_write_cache
......
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