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

fixed initialization errors

parent 1a31aa68
......@@ -72,20 +72,7 @@ SSD = {
.mspace_left = 137438953472,
.offset = 0
};
H5Dwrite_cache_metadata
H5DWMM = {
.mpi.ppn = 1, // number of proc per node
.mpi.rank = 0, // rank id in H5F comm
.mpi.local_rank = 0, // local rank id in a node
.io.num_request = 0,//number of I/O request
.io.master_cond = PTHREAD_COND_INITIALIZER, // condition variable
.io.io_cond = PTHREAD_COND_INITIALIZER,
.io.request_lock = PTHREAD_MUTEX_INITIALIZER,
.io.request_list = NULL,
.io.current_request = NULL,
.io.first_request = NULL,
.ssd = &SSD
};
H5Dwrite_cache_metadata H5DWMM;
/*
Function for set up the local storage path and capacity.
......@@ -179,6 +166,11 @@ hid_t H5Fcreate_cache( const char *name, unsigned flags, hid_t fcpl_id, hid_t fa
int rc = pthread_create(&H5DWMM.io.pthread, NULL, H5Dwrite_pthread_func, NULL);
srand(time(NULL)); // Initialization, should only be called once.
setH5SSD();
H5DWMM.io.num_request = 0;
H5DWMM.io.master_cond = PTHREAD_COND_INITIALIZER;
H5DWMM.io.io_cond = PTHREAD_COND_INITIALIZER;
H5DWMM.io.request_lock = PTHREAD_MUTEX_INITIALIZER;
H5DWMM.ssd = &SSD;
MPI_Comm comm, comm_dup;
MPI_Info info;
H5Pget_fapl_mpio(fapl_id, &comm, &info);
......@@ -318,15 +310,7 @@ herr_t H5Sclose_cache(hid_t filespace) {
The following functions are for parallel read.
*/
H5Dread_cache_metadata
H5DRMM = {
.io.master_cond = PTHREAD_COND_INITIALIZER,
.io.io_cond = PTHREAD_COND_INITIALIZER,
.io.request_lock = PTHREAD_MUTEX_INITIALIZER,
.io.batch_cached = true,
.io.dset_cached = false,
.ssd = &SSD
};
H5Dread_cache_metadata H5DRMM;
/*
Helper function to compute the local number of samples and the offset.
*/
......@@ -472,6 +456,12 @@ void create_mmap(const char *prefix) {
hid_t H5Fopen_cache( const char *name, hid_t fcpl_id, hid_t fapl_id ) {
srand(time(NULL)); // Initialization, should only be called once.
setH5SSD();
H5DRMM.io.master_cond = PTHREAD_COND_INITIALIZER;
H5DRMM.io.io_cond = PTHREAD_COND_INITIALIZER;
H5DRMM.io.request_lock = PTHREAD_MUTEX_INITIALIZER;
H5DRMM.io.batch_cached = true;
H5DRMM.io.dset_cached = false;
H5DRMM.ssd = &SSD;
MPI_Comm comm;
MPI_Info info;
H5Pget_fapl_mpio(fapl_id, &comm, &info);
......
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